Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looping asp.request.forms object
Message
From
17/03/1999 10:39:59
 
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00198536
Message ID:
00198575
Views:
34
>>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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform