* * GfxScreenSection * * Copyright 2000 LegacyJ Corp. All Rights Reserved. * * This program demonstrates some of the new graphical syntax supported * by PERCobol. This syntax is suitable for bringing pre-existing * screen section and random display/accept syntax into graphics. * * All notation is done in character cells; fractional character cells * are accepted, but discouraged. * identification division. program-id. windows. data division. working-storage section. 01 first-data pic x(20). 01 second-data pic x(20). 01 first-window handle of window. 01 second-window handle of window. screen section. 01 screen-1. * Specify a label with implicitly defined text at a line and column 05 label "1. Enter 20 cols of data:" line 4 column 15. * Allow the entry-field to immediately follow the label 05 my-entry-field entry-field using first-data. * Specify a push-button to act like a return-key; give it a larger * size (width) and lines (height) 05 push-button "Enter Data" line 8 column 25 size = 10 lines = 2 termination-value = 13. 01 screen-2. * Specify a label with implicitly defined text at a line and column 05 label "2. Enter 20 cols of data:" line 4 column 15. * Allow the entry-field to immediately follow the label 05 my-entry-field entry-field using second-data. * Specify a push-button to act like a return-key; give it a larger * size (width) and lines (height) 05 push-button "Enter Data" line 8 column 25 size = 10 lines = 2 termination-value = 13. procedure division. main-par. * Create the initial window as black on gray (standard as opposed to initial) * Save the 'handle' to the window so we can directly reference it; * it always has a handle, but when using only one window it didn't matter. display standard window lines = 15 size = 60 handle in first-window * Display some plain text; text and graphics may be mixed together. * Mouse selection of text input fields are now supported. display "Traditional Text Output on Line 1" * Display and accept the screen display screen-1 accept screen-1 * begin: this could be a separate program here display floating window lines = 20 size = 50 handle in second-window display "Second window" display screen-2 accept screen-2 * Remove the second window now that we're done with it destroy second-window * end: this is the end of the separate program display "" display "back to first window" display "first : " first-data display "second: " second-data * Hide the components of screen-1 (not necessary in this example) * hide screen screen-1 * Display a dialog to the user with the input data display message box title "First Entered" value first-data type-ok display message box title "Second Entered" value second-data type-ok * Redisplay the components of screen-1 * show screen screen-1 * Completely eliminate all memory and visibility of screen-1 * destroy screen-1 * Force the program to exit stop all run .