Reputation: 11
I have a printer than I can send labels to with the ZPL programming language.
What I am trying to do is to have a conditional statement where it will show the barcode only if a tag that is passed in is true.
Here is the code so far:
^XA
^PW1181
^BY3,3,236^FT64,527^BCN,,Y,N
^FD>:[$V:barcodeInformation$]^FS
^FT819,167^A0N,50,50^FH\^FDThis is a test^FS
^PQ1,0,1,Y^XZ
The online visual editor that I am using: http://labelary.com/viewer.html
I have found this page about the if else statement in zpl but I cannot get it working:
http://www.cs.utexas.edu/users/lin/zpl-manual/node70.html#SECTION00082000000000000000
^XA
^PW1181
if false then
^BY3,3,236^FT64,527^BCN,,Y,N;
else
end;
^FD>:[$V:barcodeInformation$]^FS
^FT819,167^A0N,50,50^FH\^FDThis is a test^FS
^PQ1,0,1,Y^XZ
Upvotes: 0
Views: 6365
Reputation: 248
Yep, ZPL not is Turing complete
Other solution, in my case i injection vb.net code inside code ZPL for clean or get specific value of an array and work awesome
Upvotes: 0
Reputation: 1278
The link you provided to the ZPL manual is not for the Zebra Programming Language, but rather for Z-level Programming Language. It has no relation to Zebra Printer Language.
The correct link is here.
Zebra Programming Language (ZPL) is defined as a programming language but is more like a mark up language. It does not have logical operators. You should do your logic in the program that is creating the ZPL code and just send the code that you want displayed.
Upvotes: 4