0
votes

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
1
Hi, I see you're new to StackOverflow. If you feel an answer solved the problem, please mark it as accepted by clicking the green check mark. This helps keep the focus on older SO which still don't have answers. If the answer did not help, please provide additional information so the community can provide improved answers. Thanks!Elton Saunders

1 Answers

3
votes

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.