Simplicty and flexibility!


Function::Internal

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

current date
The date recorded by the system clock (a date value). The year part is a two digit number.
current extended date
The date recorded by the system clock (a date value). The year part is a four digit number.
current time
The time recorded by the system dock (a time value).
current page number

In 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 number

The number of the current record. Records are automatically counted as they are processed by the procedure (a numeric value).


current user name


The name used to sign onto the application (a text value).
current user level
The 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.


Syntax:
CURRENT Parameter(s)

Parameters


Date, Exended Date, Time, Page Number, Item Number, User Name, User Level, Computername, Status

Returns/Result


Correct Type for Function.
Current User Name will return Text String. Current Date will return Time Value and Current Date will return Date value etc.

When current status is used with the input using command, it returns a numeric value from 1 to 4 depen

Examples


Example 1

Using current username to display a welcome message in a virtual field. The current user is Andy MacGrath

concat("Welcome to our application ", current username, " ;-)")


Result: Welcome to our application Andy MacGrath ;-)


Example 2

Using current user level to show or hide the secret field Customer Comments.

if (current user level = high, SetState("Customer Comments",1), SetState("Customer Comments",0))


Result: This will hide the field if the current user level is lower then High and show it if it is High.


Example 3

list records

current date ;

current user name .

for MEMBERS with TOTAL DUE > 175 ;

list records

LAST NAME in order ;

TOTAL DUE ;

current item number end


This script tells DataEase: (1) Select the MEMBERS records that have a TOTAL DUE value greater than $175, (2) list the LAST NAME and TOTAL DUE values and current item number (record number) from each record that is processed, and (3) list the current date (today's date) and the current user name (the name of the user who generated the report).

The output from this script might looks as follows:

Report generated by: George McGrath Date: 01/20/99

Item #

Last Name

Total Due

1

Perrault

215.00

2

Christino

280.00

3

Stafford

185.00

4

Strachan

205.00

Reference

current

See also commit, data-entry, exec SQL, global, input using, temp.

 

Type

Variable component

Purpose

The current keyword lets you access any of the eleven system defined variables summarized below and on the following page.

Variables Used with the current Keyword

 

 

current date

The date recorded by the system clock (a date value). The year part is a two digit number.

 

Current extended date

The date recorded by the system clock (a date value). The year part is a four digit number.

 

current time

The time recorded by the system dock (a time value).

 

 

current page number

In 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 number

The number of the current record. Records are automatically counted as they are processed by the procedure (a numeric value).

 

 

current user name

The name used to sign onto the application (a text value).

 

 

current user level

The 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.

 

The following variables are used only in applications that access data on an SQL database:

 

 

current SQLCODE

The SQL Error Code number generated by the server when an error occurs during the processing of an SQL statement (e.g., CREATE, INSERT, UPDATE, or DELETE). current SQLCODE is set to zero if the last SQL statement is processed without error. Server-specific error codes are explained in your database engine documentation. See the commit andexec SQL commands for examples.

 

 

current SQLCOUNT

The number of rows processed by the procedure. See the exec SQLcommand for an example.

 

 

current SQLMSGTXT

The SQL Message Text generated by the server, in addition to any errors and warnings (a server can return a current SQLCODE value of zero and still generate SQL Message Text). DataEase displays the first 50 characters of the message. Server-specific messages are explained in your database engine documentation. See the exec SQL command for an example.

 

Note: See input using for examples demonstrating the use of the current status variable. See commit for examples that use current SQLCODE and current SQLCOUNT. See exec SQL for examples using current SQLCODE, current SQLCOUNT, and current SQLMSGTXT.

 

When current status is used with the input using command, it returns a numeric value from 1 to 4 depending on which menu selection (or icon) the user chooses after entering data.

When current status is used with an enter a record, modify records, delete records, or commit command, it returns 0 (zero) if the command is processed successfully and -1 (negative 1) if the command fails.

Syntax

current variable name

Example

list records

current date ;

current user name .

for MEMBERS with TOTAL DUE > 175 ;

list records

LAST NAME in order ;

TOTAL DUE ;

current item number end

 

This script tells DataEase: (1) Select the MEMBERS records that have a TOTAL DUE value greater than $175, (2) list the LAST NAME and TOTAL DUE values and current item number (record number) from each record that is processed, and (3) list the current date (today's date) and the current user name (the name of the user who generated the report).

The output from this script might looks as follows:

 

Report generated by: George McGrath Date: 01/20/99

 

Item #

Last Name

Total Due

1

Perrault

215.00

2

Christino

280.00

3

Stafford

185.00

4

Strachan

205.00

 

See Also


GetCurrent

On the forum about Current

[@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

On the blog about Current


dg3_HelpView