Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RECNO() returns 1 for no records
Message
From
03/05/2004 09:01:33
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00900340
Message ID:
00900345
Views:
31
>>Hi All. Can anyone explain the logic that RECNO() should return a value of 1 when a file has no records? VFP8/SP1. Its in the docs but why? Surely RECNO() should return 0 if there are no records?
>
>That's the way it works since the beginnig of the time. :)
>FoxPro always kind of "adds" one blank record at the end of the table.
CREATE CURSOR test (cc C(2))
>? RECCOUNT(), RECNO()   && 0 1
>APPEND BLANK
>SKIP
>? RECCOUNT(), RECNO()   && 1 2
>
Hi --sb--. I have been programming the Fox from the start and amazingly I have never encountered this until today!! Shows what simply apps I write :) But even so, it doesnt make any sense to me. It should really be considered a bug but I appreciate that it should not be changed since who knows what apps now assume this behaviour :/

Thanks
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform