Global Variables Dataease 4.53

Questions and Answers about DataEase for DOS

Global Variables Dataease 4.53

Postby Russell Dorricott » Tue Jul 16, 2013 11:21 am

I am having trouble passing global variables across multiple DQL procedures.

I have a control procedure that declares the global variables, that then runs three further procedures with the same globals declared.

DQL 1 - does the calculations and sets the values for the globals.
DQL 2 - is a printed report that groups the variables and produces an output.
DQL 3 - a 2nd printed output but with reduced data being presented.

The issue is that when grouping the data in the printed reports based on DQL 1 data the output only has one line not the multiples for each of the groups I would expect.

I am also using the method in DQL 1 to calculate overall percentages using the "tTestGroupChange" method.

If I add a list records in DQL 1 and list the individual results, the data presents correclty.

My question is this, do global variables only pass a single value between DQL's or is a data set created that is held and can be used in other DQL's?

If single value, how can I create group values so i can use the same calculated data set in two printed reports without having to recalculate for each or create a table to temporarily hold the data.

example

Control Procedure
declare varaibles
run procedure DQL 1
run procedure DQL 2
run procedure DQL 3

DQL 1
declare variables
calculate values and add to global variables

DQL2
declare variables
group based on global field and produce sum values for the other globals
print results

DQL3
declare variables
group based on global field and produce sum values for the other globals
print results - cut down version of DQL 2

Sorry for the volume of detail.
Russell Dorricott
 
Posts: 5
Joined: Wed Mar 16, 2011 2:47 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: Global Variables Dataease 4.53

Postby Graham Smith » Tue Jul 16, 2013 11:56 am

I'm not sure but it sounds like you misunderstand variables. A variable only holds one value at a time. It is not an array.
Graham Smith
DataSmith, Delaware
"For every expert there is an equal and opposite expert.", Arthur C. Clarke (1917 - 2008)
"X-Clacks-Overhead: GNU Terry Pratchett"
User avatar
Graham Smith
 
Posts: 2501
Joined: Fri Sep 07, 2007 11:31 am
Location: Delaware, USA
Has thanked: 0 time
Been thanked: 1 time
 

Re: Global Variables Dataease 4.53

Postby Russell Dorricott » Tue Jul 16, 2013 1:22 pm

Thanks Graham.

So would the best way be to enter the data in to a table, produce the reports and then delete the data or is there a way of creating an array that would allow the data to be used across multiple procedures?
Russell Dorricott
 
Posts: 5
Joined: Wed Mar 16, 2011 2:47 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: Global Variables Dataease 4.53

Postby Phil Winkler » Tue Jul 16, 2013 2:37 pm

Russ,

I think you are on the right track creating a results table (form) to hold your data and chaining to a report from it. We do that all the time.
Phil Winkler
PLM Consulting, Inc.
pwinkler@plmconsulting.com
Phil Winkler
 
Posts: 889
Joined: Fri Sep 07, 2007 12:45 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: Global Variables Dataease 4.53

Postby Gil Fleming » Wed Jul 17, 2013 1:48 pm

Hi Russell

You can pass as many global variables as you wish (there's probably a limit somewhere) so long as you:
1. Define (declare) the variable using the '"define global <variablename> <variable type>" syntax in each DQL
2. Additionally declare each global variable identically in the control procedure that links the individual DQLs.

This works ok if you are passing a fixed number of variables where the number of values is known (eg invoice = unpaid, part paid or fully paid - 3 variables). When we used DFD, we used globals to pass usually individual document references to various parts of our system for cross-referencing and traceability.

However, if you were trying to group sales by product, for example, you would have a variable number of variables, especially if your product portfolio was changing regularly.

In DFD, globals only live while the control procedure is running. They are lost when the procedure completes. In ffenics, however, variables exist for the whole of the session.

Where are you based Russell?
Gil Fleming
Director
Fleming Technical Limited

You can't think about what you don't know - Mike Fidler
If you can't fight, wear a big hat - John S Fleming
The best way to have a good idea is to have lots of ideas - Linus Pauling
Gil Fleming
 
Posts: 546
Joined: Tue May 15, 2012 10:26 am
Location: Liverpool, UK
Has thanked: 1 time
Been thanked: 2 times
 

Re: Global Variables Dataease 4.53

Postby Russell Dorricott » Thu Jul 18, 2013 10:39 am

Thanks for the advise everyone, used the table method in the end.

Gill, not far from you in Ellesmere Port.
Russell Dorricott
 
Posts: 5
Joined: Wed Mar 16, 2011 2:47 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: Global Variables Dataease 4.53

Postby Gil Fleming » Thu Jul 18, 2013 12:00 pm

We're just down the road from you, in Bromborough.

If you need any DFD help, send me a PM.
Gil Fleming
Director
Fleming Technical Limited

You can't think about what you don't know - Mike Fidler
If you can't fight, wear a big hat - John S Fleming
The best way to have a good idea is to have lots of ideas - Linus Pauling
Gil Fleming
 
Posts: 546
Joined: Tue May 15, 2012 10:26 am
Location: Liverpool, UK
Has thanked: 1 time
Been thanked: 2 times
 
 

Return to DataEase for DOS

Who is online

Users browsing this forum: No registered users and 2 guests