>>What is want to do is this....
>>
>>FOR i = 1 TO orequest.forms.count
>> lcfoxname = orequest.forms(i).name
>> IF TYPE(lcfoxname) # "U" && Fox knows what this is
>> &lcfoxname = orequest.forms(i).item()
>> ENDIF
>>
>>
>>
>>ENDFOR
>>
>>Is this posssible? I thought I would ask before I lost all of my hair testing and debugging ASP.
>
>I'd avoid the macro expandsion by:
>
>
FOR i = 1 TO orequest.forms.count
> IF TYPE('orequest.forms[i].name') # 'U'
> STORE orequest.forms[i].item TO (orequest.forms[i].name)
> ENDIF
>ENDFOR
>
>or, better:
>
>FOR EACH form IN oRequest.forms
> IF TYPE(form.name) # 'U'
> STORE form.item TO (form.name)
> ENDIF
>ENDFOR
>
I just realized that you want to store the item property to the name property, rather than a variable referenced by the name property, so change the store statement in the first example to:
orequest.forms[i].name = orequest.forms[i].item
and in the second to:
form.name = form.item
The name property for anything but a class derived from File or Project should be read-write at runtime. However, realize that the Item method (yep, it's a method, not a property) returns an object reference in virtually all cases, not a character string, so it may not do what you want to do (presumably, you want to alter the name reference of the form based on some property of the item collection.
>>Thanks,
>>John S. Huddleston