How to Add Code to WHEN Snippets Created from ScreenWizard

ID: Q121277

The information in this article applies to:

SUMMARY

When a screen is created using the ScreenWizard, the ScreenWizard puts commands in the WHEN snippet to control field activity. This control is in the form of a logical variable called ISEDITING, and is used as an expression. If you need to put code in a field-level WHEN, change the expression to a procedure. By changing the snippet to a procedure, you change the ISEDITING variable's ability to activate or deactivate the data entry field.

MORE INFORMATION

Steps to Reproduce Behavior

1. Enter the following command in the Command Window:

   USE Customer

2. Select the RUN/WIZARD/SCREEN menu options. Then select 'Add All' fields;
   no sorting; 'Modify screen with design tool.'

3. Double-click the field called cno, and select the WHEN push button to
   edit the snippet. Click the radio-button Procedure. Change the snippet
   to read as follows:

   WAIT WINDOW "The Customer.cno when snippet is running"
   isediting

4. Click OK twice to save the changes to the field. Select the
   PROGRAM/GENERATE menu options. Save the changes, and Generate
   the screen.

5. Run the screen. The message: "The Customer.cno when snippet is
   running" appears in the Wait Window, followed by the error,
   "Unrecognized command verb".

Resolution to Behavior

Type the following into the Command window:

   MODIFY SCREEN CUSTOMER

Then start at step 3 above and change the customer.cno WHEN snippet to read as follows:

   WAIT WINDOW "The Customer.cno when snippet is running"
   RETURN iseditting

Additional reference words: FoxWin 2.60 KBCategory: kbusage kbtshoot KBSubcategory: FxtoolWizscreen

Last Reviewed: August 28, 1995