The GetCurrent() functions is closely related to the old Current functionality in DataEase and is an addition to the existing Current values up to and including 7.2.
The New GetCurrent() function is a function to retrieve current information from DataEase. The first increment returned paths to different parts of the DE structure, then we added features for navigating in the Form to help with setting and getting information on objects and now we are adding features to get information on the forms.
The new GetCurrent functions are all File paths and are included to make it easier to navigate from inside a DataEase App.
Everything from Images, to files, documents, exports etc. can be located in a dynamic structure and up to now it has been impossible to address them "relative" to the Application, to the installed DataEase or to the users My Document structure.
The time when DataEase was installed on C:\DEASE and the app was in the program catalogue is long gone, and we now need to be able to navigate freely on different installations.
AppPath
This will return the full path to the current application.
ProgrPath
This will return the full path to the current DataEase 8.
MyDocuments
This will retunr the full path to the root of the users My Documents structure.
RowNumber
This will return the current Row in a Subform or in a MultiForm. It will always report the same number for the same row.
RecordNumber
This will return the current Record number in current Multiview. DataEase do not do absolute record numbers, but the position in current cursor called Multiview in DataEase terminlogy. If you have done a search that gave 100 returns the last row will report 100 and the first 1.
Height [,Object]
This will return the height (available space in window for form i.e. inside hight) of the active window. If you add an objectname it will give you the height of the Object rather than the Main WIndow. Format then would be: GetCurrent("Height","MyObject")
Width [,Object]
This will return the width (available space in window for form i.e. inside width) of the active window. If you add an objectname it will give you the width of the Object rather than the Main WIndow. Format then would be: GetCurrent("Width","MyObject")
WindowState
This will return the current State of the window: Maximized, Normal, Minimized.
AppName
This will return the current Application Name
Windowname
This will return the name (caption) of the current Window (Form, Report etc)
DocName
This will return the name of the current document. I.e. The saved name of the Document.
DocFileName
This will return the filename of the current document. Typical MYDOCAAA.FRM.
Xpos [,Object]
This will return the Xpos of the Object. If no Object is specified it will return the Xpos of the current Parent Object. GetCurrent("Xpos","MyButton").
Ypos [,Object]
This will return the Ypos of the Object. If no Object is specified it will return the Ypos of the current Parent Object. GetCurrent("Ypos","MyButton").
@DefaultPrinter
Will return the current active default printer by name on your workstation. GetCurrent("@DefaultPrinter")
@PrinterN
Will return Application/Workstation printer N by name. N between 1 and 4. GetCurrent("@Printer4")
CPUId
Will return the CPU Processor ID. Good unique PC identifier. Will not identify unique sessions on same Computer.GetCurrent("CPUId")
MacAddress
Will return the Mac Address of the first Network Card on your computer. Another good PC identifier. GetCurrent("MacAddress"). This will return first MAC on your stack including Bluetooth etc.
MacAddressWIFI
Will return the Mac Address of the first WIFI Network Card on your computer. GetCurrent("MacAddressWIFI")
MacAddressLAN
Will return the Mac Address of the first Ethernet (Fixed) Network Card on your computer. GetCurrent("MacAddressLAN")
AppDataPath
Will return the full path to the AppData area for current DataEase version. This is the catalogue for DATAEASE.INI etc.
Version
Will return the version of the active DataEase. Typical 8.5.0.1455
IsDeActive
Will return Yes/No.DataEase will only perferm GUI operation if active, so if DE is not Active then you need to activate with SetCurrent("ActivateDE") before performing GUI operation.
ActiveDoc
Will return the Document that has focus i.e. active in DataEase at the moment.
ActiveDocState [ServiceWindowFunction]
This function is implemented to allow ServiceWindow to figure out what the state of the active document in DE is at any given time.
Will return RT - Run Time or DT - Design Time.
IsDocOpen [, DocumentName]
Will return YES if DocumentName is open. No if it is not open. If not open, you can open it with DocumentOpen() if it is open, you can switch to it with SetCurrent("ActiveDoc","DocumentName")
IsVisible
Will return status of object: Visible if Visible and Hidden if Hidden. If object does not exist it will return NotFound.
IsOnScreen
Will return Visible if the object is fully on the viewport i.e. the visible part of the Document. If the object is partly or fully off the viewport this function will return Hidden. Will return NotFound if the object does not exist.
ViewXPos
Return the relative X-position (Horizontal Scroll) of the left upper corner of the current viewport. If the form has not scrolled it will be 0 if it has scrolled it will be the pixel position of this corner.
Product
Will return the product type you are running. Typical: Developer or Player in 8.5
ProductStatus
Will return the status of the product you are running. Typical: Release or Beta in 8.5
ProductExpiry (Obsolete)
Will return the expiry date of the product type you are running. Typical:Unlimited (if full) or the date ex. 31/12/2016 if timed in 8.5. This will return the hard coded expiry stored in the old style license numbers like T80 etc. This has now been superseeded by call home features which are returned by ProductSoftExpiry
ProductSoftExpiry
Will return the current expiry date of the product type you are running. All modern license keys can be limited to a date which can be updated automatically by our licensing server ex. when you renew your subscription etc.
For App Developers this can be used to warn users that their license is about to expire and also direct them to renewal and download.
OSVersion
Will return the current version of Windows (future iOs/Android etc). Currently will return 8 for any version above 7.
OSInfo
Will return the architecture of the current OS. 32 or 64 bits.
SystemPrinter
Will open a Printer Selection dialog and allow you to select on of the printers installed on your computer and return the selected printer. Will not change or set the printer.
IEEnhancedSecurity
Will return the Yes if IE Enhanced Securit is Enabled and No if not. If IEEnhanced Security is enabled the built in Web Object based on IE will not perform as it should i.e. will not load external code or execute external code. This is particularly enabled on server installations so if you are running DE85 on a Server and want to use WebObject you need to check and tell the user to switch this feature off.
LicenseNr
Will return the current license number of the installed DataEase running the application.
ScientificTime
Will return the the number of milliseconds since midnight as a number.
UserName
Will Return active WIndows Username
ComputerName
Will Return the name of the active Computer/device
ActiveWindow (9.0)
Will return the window handle for the active window. Not same as ActiveDoc which will return the caption/name of the window.
ExeFileName (9.0)
Will return the name of the DataEase exectuable found in ProgramPath. To be used when creating paths to DataEase etc.
ActiveTabName (9.0)
Will return the name of Active Tab in a tabcontrol object. Format: GetCurrent("ActiveTabName","TabControlName") ex. GetCurrent("ActiveTabName","CustomersTab")
ObjectName (9.0)
Will return the name of the object which is currently active (has focus).
ObjectType (9.0)
Will return the Type of the object which is currently active (has focus).
ObjectValue (9.0)
Will return the Value of the object which is currently active (has focus).
ObjectStyle (9.0)
Will return the Style of the object which is currently active (has focus).
FieldType (9.0)
Will return the Type of Field that currently has focus.
ServiceWindowInfo (9.0)
Second Argument is ServiceWindow Number as text and you also have a third argument where you can indicate a string return of just one property.
Returns a JSON array with the current status of the indicated service window.
Ex. GetCurrent("ServiceWindowInfo","2","visibility")
MachineGUID (9.0)
Will return a guaranteed unique value every time it is called. Used by Registry in Windows and will be unique in the
DocStyleFileName (9.0)
Will return the full path to the style file currently active on the document. (Doc Settings)
AppStyleFileName (9.0)
Will return the full path to the style file currently active on the Application (App Settings).
AppLetter (9.0)
Will return the AppLetter for this app ex. RDRRBAAA.INI will return B (RDRRxAAA.INI)
DocStyleIsDirty (9.0)
Will return yes if the style has been changed since it was loaded.
CatalogDirty (9.0)
Will return yes if there has been changes to the catalog data i.e. new form, deleted form etc.
RecordsCount (9.0)
Will return the number of records in active search/filter in active document, can query other docuement with extra handle for document.
OsVersionMajor
Will return the main version number of Windows (dwMajorVrsion in table below)
OsVersionMinor
Will return the minor version number of Windows (dwMinorVersion in table below).
OsVersionBuild
The build number of the operating systeem
OsVersionPatchMajor
The major version number of the latest service pack installed on the system. For example, for Service Pack 3, the major version number is three. If no service pack has been installed, the value is zero.
OsVersionPatchMinor
The minor version number of the latest service pack installed on the system. For example, for Service Pack 3, the minor version number is zero.
Operating system | Version number | dwMajorVersion | dwMinorVersion | Other |
---|---|---|---|---|
Windows 8.1 | 6.3 | 6 | 3 | wProductType == VER_NT_WORKSTATION |
Windows 8 | 6.2 | 6 | 2 | wProductType == VER_NT_WORKSTATION |
Windows Server 2012 | 6.2 | 6 | 2 | wProductType != VER_NT_WORKSTATION |
Windows 7 | 6.1 | 6 | 1 | wProductType == VER_NT_WORKSTATION |
Windows Server 2008 R2 | 6.1 | 6 | 1 | wProductType != VER_NT_WORKSTATION |
Windows Server 2008 | 6.0 | 6 | 0 | wProductType != VER_NT_WORKSTATION |
Windows Vista | 6.0 | 6 | 0 | wProductType == VER_NT_WORKSTATION |
Windows Home Server | 5.2 | 5 | 2 | wSuiteMask == VER_SUITE_WH_SERVER |
Windows Server 2003 | 5.2 | 5 | 2 | Not applicable |
Windows XP Professional x64 Edition (see note) | 5.2 | 5 | 2 | wProductType == VER_NT_WORKSTATION |
Windows XP | 5.1 | 5 | 1 | Not applicable |
Windows 2000 | 5.0 | 5 | 0 | Not applicable |
OsVersionProductType
The product type. This member contains additional information about the system. This member can be one of the following values:
Value | Meaning |
---|---|
VER_NT_WORKSTATION | Windows 2000 or later professional version |
VER_NT_DOMAIN_CONTROLLER | Windows 2000 or later domain controller |
VER_NT_SERVER | Windows 2000 or later server |
OsVersionSuitMask
Will return the minor version number of Windows (dwMinorVersion in table below).
The product suites available on the system. This member is set to zero or to the bitwise OR of one or more of the following values.
Value | Meaning |
---|---|
VER_SUITE_BACKOFFICE | Microsoft BackOffice components are installed. |
VER_SUITE_BLADE | Windows Server 2003, Web Edition is installed. |
VER_SUITE_COMPUTE_SERVER | Windows Server 2003, Compute Cluster Edition is installed. |
VER_SUITE_DATACENTER | Windows Server 2008 Datacenter, Windows Server 2003, Datacenter Edition, or Windows 2000 Datacenter Server is installed. |
VER_SUITE_ENTERPRISE | Windows Server 2008 Enterprise, Windows Server 2003, Enterprise Edition, or Windows 2000 Advanced Server is installed. |
VER_SUITE_EMBEDDEDNT | Windows XP Embedded is installed. |
VER_SUITE_PERSONAL | Windows Vista Home Premium, Windows Vista Home Basic, or Windows XP Home Edition is installed. |
VER_SUITE_SINGLEUSERTS | Remote Desktop is supported, but only one interactive session is supported. This value is set unless the system is running in application server mode. |
VER_SUITE_SMALLBUSINESS (see note) | Microsoft Small Business Server was once installed on the system, but may have been upgraded to another version of Windows. For more information about this flag bit, see the following Remarks section. |
VER_SUITE_SMALLBUSINESS_RESTRICTED | Microsoft Small Business Server is installed with the restrictive client license in force. For more information about this flag bit, see the following Remarks section. |
VER_SUITE_STORAGE_SERVER | Windows Storage Server 2003 R2 or Windows Storage Server 2003 is installed. |
VER_SUITE_TERMINAL | Terminal Services is installed. This value is always set.If VER_SUITE_TERMINAL is set but VER_SUITE_SINGLEUSERTS is not set, the operating system is running in application server mode. |
VER_SUITE_WH_SERVER | Windows Home Server is installed. |
Note You should not rely solely on the VER_SUITE_SMALLBUSINESS flag to determine whether Small Business Server is currently installed. Both this flag and the VER_SUITE_SMALLBUSINESS_RESTRICTED flag are set when this product suite is installed. If you upgrade this installation to Windows Server, Standard Edition, the VER_SUITE_SMALLBUSINESS_RESTRICTED flag is cleared, but the VER_SUITE_SMALLBUSINESS flag remains set, which, in this case, indicates that Small Business Server was previously installed on this system. If this installation is further upgraded to Windows Server, Enterprise Edition, the VER_SUITE_SMALLBUSINESS flag remains set.
Example 1
We have a picture archive where the images are stored in My Pictures under My Documents, and the images names are stored and organised in a DataEase application. The Image name is stored in the field Image and we want to display a preview in an ImageField.
concat(GetCurrent("MyDocuments","/My Pictures/",Image)
As simple as that ;-)
Example 2
This is a slightly more advanced example that is taken from the Example - Send Advanced E-Mail in the Default Template in DataEase 8.
Her we have a button that open a file dialogue and point it on My Documents, when the user hit OK, the file name is appended with MemoCopy() to a Attachment field.
MemoCopy(Attachments,concat(GetFileName("","",GetCurrent("MyDocuments")),","),0)
DataEae has been a little "wobbly" on referencing external stuff like Images etc.
There is an Imagepath in Application Preferences, but it has been rendered "defunct" so many times over the years, and nobody is really sure how it works anyway, so the only safe bet has been to leave stuff directly in your App catalogue, or in the DataEase program catalogue itself.
For the messy people amongst us, this is OK, but even we get problems after a while when we can't find what we are looking for in an overgrown forest of .DBM .TDF .FRM .TMP .PNG .BMP etc.
This problem might have been surmountable in older versions of DFW, where it was limited anyway what you could link into your DataEase forms. In DataEase 8 this problem has become insurmountable, because you can now simply link in almost anything via our new WebField class etc.
Traditionally this was often solved by developers insisting that the App should be installed on C:\etc on the same path every time, but is this practical?
As a programmer I don't like leaving thing to chance or customers, I need to know that my app will work wherever it is put, so isn't it better to simply be able to deduct where you are, and include this information in the paths?
We think so, so we have included a new function and called it GetCurrent in honour of the old and lovey current functionality in DataEase.
At the moment it returns only 3 values (but this will be extended as we progress and realise the need...)
GetCurrent("AppPath"), GetCurrent("ProgrPath") GetCurrent("MyDocuments")
The return value is string, and I guess the arguments is almost self explanatory, but for the slow amongst you:
1. AppPath = Your applicaiton path ex. C:\Users\Ulrik\Documents\My DataEase\7.3.Bug Apps\Andrey\UniqueID
2. ProgrPath = Where DataEase is installed ex. C:\Program Files (x86)\DataEase\DataEase 8.0\
3. MyDocuments - Where MS wants you to store your documents ex. C:\Users\Ulrik\Documents
All the above is genuine paths returned by GetCurrent just now for your enjoyment...
Current
MemoCopy
WriteToFile
Environment Variables
SetCurrent
Product: Dataease [{8}]FIVE. Written by Gregor Popp 28/08/14 at 06:18:53
Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 28/08/14 at 09:27:51
Product: Dataease [{8}]FIVE. Written by Henry Gondorf 27/01/16 at 18:37:07
Product: Dataease [{8}]FIVE. Written by DataEase 27/01/16 at 20:13:36
Product: Dataease [{8}]FIVE. Written by Henry Gondorf 28/01/16 at 09:57:36
Product: Dataease [{8}]FIVE. Written by DataEase 28/01/16 at 11:06:23
Product: Dataease [{8}]FIVE. Written by afonso santos 19/11/17 at 16:22:17
Product: Dataease [{8}]FIVE. Written by afonso santos 27/11/17 at 00:09:26
Product: Dataease [{8}]FIVE. Written by DataEase 27/11/17 at 09:32:34
Product: Not product specific.. Written by Paul Cheeseman 27/04/23 at 15:10:02
Product: Not product specific.. Written by Paul Cheeseman 27/04/23 at 15:40:46
Product: Not product specific.. Written by DataEase 27/04/23 at 17:26:04
Product: Dataease [{8}]FIVE. Written by DataEase 26/09/12 at 07:53:14
Product: Dataease [{8}]FIVE. Written by DataEase 21/08/14 at 12:10:10
Product: Dataease [{8}]FIVE. Written by DataEase 25/08/14 at 18:17:03
Product: Dataease [{8}]FIVE. Written by DataEase 11/11/14 at 18:02:50
Product: Dataease [{8}]FIVE. Written by DataEase 19/11/14 at 16:15:24
Product: Dataease [{8}]FIVE. Written by DataEase 05/06/15 at 10:35:09
Product: Dataease [{8}]FIVE. Written by DataEase 01/12/15 at 15:00:10
Product: Dataease [{8}]FIVE. Written by DataEase 01/12/15 at 18:15:52
Product: Dataease [{8}]FIVE. Written by DataEase 08/01/16 at 15:37:13
Product: Dataease [{8}]FIVE. Written by DataEase 28/01/16 at 11:26:05
Product: Dataease [{8}]FIVE. Written by DataEase 15/07/16 at 18:10:08
Product: Dataease [{8}]FIVE. Written by DataEase 08/09/16 at 11:07:37