Together with SetVarl() to allow users to transfer any number of values from any one part of the application to any other part of the application.
It will allow the user to name the variable and retrieve it by using the same name. GetVarl() and SetVarl() will automatically translate all DataEase Data types, so you can transfer Text, Numbers, Numerical Strings, Choices, Dates, Time etc.
TEXT VALUE
The Name of the variable that you want to retried.
[Option: String]
Option is GLOBAL which will allow you to set a variable on the shared DataEase bus. This means you can share global variables between the DataEase applications on the same computer/user.
Example 1
We want to use a certain value a lot of places, for instance the customers discount but we can't be bothered to set up a relationship between all tables.
Somewhere we call the function:
SetVar("UserDiscount",DiscountField)
Everywhere else we can then call.
GetVar("UserDiscount")
It will then always return the values set for UserDiscount until the session is ended or a new value is set with SetGlobal()
Example 2
You can also create dynamic global variables by creating dynamic names.
Somewhere we call the function:
SetVar(concat(current user name,current date),DiscountField)
Everywhere else we can then call.
GetVar(concat(current user name,current date))
It will then always return the values set for UserDiscount until the session is ended or a new value is set with SetVar()
Example 3
One major usage for SetVarl() and GetVarl() is to improve filtering and Data-Entry for reporting etc.
It is no secret that DQL printing "stinks" and it is no better in 8. It will be better with DataEase 8 Reporter, but the way that "hard core" DataEase developers have gotten around this is by using Reports instead of DQL for printing.
The way you will do that is simply to set the Data-Entry values as Global variables and then you use GetVar() directly in the selection filter.
The Filter variable you simply set on the action for the button that executes the rapport from you form.
DocumentOpen( "MyQuickReport")+SetVar("MyCustomerName",CustomerName)
This way you can Run Reports directly to print without having to deal with the awkward DQL printing.
As part of the DataEase for Windows restoration project we have come to a big omission in DataEase - Global Variables or transfer of information between processes if you like.
It amazes us how many wishes, needs and wants from almost every user, that has been blatantly ignored by "us". We have had no qualms in brushing off desperate user with a CDF or a receipt long as your arm to "fix" a problem in our product.
In DataEase 8 we have deemed to remedy a lot of these omissions. It might be too late for a lot of users, but that excuse is getting to old too. When we took over development we were told that yes LegEasy DOS is how it should have been done back in 1994 but alas, now it was too late.
Bull...it. We can't hide behind "too late". It is only too late if we think that DataEase will ever be used by people that have already used it, but our goal is to get it to be used by people that have never used it too.
Just because there is some CDF's that can transfer a limited number of variables, and there is an SQL return code that one can use for the same, doesn't mean that the problem is solved. Especially not when we are going to tell you all to not use DQL body for printing.
What? Not using DQL body for printing, not using DQL for printing? No! It doesn't work, and it never have. It is the achilles heel of DataEase for Windows and a couple of hours working with it is enough to kill the spirit of the bravest.
DQL without Printing is both effective and amazing, but the way the body has been implemented is just backwards.
I can guarantee you that nobody that make a living from using DataEase use the DQL body for anything. So if you are a new user, don't even try.
The fact that the Data-Entry form is as limited doesn't make the situation any better.
Use DQL for processing, and use Report for printing! End of story!
The only reason we use DQL for printing is that that is what we used to do in DFD, and the reason we used to do that in DFD is because we need to have a data-entry form.
In DataEase 8, we have introduced Virtual Editable Field so you can make a DataEntry form as a normal for with relationships etc. Then you use the new SetVarl("Variablename",Value) to set the global variables either in a virtual field or directly on the button that Fire the Report. In the report you set the Filter and use GetGloal("Variablename") and the job is done.
With Set/GetVarl() you can have as many global variables as you like and you can give them descriptive names.
You can of course use them for anything you like, the above is just an example.
Product: Dataease [{8}]FIVE. Written by DataEase 12/11/17 at 13:26:21
Product: LegEasy 9 Developer. Written by DataEase 03/10/24 at 15:49:41
Product: Dataease [{8}]FIVE. Written by DataEase 02/11/12 at 20:25:35
Product: Dataease [{8}]FIVE. Written by DataEase 29/11/12 at 15:51:17
Product: Dataease [{8}]FIVE. Written by DataEase 04/12/12 at 10:06:48
Product: Dataease [{8}]FIVE. Written by DataEase 02/08/13 at 11:35:53
Product: Dataease [{8}]FIVE. Written by DataEase 05/08/13 at 13:35:17
Product: Dataease [{8}]FIVE. Written by DataEase 05/08/13 at 16:07:03
Product: Dataease [{8}]FIVE. Written by luis conde 13/08/13 at 17:47:57
Product: Dataease [{8}]FIVE. Written by DataEase Development 14/08/13 at 20:57:13
Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 14/08/13 at 21:03:12
Product: . Written by DataEase 25/09/15 at 08:54:32
Product: . Written by Ihor Zakharchenko 03/10/24 at 16:23:54