Separate string from DMC in individual data according separators
Hello,
I would like to ask you for help. I need create label in Bartender. Label will be has DMC code and text boxes. DMC will be read from input label by barcode reader. In DMC will be string where will be individual data such part number, qty, name, batch number etc. This data will be separate by separators "@" and will be starting with defined identifier (for example "1P")
I need to know, how I can get individual data from DMC string to text box. Attached is a picture where you can see what I need.
Data can has diferent lenght. I have Bartender 2016.
Thank you very much for your support.
Martin
-
Hello Martin,
Thank you for using our forums.
Since you have BarTender v2016, the only options available to achieve this are:
* Option 1: Using Transform options (within the properties of a text object)
* Option 2: Using VB Script
The availability of those two options is going to depend on the edition that you have.
Option 1 - Using transform options
The key thing when using the Transform options to adapt the portion of the text we want to display, is making use of the Object Value data type:
As you can see, I have created a text object and used the Object Value option so that it reads the contents of Text 1 (which is the main data source, marked in red). Using Object Value allows us to make changes to our data without modifying the original data source. This way, we can make use of several Transform actions:
To isolate the value that we want. We can use similar steps for the different identifiers.
Option 2 - Using VB Script
The idea would be similar but since the number of character is variable, it complicates things a bit. However you might find the following example helpful:
Basically you locate the separator on the string, then with a counter you can count up the number of characters on for each piece of data and afterwards we remove them using the calculated number of characters.
I hope this helps!
0 -
Hello Laura,
thank you for your answer. I think option 1 is fine for me.
Have a nice day.
Martin.
0
Please sign in to leave a comment.
Comments
2 comments