Creating variables
François Chaplais
francois.chaplais at mines-paristech.fr
Wed Aug 6 12:07:09 EDT 2008
Le 6 août 08 à 16:53, Eric Chatonet a écrit :
> To be frank, I don't understand:
> Below is your code snippet simplified.
> What it does?
> It stores a variable into a custom property: so far so good ;-)
> But what more?
> Please, enlighten me :-)
>
> on mouseUp
> ask "Name of pseudo variable:" with "anExample"
> if it is empty then exit mouseUp
> put it into varName
> ask "value of variable" && varName
> if it is empty then exit mouseUp
> put it into varValue
> set the myProps[varName] of me to varValue
> answer "Do you want to retrieve the value of your variable?"
> with "Cancel" or "OK"
> if it is "OK" then
> answer "This is the value of variable" && varName & ":" &&
> the myProps[varName] of me
> end if
> end mouseUp
>
>
the OP's code was
> I did try this:
>
> repeat for each line lineListOne in listOne
> repeat for each line lineListTwo in listTwo
> put "test" into (lineListOne & lineListTwo)
> end repeat
> end repeat
>
> and this (though I was sure it didn't work):
>
> repeat for each line lineListOne in listOne
> repeat for each line lineListTwo in listTwo
> put (lineListOne & lineListTwo) into varName
> put "test" into varName
> end repeat
> end repeat
>
> and some other variants (using the value of...) but nothing is
> working.
>
> Is that possible or do I have to "manually" initialize the
> variables that way:
>
> put "test" into A1
> put "test" into A2
I interpreted this code as an attempt to manipulate a variable
designated by name only . I have not found a way to do so without
using the "do" command, which you rightfully pointed out as a
solution (but perhaps someone in the list knows of another way).
My only point is that custom properties are a way to store and
retrieve data labeled with a string which is itself stored in a
variable. It is probable that arrays would also do the trick, but I
do not know arrays enough to elaborate on this.
My apologies if I am not very clear, but Revolution programming is
just a hobby to me and since I am on vacation, I have some time to
experiment some code, this should be over next week :-(
Best regards,
François
More information about the use-livecode
mailing list