Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expression is not valid outside of WITH/ENDWITH
Message
From
07/06/2001 08:39:04
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
06/06/2001 14:58:49
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00515968
Message ID:
00516248
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
Chuck,

About your coding style, mentioned elsewhere in this thread. Here's another version of your code:
LPARAMETERS lcAuthType, llAlreadyHaveThisAuthType
llAlreadyHaveThisAuthType = INDEXSEEK(lcAuthType, .F., "Auth", "AuthType")

WITH THISFORM.CommandGroup1

        .Command2.Enabled = !llAlreadyHaveThisAuthType
	.Command4.Enabled = !llAlreadyHaveThisAuthType
	atct = llAlreadyHaveThisAuthType

ENDWITH
Note that there is no change in the SELECTed table, no change in the current index, and no movement of the record pointer. All you do is Enable/Disable your CommandGroup buttons and set your atct. The WITH...ENDWITH saves a little processing because VFP only has to figure out the object reference once.

>Method: checkauthforauthtype (Visibility: Public)
>List1.InteractiveChange: ThisForm.CheckAuthForAuthType(m.at)
>
>Form1.ThisForm.CheckAuthForAuthType
>
>LPARAMETERS lcAuthType
>SELECT auth
>SET ORDER TO authtype
>SEEK lcAuthType
>IF FOUND()
>	ThisForm.Commandgroup1.Command2.Enabled = .F
>	ThisForm.CommandGroup1.Command4.Enabled = .F.
>	atct = .T.
>ELSE
>	ThisForm.Commandgroup1.Command2.Enabled = .T.
>	ThisForm.CommandGroup1.Command4.Enabled = .T.
>	atct = .F.
>ENDIF
>SET ORDER TO main
>SELECT authtype
Previous
Reply
Map
View

Click here to load this message in the networking platform