Page 1 of 1

change the content of the variable

Posted: Mon May 02, 2016 1:11 pm
by shalu
Hi All,

I have a variable it's contain lots of lines also, I have two fields one for input the line number and another for replacement the content, I want to change the content variable and save into a new variable using the Fields. is it possible :(

Thanks
Shalu S

Re: change the content of the variable

Posted: Mon May 02, 2016 3:02 pm
by dunbarx
Hi.

If I understand what you want, do this:
1- Make two fields. Name one "NewText" and the other "lineToChange"
2 - Make a button and put this into its script:

Code: Select all

on mouseUp
   put "A" & return & "B" & return & "C" into testVar
   put fld "NewText" into line (fld "lineToChange") of testVar
   answer testVar
end mouseUp
To pay for this extraordinary effort on my part, please step through the handler and watch what happens in the debugger.

Craig Neman

Re: change the content of the variable

Posted: Tue May 03, 2016 5:30 am
by shalu
@Craig Neman

Great coding, It's working.