You need to do the tutorials in this book in the order shown by the Tutorials Map.
You need to have installed Dialog System to do this session.
In the previous session you used Windows GUI Application Wizard and Dialog System to design a screenset and generate a COBOL program. You now edit the COBOL program generated and add your business logic. You then run the completed application, using the IDE.
Windows GUI Application Wizard generates a COBOL source program in a .cbl file, containing code to input and output the screenset. You then edit this .cbl file to add your business logic to process the data from the screenset and create data to be output. Of course, you can simply add CALL statements to call other programs, and so keep your business logic completely separate from this screenset-handling program.
An associated program typically has a main loop which does the following:
The program generated for you by Windows GUI Application Wizard has this structure. For another example, look later at the Customer demo in the directory Examples\Net Express IDE\Customer.
If Net Express and the Welcome project aren't open, open them now.
You could use any text editor to add your business logic to the COBOL program. We will use the IDE.
A text window opens with the source of the program. You may need to resize the window to see the source clearly. Look at Hide All Copyfiles on the View menu and ensure that the button-like icon beside it is shown depressed. If it isn't, click it.
Take a few minutes to look through the program to see what it does.
The file welcome.cpb is the data block. You'll see your data items I-NAME and GREETING at the end of it.
The other copyfile, ds-cntrl.mf, is called the control block. It is supplied with Net Express and contains standard definitions needed by all Dialog System applications.
string "Hello " I-Name delimited by size into Greeting
In a real application you would probably put a call here to a subprogram to process data from the screenset and calculate or look up data to display. You could use an EVALUATE statement performing actions depending on what is returned from DSGRUN. This would typically include a WHEN EXIT-FLAG-TRUE CONTINUE branch.
To build the application:
Net Express saves and compiles the program, and rebuilds the executable file. Wait until the message "Rebuild Complete" appears in the Output window before continuing.
To run the application:
The Start Animating dialog box appears.
The program runs, and displays the screenset.
The program puts your name after the "Hello " in the Greeting field, then redisplays the screenset.
The program goes around the main loop again, displaying "Hello " followed by the new name.
Close the project.
If you're planning to go straight on to another session, you can keep Net Express open.
This is the end of this path through the tutorials. To continue to another tutorial, go to the topic Tutorials and Demos.
Copyright © 2006 Micro Focus (IP) Ltd. All rights reserved.