Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record pointers on empty cursors/tables
Message
From
02/02/2004 13:36:03
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
02/02/2004 13:27:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00872917
Message ID:
00873054
Views:
22
I like that, but the cursor/table may be unknown at design time. Is there a way to know the key field (or expression) of the current ALIAS?

>I know you've been given a lot of answers to this question, but unfortunately they all involve saving and going back to the record number. If your 'Do Something' code deletes any records with lower record numbers than the record you're on, and packs, you're up the creek.
>
>The best way is to save the key, and after 'Do Something', re-seek the key. Even if the cursor is empty, nothing bad will happen.
>
>Alan
>
>>I use the following code in numerous methods to keep record pointers where they belong
>>
>>
>>cAlias = ALIAS()
>>
>>nRecNo = RECNO()
>>
>>
>>Do Something
>>
>>
>>SELE (cAlias)
>>
>>GOTO nRecNo
>>
>>
>>But if the ALIAS was empty then the GOTO will give a record out of range error. Often the Do Something code is using tables/cursors, etc and the goal is to leave open data the same when exiting a method as it was on entering. Any thoughts? Thanks!
>>
>>Regards, Renoir
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform