The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 variable text

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
coll@inia. Posted - 03/28/2012 : 06:17:33 AM
Origin Ver.8.5 and Service Release (Select Help-->About Origin):
Operating System:win7

I am trying to put color black to all 100 text objects in a drawing with Labtalk.
I used the following string but the final tt$.color=1 does not recognize the text+ii variable despite typing it correctly.

Why it does not work?

for(ii=1;ii<100;ii++) {aa$="text"; bb$=$(ii); tt$= aa$+bb$; type -c tt$; tt$.color=1}

Thank you , Dr.coll
3   L A T E S T    R E P L I E S    (Newest First)
coll@inia. Posted - 03/28/2012 : 10:34:06 AM
Thank you for the help!!,

I got it to work with both of your suggested changes ; and %. Here is the resulting "good" script:
for(ii=1;ii<100;ii++) {aa$="text"; bb$=$(ii); tt$= aa$+bb$; ifn!%(tt$).color=1;}

MANY THANKS again, julio
Drbobshepherd Posted - 03/28/2012 : 09:50:03 AM
Also, the LabTalk interpreter may be reading tt$ literally as "tt$" and not "text1" as you desire. In these cases, I find the string register variables (e.g. %A, %B, %J, ...) very useful.

I hope this helps.
Drbobshepherd Posted - 03/28/2012 : 09:42:54 AM
Could be your command does not work because you failed to end it. Try putting a semicolon after the "tt$.color=1" and your LabTalk code might run.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000