Simplicty and flexibility!


Support::

Procedure 4: PROCESS RESERVATIONS


Parameters


Returns/Result


Examples


Reference

Procedure 4: PROCESS RESERVATIONS

Procedure 4: PROCESS RESERVATIONS

As we mentioned at the start of this section, a Control procedure can be used to manage almost every element of DataEase, performing tasks such as combining menus, input forms, procedures, conditional actions, and output into fully automated business applications.

A Control procedure can be used to:

  • Execute any DataEase menu option from within the procedure. In this respect, Control procedures are similar to chain menus. However, Control procedures let you combine DQL conditional logic with the chain menu processing capabilities.

  • Link DQL Procedures together and execute them automatically.

  • Pass values among procedures.

 

Now, we'll demonstrate how Club ParaDEASE can link the preceding procedures together to automate the entire process for entering and posting reservations, calculating reservation discounts, and printing reservation invoices. To link the procedures, you must create a new script that combines the two Processing procedures into a Control procedure.

The script for this Control procedure is listed immediately below. Following the script, the purpose of each line in the Control procedure is explained.

 

Script for the PROCESS RESERVATIONS Control Procedure

The Control procedure script contains only five lines:

 

define global "DISCOUNT" Number .

define global "RESTOTAL" Number .

define global "RESERVATION#" Number. 

 

 run procedure "INPUT RESERVATIONS" . 

 run procedure "CALCULATE DISCOUNTS" .

 

Explanation of the Control Procedure

The first three lines of the Control procedure define the global variables that are used in procedures 2 and 3:

 

 define global "DISCOUNT" Number .

 define global "RESTOTAL" Number .

 define global "RESERVATION #" Number .

 

To pass a global variable from one procedure to another, the variable must be defined identically in each procedure that uses it as well as the main Control procedure. A global variable can be assigned a value just once, and used by each individual procedure, or manipulated and reassigned in one or more procedures. The variables defined in this control procedure don't have values assigned to them until the CALCULATE DISCOUNTS procedure begins processing.

The fourth line of the Control procedure specifies:

 

 run procedure "INPUT RESERVATIONS" .

 

The run procedure command executes a procedure just as if you chose File>>Open to run a procedure. When DataEase reaches the end of the procedure, the next command is automatically executed in the Control procedure.

When the INPUT RESERVATIONS procedure is run, DataEase creates a new record in the RESERVATIONS form for each new reservation, copying the information from the TEMPMEM temporary holding form. Finally, the number of rooms required for the new reservation are subtracted from the VACANCIES field in the CLUB ROOMS form.

The fifth line specifies:

 

 run procedure "CALCULATE DISCOUNTS" .

 

This command executes the CALCULATE DISCOUNTS procedure that: (1) calculates the total dollar amount of the reservation, (2)calculates the total number of children and adults included in the reservation, and (3) calculates the dollar amount of the discount to be applied to the cost of the reservation.

The third procedure, RESERVATION INVOICES is called from within the CALCULATE DISCOUNTS procedure so RESERVATION INVOICES is not included in the control procedure. Since the define and run procedure commands do not require any special terminating command other than a period, no further commands are required.

See Also


On the forum about Procedure 4: PROCESS RESERVATIONS

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien. le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 è poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about Procedure 4: PROCESS RESERVATIONS


dg3_HelpView