Page 1 of 1

How to use (tFile_ & i) to return values of variables

Posted: Sun May 24, 2009 1:19 pm
by alex298
Hi,

How can I get the values of the variables of tFile_1 and tFile_2 as shown below:
on mouseUp
put "This is File one" into tFile_1
put "This is File two" into tFile_2

Repeat with i = 1 to 2
## answer tFile_ & i return tFile_1
## answer (tFile_ & i) also return tFile_1
## answer ("tFile_" & i) also return tFile_1
##
## How to get the string variable of tFile_1 and tFile_2
end Repeat
end mouseUp
I used it before but I suddently forgot it. Oh.... the memory of an old man is really very short :cry:

Please help.

Thanks and best regards

Posted: Sun May 24, 2009 3:43 pm
by bn
Alex,

try value() as in this

Code: Select all

on mouseUp
   put "This is File one" into tFile_1
   put "This is File two" into tFile_2
   
   Repeat with i = 1 to 2
      answer value (tFile_ & i)
   end Repeat
end mouseUp
with kind regards and respect for an 'old' man from a not so young man

Bernd

Posted: Mon May 25, 2009 2:59 am
by alex298
Dear Bernd,

Thanks for your help~~~ It works!

Best regards