Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Did I miss something?
Message
From
07/02/2002 12:07:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00615839
Message ID:
00616729
Views:
23
I agree the second is cleaner, but I almost always do the FIRST, because I want to update etc by the alias and NOT the workarea just in case someone else DID move my table to another workarea! i know what alias i want, but not necessarily what work area it has been moved to by some other "well-intentioned" programmer. been burned on that one in the past...
tracy
>>Hey Jim, how ya doin'?
>>
>>This is getting off the topic a little, but it's something that's always bugged me ... is there any reason for using this:
>>
>>LOCAL lcAlias
>>lcAlias = ALIAS()
>>
>>*--Do stuff
>>
>>* Now restore the work area
>>IF NOT EMPTY(lcAlias)
>>  SELECT (lcAlias)
>>ELSE
>>  SELECT 0
>>ENDIF
>>
>>instead of this:
>>
>>LOCAL lnSelect
>>lnSelect = SELECT()
>>
>>*--Do stuff
>>
>>* Now restore the work area
>>SELECT (lnSelect)
>>
>>
>>The second method seems much cleaner and simpler than the first, and yet I see the first one used frequently (which I change whenever possible to the second) ... is there any performance issue or is this just your personal preference?
>>
>Hi Bonnie,
>
>I also use the second method for the same reason as you and because it suits my style of programming.
>The first method bring you back to the table alias wich could be or could be not in the same work area as at the begginnig of the code. The second method bring you back to the original work area. If the code in between closes and opens table from this work area in the another workarea and opens another table in that work area than you would end up on wrong table.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform