Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to GOTO to RECNO() -1
Message
From
03/08/2002 15:31:03
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00685315
Message ID:
00685926
Views:
51
Hmmm...

I just tested and watched some code just like yours, and it worked, although I did not do in a buffered table with freshly added records. I did it with and without parentheses around .recordsource. Have you watched in the debugger to see what it is going on?

Personally I never use GO or GOTO. I've been burned a few times when the record is no longer available for whatever reason, and then try to access the record using GO, only to have the app return an error. I take the few extra steps, use the LOCATE command and then test if it was successful using FOUND().

I'd be interested to know what you find out when you get to the bottom of this.

Thanks
John



>Hi John
>
>GOTO .nRec2Validate IN ( .RECORDSOURCE )
>changed to
>GO .nRec2Validate IN ( .RECORDSOURCE )
>
>doesn't work any suggesstions on using the same or shall I revert to LOCATE
>
>Thanks for the reply
>
>>Don't use GOTO, Use GO -1 instead, or LOCATE FOR RECNO() = -1.
>>
>>
>>
>>>Deal All
>>>
>>>Yesterday I was working on a view in a grid and the added records returned a RECNO() of -1, -2 etc.
>>>
>>>When I GOTO -1 it gives an error, how do I goto?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform