Zum Hauptinhalt gehen

Suche

Suche

Running A Script Depending On Serialization

Kommentare

4 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    The field references are read only.  However, as they their ultimate purpose is to be used in a data source value of a label object you would instead set the value of the data source rather than the database field.  This is what your code should probably look like:

     

    If Field("sleevestickerS$.Field 1") = X Then
         value = "1000"
    End If
    

    Where X is whatever value you are testing for.

    0
  • Avatar
    Legacy Poster

    Hi,

     

    The other issue I am having is I am trying to set X to be the serialized value that Bartender is generating, and then use this X in conditional statement as you pointed out. But I do not know how to do this or if Bartender can do this. I tried to use the lines of code, but failed:

     

    Dim X

    X = Format.Objects("Text 7").Value //issue here, how do I get the value of the current serialization number during print time? Text 7 is a screen data text object that increments by 1during print

    If Field("sleevestickerS$.Field 1") = X Then

    value = "last label"   //other calculation

    End If

     

    I have attached screenshot, csv and btw files of what I am trying to do.

    Regarding the attached screenshot: what I am currently doing now is manually crossing out the last labels "Pcs in box" value and writing the remainder by hand...

     

    Thank you for your advice,

    0
  • Avatar
    Legacy Poster

    Hi,

     

    I am trying to do exactly the same process.

    Can anyone tell me how to read the value of the serialization so I can run use the serialization number in my calculations.

     

     

    Thanks

    0
  • Avatar
    Legacy Poster

    Hi I have now managed this.

     

    Strange way of doing it but this seems to have worked.

     

    Create a new Text Object on the label.

    Use the VB "Event Control Scripts" Script for "ON Serialize Event"

    Create a variable and set it as a counter

     

    Dim BoxPos

    BoxPos = BoxPos +1

     

    You can now use this value in your calculations.

     

    Hope this helps.

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.