find a value using dynamic key or x name in property list

Hi there,
I am trying to create a property list using dynamic key name and values.
I would like get a value of particular key by not using the keyname - by using key number. can you please share your thoughts.
set the folder to "D:\EggPlant\Framework"
put the folder  into myfolder
put the filepath of the folder into filepath
put filepath & "RunManager\RunManager.csv" into MyRunManager
put (:) into ScenarioList
put the number of lines in file MyRunManager
repeat with n =2 to the number of lines in file MyRunManager
                put line n of file MyRunManager into Var
                put item 1 of line n of file myrunmanager into Scenario_id
                put item 3 of line n of file myrunmanager into Execution_flag
                set ScenarioList's (Scenario_id) to (Execution_flag)
end repeat
put item 1 of keys of scenariolist into ScenarioKey1
put ScenarioKey1 – I can get the Scenario_id 
How I can get the values of scenario id using Scenario_id?

The below listed command are not helped me since I need to pass the key name at runtime
Put ScenarioList's Scenario_id
Put ScenarioList.Scenario_id
instead of hot code I would like to use a container for passing key name.
Put value of item 1 of keys of scenariolist into ScenarioKey1
– the command is wrong but I need a command like this.
Thanks
Krish

Comments

  • JonathanOSXJonathanOSX ForumAdmin admin
    Sorry for the delayed reply, this is an interesting question.

    I think your first section is working correctly for you, yes?

    You wind up with a list of key's and values in a property list loaded by reading your data file.

    I think now you just need to use the () to evaluate the key. Like this:
    repeat with each item keyName of keys of scenariolist
    	put keyName & " => " & dude's (keyName)
    end repeat
    
Sign In or Register to comment.