Hello OS-community,
how to write a ZPL-code printing elements of a single or multi-dimensioned array (ie. Array(i), Arrax(i,j)) in one line in the output of the text viewer?
Thanks
Hello OS-community,
how to write a ZPL-code printing elements of a single or multi-dimensioned array (ie. Array(i), Arrax(i,j)) in one line in the output of the text viewer?
Thanks
Best answer by David.Nguyen
Hi Lieu-Kim,
I would do the following:
DECLARE Z, DOUBLE, 2, 5, 5
FOR i, 1, 5, 1
FOR j, 1, 5, 1
Z(i, j) = i + j
NEXT j
NEXT i
result$ = ""
FORMAT 1.0
FOR i, 1, 5, 1
FOR j, 1, 5, 1
result$ = result$ + " " + $STR(Z(i,j))
NEXT j
NEXT i
PRINT result$
RELEASE Z
Which is basically, save an empty string, and add the number to be displayed to that string using the $STR() function. At the end, print the string.
Does that make sense?
Take care,
David
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.