>>>I want to create as many variables as there are records in the table and assign them a value that is a field in the table. So, I want to end up with something like this:
>>>
>>>Cpt1 = "This is one"
>>>Cpt2 = "This is two"
>>>
>>>This is the simple SCAN I want to work it in:
>>
>>See inside from the top of my head.
>>
>>
>>local lcVarName
>> ix = 1
>> SCAN
>> * Make a variable based on m.ix like "Cpt1" then "Cpt2" etc, and assign them a value from the table until the scan is done.
>> lcVarName = "cpt" + transform(m.ix)
>> local &lcVarName
>> store myField to ("m." + lcVarName)
>> ix = m.ix + 1
>>
>> ENDSCAN
>>
>
>Why the LOCAL?
This is how I understood the requirement. If you don't use LOCAL (comment this line out), the variables would be created private by default.
If it's not broken, fix it until it is.
My Blog