Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does ADir() always create an array?
Message
 
To
20/01/2007 16:06:19
James Hansen
Canyon Country Consulting
Flagstaff, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01187382
Message ID:
01187399
Views:
23
This message has been marked as the solution to the initial question of the thread.
>I don't know enough about the actual internals of VFP to be sure this is accurate, but I have the following theory:
>
>When VFP sees you need a parameter to call a function it looks around for a parameter in scope with that name. When it doesn't find it, it creates it. But at the time VFP creates the parameter it doesn't know that the parameter is supposed to be an array, so it assumes it is a scalar. It then calls the function with the scalar parameter. The function looks at the parameter and throws an exception because it was expecting an array.


No,
VFP didn't create variables (unless it is documented in help) when you pass something to function:
Try:
RELEASE ALL LIKE lcText* && Just to be sure there is no lcText variables declared
? LEN(lcTest) && BOOOM :-)
but:
RELEASE ALL LIKE laText* && Just to be sure there is no laText variables declared
ADIR(laText, [c:\*.*])
DISPLAY MEMORY LIKE laText*
works
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform