Jason Russell
asked on
too many arguments have been given to this function
I'm trying to create a 2d DataMatrix barcode. With trying to do this and follow customer specs for said barcode, I'm running into issues with my code. I need fields such as {V_LMINVTRY_MANUFACTURED.P ART_NO} to have 15 chars in it and same with {V_LMINVTRY_MANUFACTURED.F G_LOTNO}. These are giving me issues. Part number and FG_LOTNO are both strings. Any help with this will be greatly appreciated. The bolded text is the part I need helped with. The rest works fine.
StringVar CompleteBarcodeString:="";
StringVar DataToEncode:= ('#P'+totext({V_LMINVTRY_M ANUFACTURE D.PART_NO} ,000000000 0000000')+ ' '+'&VNONE '+' '+('#Q'+totext({V_LMINVTRY _MANUFACTU RED.QUANTI TY},'00000 '))+('&L'+ totext({V_ LMINVTRY_M ANUFACTURE D.FG_LOTNO },'0000000 00000000') );
NumberVar i:=0;
NumberVar Segments:=
DataMatrixEncodeSet(DataTo Encode, -1);
For i:=0 to Segments Do
(
CompleteBarcodeString := CompleteBarcodeString +
DataMatrixEncodeGet(i);
);
CompleteBarcodeString
StringVar CompleteBarcodeString:="";
StringVar DataToEncode:= ('#P'+totext({V_LMINVTRY_M
NumberVar i:=0;
NumberVar Segments:=
DataMatrixEncodeSet(DataTo
For i:=0 to Segments Do
(
CompleteBarcodeString := CompleteBarcodeString +
DataMatrixEncodeGet(i);
);
CompleteBarcodeString
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It may not be the only problem, but you're missing the opening quote on the format string in the first Totext function. You have
totext({V_LMINVTRY_MANUFAC TURED.PART _NO},00000 0000000000 0')
instead of
totext({V_LMINVTRY_MANUFAC TURED.PART _NO},'0000 0000000000 00')
FWIW, I'll disagree with mlmcc on the use of + vs &. I prefer +, because that forces all of the concatenated members to be strings. I normally do any required conversions to strings myself (so that I can control the formatting), and using + makes sure that I don't miss anything.
James
totext({V_LMINVTRY_MANUFAC
instead of
totext({V_LMINVTRY_MANUFAC
FWIW, I'll disagree with mlmcc on the use of + vs &. I prefer +, because that forces all of the concatenated members to be strings. I normally do any required conversions to strings myself (so that I can control the formatting), and using + makes sure that I don't miss anything.
James
I would look at the values for the various variables you're including in DataToEncode and make sure there isn't a comma or semicolon in there that shouldn't be.