oRequest.Form("myVariable").Count

Topics: Developer Forum
Jan 10, 2012 at 10:42 PM

Hi.

I've got a statement in an avfp file that errors out on me.  Without repeating ver batim what it says, it basically says it FORM is Method.  This is my statement:

IF oRequest.Form("myVariable").Count>0
* Does stuff
ENDIF

It works ok without ,Count.  I'm guessing .Count isn't supported?  If so, anybody have a suggested work around?

TIA.

 

BR

Coordinator
Jan 10, 2012 at 11:59 PM

oRequest.oRequest.FORM("myVariable").count

should work.  when in doubt, use orequest.orequest.

also see aspvars.avfp for a way to enumerate all the form variables.

----

The way I set it up was to subclass the Request object to make oRequest a little simpler to use than the original Request.  The side effect of this was to require the use of oRequest.oRequest for all the methods and properties I didn't include in the subclass.  This is all in activevfp.prg in the source code.

To fix this, I guess I could just find all the methods and properties of Request and include them in the subclass.  I wonder if there's an easy way to do this by iterating through the original Request object?????

Jan 11, 2012 at 12:09 AM

Thanks for the reply.

I did oRequest.oRequest and that fixed the problem.  I will take a look at aspvars.avfp.

I haven't downloaded the source code.  When I get a chance I will do so.

Thanks.

BR

Coordinator
Jan 11, 2012 at 12:15 AM

You should probably wait until I release 5.61/5.51 later this week to download the source code.  It'll be cleaned up and you'll be able to use Visual Studio with the Fox IDE to actually step thru all of the code..