Link to home
Start Free TrialLog in
Avatar of dmac47
dmac47

asked on

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 =IDAutomation...in 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);
);
CompleteBarcodeString
Avatar of Mike McCracken
Mike McCracken

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".

mlmcc
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

http://support.idautomation.com/Data-Matrix/How-to-create-Data-Matrix-Barcodes-in-Crystal-Reports-with-fonts/_614

 The first function (used to set Segments) should be
IDAutomationDataMatrixEncoderDMSet

 You used
IDAutomationDataMatrixEncoderDMGet  (Get, instead of Set)

 So, you presumably need to change the line to

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

 James
ASKER CERTIFIED SOLUTION
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ido,

 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.

 James
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.

 James