Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you know if a SQL select didn't select anything?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00236234
Message ID:
00236252
Views:
14
>Check the Type() value of the item in laSelCats[1,1]. If it's "U" the array is empty. _Tally doesn't work correctly on arrays I've found.
>
Barbara, since the array exists already in his example and is scoped as PUBLIC, I think he'd be better off doing something like:

DIMENSION laSelCats[1,1]
laSelCats = NULL

before the Select, and then check ISNULL(laSelCats[1,1]) afterwards to see if anything happened.



>Barbara
>
>>I have the following SQL select in a custom method (thisform.RefreshArray) on a form.
>>
>>SELECT CatName ;
>> from CatDisplay ;
>> where CatUsed = .T. ;
>> into array laSelCats
>>
>>This array already exists (scoped as public), is replaced by the above, and then passed by reference from another method as a parameter to a custom method in class.
>>
>>ie. a click event for a button would be:
>>thisform.RefreshArray
>>thisform.Myclass.Redisplay(@laSelCats)
>>
>>My problem is occasionally the select will not select anything, which is ok, however, since the array already exists it will contian the previous incorrect values.
>>
>>I tried adding a release laSelCats before the select but that screws up the reference.
>>
>>Anybody have any ideas about how to get around this?
>>
>>Thanks in advance.
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
Next
Reply
Map
View

Click here to load this message in the networking platform