Variable Named Variable Values?

2014-05-16 Thread Rick Harrison
Hi there,

Ok, so here’s the question.  I’m sure someone has probably
done this before.  I can’t seem to find the answer, so perhaps
you can help.

I have a bunch of variable named pair values read in from a file.
(I do not know the order these values will be coming into from
the file as they can vary over time.)

The format is:

(Variable Name1)=(Variable Value1)
(Variable Name2)=(Variable Value2)
(Variable Name3)=(Variable Value3)
etc.

Example Data would be:

VarUserID=“3124
VarUserName = “John”
VarUserEmail = “j...@yahoo.com”
etc.

I’m able to retrieve the name of the variable and the value of the variable 
into variables.

How do I now assign the values to the original Variable Name by referring to 
the correct variable name read in?

This is some kind of a double reference possibly referring to contents or the 
value of a variable, it may involve arrays etc.

Ideas? Suggestions?

Thanks in advance!

Rick









___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Variable Named Variable Values?

2014-05-16 Thread Dar Scott
Look at the function value().  

I would also consider looking at arrays.  You can use ‘combine’ to put values 
into the array and then use ‘repeat’ to clean up by removing the quotes.

Dar

Dar Scott Consulting
Libraries and Externals

On May 16, 2014, at 12:32 PM, Rick Harrison harri...@all-auctions.com wrote:

 Hi there,
 
 Ok, so here’s the question.  I’m sure someone has probably
 done this before.  I can’t seem to find the answer, so perhaps
 you can help.
 
 I have a bunch of variable named pair values read in from a file.
 (I do not know the order these values will be coming into from
 the file as they can vary over time.)
 
 The format is:
 
 (Variable Name1)=(Variable Value1)
 (Variable Name2)=(Variable Value2)
 (Variable Name3)=(Variable Value3)
 etc.
 
 Example Data would be:
 
 VarUserID=“3124
 VarUserName = “John”
 VarUserEmail = “j...@yahoo.com”
 etc.
 
 I’m able to retrieve the name of the variable and the value of the variable 
 into variables.
 
 How do I now assign the values to the original Variable Name by referring to 
 the correct variable name read in?
 
 This is some kind of a double reference possibly referring to contents or the 
 value of a variable, it may involve arrays etc.
 
 Ideas? Suggestions?
 
 Thanks in advance!
 
 Rick
 
 
 
 
 
 
 
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Variable Named Variable Values?

2014-05-16 Thread zryip theSlug
Hi Rick,

You can also use the do command:

set the itemdel to =
repeat for each lines tLine in tVariablesAndDataList
   do put item 2 of tLine into  item 1 of tLine
end repeat

where tVariablesAndDataList contains:
VarUserID=“3124
VarUserName=“John”
VarUserEmail=“j...@yahoo.com”

On Fri, May 16, 2014 at 8:32 PM, Rick Harrison
harri...@all-auctions.com wrote:
 Hi there,

 Ok, so here’s the question.  I’m sure someone has probably
 done this before.  I can’t seem to find the answer, so perhaps
 you can help.

 I have a bunch of variable named pair values read in from a file.
 (I do not know the order these values will be coming into from
 the file as they can vary over time.)

 The format is:

 (Variable Name1)=(Variable Value1)
 (Variable Name2)=(Variable Value2)
 (Variable Name3)=(Variable Value3)
 etc.

 Example Data would be:

 VarUserID=“3124
 VarUserName = “John”
 VarUserEmail = “j...@yahoo.com”
 etc.

 I’m able to retrieve the name of the variable and the value of the variable 
 into variables.

 How do I now assign the values to the original Variable Name by referring to 
 the correct variable name read in?

 This is some kind of a double reference possibly referring to contents or the 
 value of a variable, it may involve arrays etc.

 Ideas? Suggestions?

 Thanks in advance!

 Rick









 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode



-- 
Zryip TheSlug
http://www.aslugontheroad.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Variable Named Variable Values?

2014-05-16 Thread Robert Brenstein

On 16.05.2014 at 14:32 Uhr -0400 Rick Harrison apparently wrote:


How do I now assign the values to the original Variable Name by 
referring to the correct variable name read in?


This is some kind of a double reference possibly referring to 
contents or the value of a variable, it may involve arrays etc.


Ideas? Suggestions?



If you actually want variable names, the do command is your friend.

do put  q(tVarValue)  into tVarName

However, such things are really easier to handle as arrays.

put tVarValue into gSessionGlobal[tVarName]

Robert

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Variable Named Variable Values?

2014-05-16 Thread Rick Harrison
Hi Dar, zryip, and Robert,

Thanks for the suggestions. I’ll give them a try!

Rick

On May 16, 2014, at 3:02 PM, Robert Brenstein r...@robelko.com wrote:

 On 16.05.2014 at 14:32 Uhr -0400 Rick Harrison apparently wrote:
 
 How do I now assign the values to the original Variable Name by referring to 
 the correct variable name read in?
 
 This is some kind of a double reference possibly referring to contents or 
 the value of a variable, it may involve arrays etc.
 
 Ideas? Suggestions?
 
 
 If you actually want variable names, the do command is your friend.
 
 do put  q(tVarValue)  into tVarName
 
 However, such things are really easier to handle as arrays.
 
 put tVarValue into gSessionGlobal[tVarName]
 
 Robert
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode