change the content of the variable

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
shalu
Posts: 72
Joined: Fri Mar 20, 2015 1:05 pm

change the content of the variable

Post 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
--
Thanks
Shalu S
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: change the content of the variable

Post 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
shalu
Posts: 72
Joined: Fri Mar 20, 2015 1:05 pm

Re: change the content of the variable

Post by shalu »

@Craig Neman

Great coding, It's working.
--
Thanks
Shalu S
Post Reply