Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
USE IN cursorName
Message
From
11/01/2007 14:20:01
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01184698
Message ID:
01184736
Views:
30
I didn't say it's necessary. I said it's a good practice. Doing this way you don't have to worry if some cursor 'tmpMyfavouritename' was left open (or is really need to be kept open) in some place and you try to use it now.

>Ed,
>
>This is not nnecessary for cursors but it is for tables. Cursors are only local alias names and the name for the underlying table will be unique. This is one of the very great advantages of using cursors over tables is that you don't need to worry about unique names you can use meaningful names.
>
>
>
>>You may have a function that you may call every time you need in alias, e.g.:
>>
>>Function gettempalias		&& return cursor alias
>>Local cTempalias
>>cTempalias='A'+Substr(Sys(2015),3,10)
>>If Used(cTempalias)
>>	Use In &cTempalias.
>>Endif
>>Return cTempalias
>>Endfunc
>>
>>and in your program:
>>
>>cAlias=gettempalias()
>>Select ... From ... Into Cursor &cAlias.
>>...
>>Select (cAlias)
>>...
>>Use In &cAlias.
>>
>>
>>>Hi Sir,
>>>
>>>How do I create a temporary aliases for my cursor?
>>>
>>>Normally, I just do this...
>>>
>>>
>>>SELECT * FROM poentry ;
>>>INTO CURSOR crsPoEntry
>>>
>>>
>>>> No problem. Btw, it is also a good practice to generate temporary aliases for cursors > every time when you use them.
>>>
>>>Please help.
>>>
>>>Thanks,
>>>Sam
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform