Simplicty and flexibility!


Username


Started by richard keyter
Search
You will need to Sign In to be able to add or comment on the forum!

Username

I need to include the username in new records being captured can the username be accessed ?


Written by richard keyter 29/09/16 at 06:32:56 Dataease [{8}]FIVE

Not only Username...

Definitely!

You have plenty of constants/variables you can read out of your system.

All DataEase versions support the old CURRENT.

CURRENT DATE|CURRENT EXTENDED DATE|CURRENT TIME|CURRENT PAGE NUMBER|CURRENT USER LEVEL|CURRENT COMPUTERNAME|CURRENT STATUS

current dateThe date recorded by the system clock (a date value). The year part is a two digit number.
current extended dateThe date recorded by the system clock (a date value). The year part is a four digit number.
current timeThe time recorded by the system dock (a time value).
current page numberIn DataEase, this command is replaced by the Page Number applicationvariable. current page number is included only to maintain compatibility with applications created in character-based versions of DataEase. See DG 6 for information on creating application variables.
current Item numberThe number of the current record. Records are automatically counted as they are processed by the procedure (a numeric value).
current user nameThe name used to sign onto the application (a text value).
current user levelThe current user's security level (a numeric value from 1 to 7).

current computername

The name of the workstation running the procedure when using DataEase in a multi-user environment (a text value set by the DENAME environmentvariable).

current status

The value of the processing action selected following the DQL input usingcommand or the status of the last DQL command that modifies data. By testing the current status variable, you can control subsequent processing following an input using command or check for errors following a DQL command that modifies data. See the input using command for an example of current status used with the input using command.

You can read more about it here.
http://www.dataease.com/dg3_HelpView/?PageID=10054...

And of course the new and exciting addition to this in 8.5

Here you can get not only the user name but the CPUId of the computer you are working on, the DocumentName, The ApplicationPath etc.

GetCurrent("AppPath")

GetCurrent("ProgrPath")
GetCurrent("MyDocuments")
GetCurrent("RowNumber")
GetCurrent("RecordNumber")
GetCurrent("IEEnhancedSecurity")
GetCurrent("Width"[,"ObjectName(Optional)"])
GetCurrent("Height"[,"ObjectName(Optional)"])
GetCurrent("WindowState")
GetCurrent("AppName")
GetCurretn("DocName")
GetCurrent("DocFileName")
GetCurrent("Xpos","MyObject")
GetCurrent(*YPos","MyObject")
GetCurrent("@DefaultPrinter")
GetCurrent("@Printer3")
GetCurrent("CPUId")
GetCurrent("MacAddress")
GetCurrent("MacAddressWIFI")
GetCurrent("MacAddressLan")
GetCurrent("AppDataPath")
GetCurrent("Version")
GetCurrent("IsDeActive")
GetCurrent("ActiveDoc")
GetCurrent("IsDocOpen")
GetCurrent("IsVisible")
GetCurrent("IsOnScreen")
GetCurrent("ViewXPos")
GetCurrent("ViewYPos")
GetCurrent("Product")
GetCurrent("ProductStatus")
GetCurrent("ProductExpiry")
GetCurrent("ProductSoftExpiry)
GetCurrent("OSVersion")
GetCurrent("OSInfo")
GetCurrent("SystemPrinter")
GetCurrent("LicenseNr")
GetCurrent("osversionmajor")
GetCurrent("osversionminor")
GetCurrent("osversionbuild")
GetCurrent("osversionproducttype")
GetCurrent("osversionpatchmajor")
GetCurrent("osversionpatchminor")
GetCurrent("osversionsuitemask")
GetCurrent("ScientificTime")

GetCurrent() - Parameters

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.

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.

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 systemVersion numberdwMajorVersiondwMinorVersionOther
Windows 8.16.363wProductType == VER_NT_WORKSTATION
Windows 86.262wProductType == VER_NT_WORKSTATION
Windows Server 20126.262wProductType != VER_NT_WORKSTATION
Windows 76.161wProductType == VER_NT_WORKSTATION
Windows Server 2008 R26.161wProductType != VER_NT_WORKSTATION
Windows Server 20086.060wProductType != VER_NT_WORKSTATION
Windows Vista6.060wProductType == VER_NT_WORKSTATION
Windows Home Server5.252wSuiteMask == VER_SUITE_WH_SERVER
Windows Server 20035.252Not applicable
Windows XP Professional x64 Edition (see note)5.252wProductType == VER_NT_WORKSTATION
Windows XP5.151Not applicable
Windows 20005.050Not applicable
OsVersionProductTypeThe product type. This member contains additional information about the system. This member can be one of the following values:
ValueMeaning
VER_NT_WORKSTATIONWindows 2000 or later professional version
VER_NT_DOMAIN_CONTROLLERWindows 2000 or later domain controller
VER_NT_SERVERWindows 2000 or later server
OsVersionSuitMaskWill 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.

ValueMeaning
VER_SUITE_BACKOFFICEMicrosoft BackOffice components are installed.
VER_SUITE_BLADEWindows Server 2003, Web Edition is installed.
VER_SUITE_COMPUTE_SERVERWindows Server 2003, Compute Cluster Edition is installed.
VER_SUITE_DATACENTERWindows Server 2008 Datacenter, Windows Server 2003, Datacenter Edition, or Windows 2000 Datacenter Server is installed.
VER_SUITE_ENTERPRISEWindows Server 2008 Enterprise, Windows Server 2003, Enterprise Edition, or Windows 2000 Advanced Server is installed.
VER_SUITE_EMBEDDEDNTWindows XP Embedded is installed.
VER_SUITE_PERSONALWindows Vista Home Premium, Windows Vista Home Basic, or Windows XP Home Edition is installed.
VER_SUITE_SINGLEUSERTSRemote 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_RESTRICTEDMicrosoft 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_SERVERWindows Storage Server 2003 R2 or Windows Storage Server 2003 is installed.
VER_SUITE_TERMINALTerminal 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_SERVERWindows 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.


Written by DataEase 29/09/16 at 08:25:37 Dataease [{8}]FIVE
DG3_ForumList