Too Many Arguments for this function creating 2d bar code formula

I am getting the error "too many arguments for this function" on the NumberVar Segments the formula below.  It works properly if I use a string input in place of the table/field references.  Any ideas appreciated.

stringVar DataToEncode:= {SO_PackingListWrk.ItemCode} + " " + {SO_PackingListWrk.AliasItemNo} + " " + {SO_PackingListWrk.LineNumber};  //{Table1.Field1};
stringVar CompleteBarcodeString:="";
numberVar i:=0;
numberVar Segments:= IDAutomationDataMatrixEncoderDMGet(DataToEncode,0 ,0 ,0 );
For i:=0 to Segments Do
CompleteBarcodeString := CompleteBarcodeString + IDAutomationDataMatrixEncoderDMGet(i);
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SInce I don't know the function try this.

Add this formula to the detail section and review the values.

 {SO_PackingListWrk.ItemCode} + " " + {SO_PackingListWrk.AliasItemNo} + " " + {SO_PackingListWrk.LineNumber};  

Are there any that are "different".

I'm not familiar with that function either, but it seemed odd to me that you were using the same function with two very different sets of arguments -- (DataToEncode,0 ,0 ,0 ) and (i).  And you're using the results from that function in very different ways -- As the numeric value for Segments in the first case, and as a string in the second.

 So I did a Web search and it looks like you got the name wrong for the first function.  Looking at this page

 The first function (used to set Segments) should be

 You used
IDAutomationDataMatrixEncoderDMGet  (Get, instead of Set)

 So, you presumably need to change the line to

numberVar Segments:= IDAutomationDataMatrixEncoderDMSet(DataToEncode,0 ,0 ,0 );

Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
stringVar DataToEncode:= {SO_PackingListWrk.ItemCode} + " " + {SO_PackingListWrk.AliasItemNo} + " " + {SO_PackingListWrk.LineNumber}; 

Open in new window

stringVar DataToEncode:= {SO_PackingListWrk.ItemCode} + " " + ToText({SO_PackingListWrk.AliasItemNo},0,"") + " " + ToText({SO_PackingListWrk.LineNumber},0,""); 

Open in new window

Explanation: when Crystal concatenates a number into a text string, it has to first convert it to a string. By default, it adds thousand separator (comma) and 2 decimals.  The Comma is triggering the error. Using ToText() gives you control over the number-to-string conversion. The suggested syntax above specifies zero (0) decimals and no thousand separator ("").

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

 You could be right, although the fact that he's using + to concatenate the fields, instead of &, indicates that the fields are already strings.

 Either way, he appears to be using the wrong function in the first instance.

FWIW, I don't think Ido's post was a solution.  As I mentioned before, the fact that the OP was using + to concatenate the fields, instead of &, indicates that the fields were already strings.  If so, Ido's point about how CR converts numbers to strings doesn't apply.

 I think the error was because the OP was using the wrong function name in that line (as described in my earlier post), although that is just a guess.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.