Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to protect my informations from opening VFP 's table
Message
From
21/01/1999 13:18:11
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00175756
Message ID:
00178590
Views:
34
Hi John ---

Yes, I know about the tag switch in SEEK, but I thought it might make the code less obvious; better to show the ORDER clause in the use so it'd be readily apparent....sort of a difference between tutorial code and production code. If this was production code it might be:
USE userlist 
RETU SEEK(SUBS(SYS(0),AT("#",SYS(0)),2,15),"userlist","username")                     
>
>On a slightly different subject, although I'm sure you already know this (someone might find it useful anyway), the SEEK() takes a third parameter, the index file/tag. Thus, you could do: IF SEEK(cName,"userlist","username") w/o setting the index/tag prehand and switch at will.
>
>The reason I'm mentioning it here is that although I've been using the SEEK() for a long, long time, I overlooked it until few month's ago. I think it made for more compact, readable code.
>
>>Here 'tis ----
>>
>>USE userlist ORDER username                   && Open the user table
>>cName=SUBSTR(SYS(0),AT("#",SYS(0))+2,15)      && Use SYS(0) to get current
>>                                              && user network user ID
>>IF SEEK(cName,"userlist")                     && If this user is OK
>>   RETURN .T.                                 && ...then Return True (OK)
>>ELSE
>>   RETURN .F.                                 && ...else Return False (Not OK)
>>ENDIF
>>
>>
>>> Thanks for you suggestion, but I 'm not 100% understand. So, I would like to suggest me some sample codes which use sys(0).
>>> Thanks again for your time.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform