How to Modify GENSCRN.PRG to Refresh Text Field LabelsID: Q119302 2.5x 2.60 | 2.5x 2.60
The information in this article applies to:
SUMMARYNOTE: Microsoft does not provide technical support for FoxPro tools such as GENSCRN.PRG after they have been modified from their original form. In some cases, the text labels and refreshable SAY fields in the Screen Builder may need to be redisplayed, such as on a screen that was previously CLEARed. Text objects created in the Screen Builder are generated as SAY objects in the .SPR code. In order to refresh these field label SAYs as well as the output SAY fields, the @ ... SAY commands must be placed in the SHOW clause of the generated code. The example below shows how to modify GENSCRN to accept a custom generator directive which will force all text labels along with refreshed SAY field objects to be redisplayed. NOTE: At least one SAY field must have the Refresh check box option marked in the Output Field dialog box of the Screen Builder so that its contents will reappear, as well as to trigger generation of the SHOW clause code.
MORE INFORMATION
10. Insert another line, and type:
11. Press CTRL+F, and find the following text:
12. Press the HOME, UP ARROW, UP ARROW, CTRL+RIGHT ARROW, and CTRL+RIGHT
13. Press CTRL+G and then press END to move to the end of the line, and add
14. Add a new line below this line, and enter the following:
15. Press CTRL+W to close and save the program. Compile the new program by
Now that the SCRENGEN.PRG program is in place, you can specify the option
to refresh text field label SAYs by placing the custom generator directive
#SAYTEXT in the Setup code of the appropriate screen. If the #SAYTEXT
directive is not used, the screen will be generated normally.
FunctionalityThe memory variable m.g_saytext is used to determine whether to generate code to refresh all the SAYs found in the .SCX file. In order for SAYs to be refreshed, the same code used in the screen layout section of the generated code is repeated in the SHOW clause of the READ command. Normally, only SAY screen fields (objcode 15) that have the Refresh check box selected are generated in the SHOW clause during the PLACESAYS procedure within the screen generator. By adding the OR clause to include SAY objects (objcode 5) when m.g_saytext is .T., normal SAYs will also be placed in the SHOW routine. However, to meet the other requirements imposed by the generator code, two values must be changed in the .SCX file so that the SAY objects will be included. The Showtype and Refresh fields are changed within the NOTEDIRECTIVES procedure whenever it detects that the #SAYTEXT directive is found in the Setup code of the current screen. (Changing the .SCX database for the SAYs will not affect their appearance within the Screen Builder during modification.) Additionally, the m.g_saytext memory variable is set to TRUE. To further refine the scope of which normal SAY objects are included, this section of the generator program could be modified to accept parameters after the #SAYTEXT directive. For example, "#SAYTEXT 2,5,6-12" could indicate to refresh only objects 2 and 5 along with the range of objects 6 through 12. This would be determined by only replacing the Showtype and Refresh fields for these particular records, indicated by a further condition of the REPLACE ... FOR clause. The actual code to perform this restriction would vary, depending upon the chosen implementation of parameter representations. Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b 2.60 blank empty "missing text" KBCategory: KBSubcategory: FxtoolSbuilder
|
|
Last Reviewed: May 22, 1998 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |