Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- NOT EMPTY
Message
From
13/11/2000 21:03:35
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00441253
Message ID:
00441394
Views:
14
>I fiddled with this a few minutes and tried this:
>
>SET NEAR ON
>SEEK "1"
>
>No matter what (character) data I put in the first non-empty field, it always found it. It's not foolproof because if the "1" actually exists, it will go to that. But if you played with the values a bit, you might hit on a foolproof method.

Depending on the table's codepage, the actual candidate would be a field with all blanks and an exclamation mark in the end (chr(33)='!', and chr(32) is a space), but then there could be any other characters below space (i.e. chr(1) to chr(31)) and I'm not sure they would be treated as empty.

The only sure way I can think of is to

go top && or just Locate
count while empty(your_field_here)

and we should be on the first record where your field is not empty. If we need to do this many times, we may utilize a filtered index:

index on [your_field_here] for not empty([your_field_here]) tag notempty

and then, using that order, just Locate and there we are.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform