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. |