These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#57359 - 12/18/19 02:18 AM Barcode Data Definition
grostahledv Offline
OL Newbie

Registered: 12/18/19
Posts: 1
Hello Guys,
hopefully you can help me.

I have a Document with a Barcode & under custom data selection this string is written:

"='13'+right(('0000000000' + stringreplace(trim(@(30,46,56)),'.','')),10)"

I have no clue what this string does, maybe some of you can tell me smile

Thanks !

#57361 - 12/18/19 08:40 AM Re: Barcode Data Definition [Re: grostahledv]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 681
Loc: Québec, Canada
So, my guess, this is the work of someone else...right? wink

Here's how it goes:
  • trim(@(30,46,56) = removes any leading or trailing spaces in the data selection
  • stringreplace(trim(@(30,46,56)),'.','') = replace any '.' with ''
  • ('0000000000' + stringreplace(trim(@(30,46,56)),'.','') = concatenate a bunch of 0 in front of the data selection
  • right(('0000000000' + stringreplace(trim(@(30,46,56)),'.','')),10) = extract 10 character of the new string (from previous concatenation) starting from the right
  • '13'+right(('0000000000' + stringreplace(trim(@(30,46,56)),'.','')),10)" = adds the string '13' before it.

Basically it pads the data selection with 0's in front of it, to a maximum of 10 characters and adds the number 13 in front of all that.
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code