Use of *# USERPOSTCOMMAND Screen Generator DirectiveID: Q112473 2.60 | 2.60 MS-DOS | WINDOWS kbtool The information in this article applies to:
SUMMARYFoxPro version 2.6 contains a new screen generator directive, *# USERPOSTCOMMAND, which expands the functionality of the Screen Builder. This new directive allows the use of code that is executed after GET fields are initially defined but before the READ is executed.
MORE INFORMATIONThe *# USERPOSTCOMMAND directive is placed in the comment snippet of a GET field as follows:
In this example, a line of code ("DO myprocedure") is inserted immediately
after the GET field in the generated .SPR program.
You can use this directive to define a number of GET fields based on conditions that exist when the screen is initially executed. This approach is often more desirable than disabling GET fields when certain users should not have access to confidential information, such as salary figures. NOTE: This directive will not override the limitation of being unable to define new GET fields within the active READ. It will not allow the current GET to be redefined at run time, since the code is placed on the line following the @ ... GET statement.
Example1. Issue the following commands in the Command window:
2. Place two fields, CNO and COMPANY, near the top of the screen. Leave a
3. In the Setup snippet, add the following code:
4. In the comment snippet of the second GET field, add the following line:
5. In the Cleanup snippet of the screen, add the following code:
6. Save and generate the screen.
7. In the Command window, issue the following command. This example is hard- 8. Close the screen program. In the Command window, issue the following
The screen will appear with three GET fields.
Additional reference words: FoxDos FoxWin 2.60 KBCategory: kbtool KBSubcategory: FxtoolSbuilder
|
|
Last Reviewed: May 1, 1996 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |