How do I do a LTRIM on a variable in ZPL2?

C Curtis Richey 2 years 11 months ago
358 1 0

I need to trim leading spaces from a variable I'm sending to a label with ZPL2.

This is what the row of code looks like:
^FO260,39^ACR,73,25^FD$1HWWRPQT^FS
$1HWWRPQT is a variable.

I tried this:
^FO260,3^ACR,73,25^FDLTRIM$($1HWWRPQT)^FS
But it returns:
LTRIM$($1HWWRPQT)
How do I trim the variable?  Do I need something between the ^FD and the LTRIM$()?

Please register or login to post a reply

1 Replies

D Dmitry Prokhorov

Hello Curtis,

As you can see in ZPL Programming Guide: https://www.zebra.com/content/dam/zebra/manuals/printers/common/program…; the LTRIM$ command is ZBI language command, not ZPL command. You can call ZBI from ZPL with "^JI" or "~JI" ZPL command. Although, it will require you to write some program on ZBI language, not just to call LTRIM$ function.

You can find ZBI examples here: Zebra Basic Interpreter (ZBI) Support & Downloads | Zebra

Hope it helps.

Dmitry Prokhorov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

CONTACT
Can’t find what you’re looking for?