Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacement for USE/SELE table with IF...ELSE...ENDIF
Message
From
02/10/2007 11:37:42
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01257862
Message ID:
01257948
Views:
20
>>>>>>I know there is some way of putting this on one line using IIF (I think), but I just can't recall it right now. Thanks!
>>>>>>
>>>>>>
>>>>>>IF NOT USED('Schedule')
>>>>>>	USE Schedule IN 0
>>>>>>ENDIF
>>>>>SELECT Schedule
>>>>>>
>>>>
>>>>Ok, I thought there was a one-line way of doing it, but maybe not.
>>>
>>>Is this what you are looking for?
>>>
Use schedule in select('schedule')
>>>NB! Will not work if you use other aliases than the name of the table.
>>
>>This differs from the original because it reopens the table is the either a new workarea or in the same workarea it is currently open. If don't care about this, then it is a slick method.
>
>This is all very well, and they all exhibit degrees of slickness, but I wonder what the point is.
>
>So you get a line of code that's so slick the beholder has to ponder it, maybe even try it out, before appreciating what it does, then is taken aback by how clever the author is.
>
>But that very fact is its weakness. And what has been gained other than the obviation of one or two lines of code, especially at the price of clarity?
>
>And I wonder why Jay was so keen in getting this.
>
>My two-penn'orth.

I agree.

To me, it not so much how fancy or cleave the code is, but efficent and readable it is.
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform