Skip to main content

Search

Search

Global Set Object Value

Comments

3 comments

  • Avatar
    Shotaro Ito
    Hi Tj,
    Text objects may have several substrings, so you cannot just give single string to text object datasource.
    What you can do is assign the same shared substring name to multiple substrings, to share datasource.
    You can name substring via Datasource > Advanced dialog > Share / Name.
    Once substrings has the same share name, it will share the datasource including [More Options] setting (Prompt, OnProcessData script etc)

    [attachment=28:GiveShareNametoSubstring.png]
    [attachment=29:SetValueToShareName.png]

    From VB Script, you can set Value to named substrings like
    [code]
    Format.NamedSubStrings("SUBSTRING1").Value = "Hello"
    'or
    SUBSTRING1 = "Hello"
    [/code]

    (I understood it would be nice to have a way to assign value via object name - like [font="Lucida Console"][color="#000080"]Format.Objects("text1").Substrings(1).Value = "A"[/color][/font] etc.)
    0
  • Avatar
    Legacy Poster
    Shotaro,
    I've tried this at Format Options->On New Records , but it did not work
    [code]if (condition) then
    stxt1 = "A"
    stxt2 = "B"
    stxt3= "C"
    stxt4 = "C"
    stxt5 = "D"
    end if[/code]
    0
  • Avatar
    Shotaro Ito
    Hi tj,

    As on BarTender 9.4, you cannot set value to shared substring in
    OnNewRecord, OnSerialize and OnIdenticalCopies Events in Label Format option's VB Script.
    (It's not well documented though)

    You can do that on datasource level VB script's Event control script.
    Create a dummy text at out of label and you can run the script like above.
    0

Please sign in to leave a comment.