Global Set Object Value フォローする

0
Avatar
Legacy Poster

Why is this disabled?
Example
You have 20 text fields.
I want text1 to check conditionA, I have to go to text1's properties, VB Script, and add a conditionA in there and set its value. If this condition is being shared by the rest of 19 other text field, i have to do the same thing again and aagin...

Here is the wishlist if possible [b]allow global to set object.Value[/b]
File->Label->Format Options
[code]
if (conditionA)
Format.Objects("text1").Value = "A"
Format.Objects("text2").Value = "A"
Format.Objects("text3").Value = "A"
...
end if
[/code]

3 コメント

0
Avatar
Shotaro Ito
モデレータ
コメントアクション Permalink

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
コメントアクション Permalink

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
モデレータ
コメントアクション Permalink

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.

ログインしてコメントを残してください。