Set Value And Serialize It Follow

0
Avatar
Legacy Poster

Hello!

Right now i have to create a label to my customer. They want to automate all data inputs, for error-free operating.

As you can see on picture of label there are only 3 fields: LAN, LNR and starting number (that big 4-digit number)

 

LAN number is entered by selecting it from dropdown list (depending of type of product), LNR number is entered manualy and starting number is determined by selected LAN number (ex: if LAN is 4000 then starting number is 0001). I managed to make that with VB scripting, but that value can't be serialized.

 

This is my statement:

If Format.NamedSubStrings("lanBr").Value = "4000" Then
Value = "0001"
ElseIf Format.NamedSubStrings("lanBr").Value = "4010" Then
Value = "5001"
ElseIf Format.NamedSubStrings("lanBr").Value = "4900" Then
Value = "9001"
ElseIf Format.NamedSubStrings("lanBr").Value = "12630" Then
Value = "6001"
ElseIf Format.NamedSubStrings("lanBr").Value = "12632" Then
Value = "8001"
End If

Value is set successfully, but on printing i need to serialize that value, so i opened "More options", then enabled Serialization, but my value is not serializing (yes i entered value in "Number of Serialized Labels" field in Print dialog)

 

I think that problem is with my statement, I think that it's setting value every second (like in Update function in Unity or similar). Is it possible to set value just once when i choose LAN number?

 

I attached .btw file of label and screenshot of label (I'm using Bartender Enterprise 9.4 version)

2 comments

0
Avatar
Michael Toupin (mtoupin
Comment actions Permalink

So I've tested this, and there's a problem of timing.  You need this to only fire once right after the prompt, so what I've done that makes this work appropriately is change the VB script to an 'event control script' using the 'OnPostPrompt' event.  That way it will only execute after the prompt occurs and will allow serialization to work appropriately.

0
Avatar
Legacy Poster
Comment actions Permalink

Yeah! It works now!

I knew that problem was with event, but I didn't know what events are in Bartender.

I didn't even found it in VB Scripting help book in Bartender.

Please sign in to leave a comment.