Progress Expressions

Top  Previous  Next  

The following list details initial information of some Progress Expressions that can be used. Additional information is available at OpenEdge ABL Reference

Expression

Description

Usage

STRING

Converts a value of any data type into a character value.

STRING ( source )

source
An expression of any data type that you want to convert to a character value.

INTEGER

Converts an expression of any data type to an integer value, rounding that value if necessary

INTEGER ( expression )

expression
A constant, field name, variable name, or expression whose value can be of any data type.

SUBSTRING

Extracts a portion of a character string from a field or variable

SUBSTRING (source , position , length  )

source
A character/string expression from which you want to extract characters or bytes.

position
An integer value (or expression) that indicates the position of the first character you want to extract from source.

length
An Integer value (or expression) that indicates the number of characters you want to extract from source.

INDEX

Returns an integer that indicates the position of the target string within the source string.

INDEX ( source , target , starting )

source
A Character/string expression.

target
A character / string expression whose position you want to locate in source.

starting
An integer that specifies at which left-most position in the string to start the search.

If the target is not found in the source INDEX returns 0

ENTRY

Used on the left-hand side of an assignment to set the nth element to some value

ENTRY ( element , list  , character  )

element
An integer value that corresponds to the position of a character string in a list of values.

list
A list of character strings separated with a character delimiter.

character
A delimiter you define for the list. The default is a comma.

expression
A constant, field name, variable name, or expression that results in a character string whose value you want to store in the nth element in a list. Progress does not pad or truncate expression.

IF

Evaluates one of two expressions, depending on the value of a specified condition

IF condition THEN expression1 ELSE expression2

condition
An expression whose value is logical (TRUE or FALSE).

expression1
A constant, field name, variable name, or expression. If the condition is TRUE, then the function returns this value.

expression2
A constant, field name, variable name, or expression whose value is of a data type that is compatible with the data type of expression1. If the condition is FALSE or the Unknown value (?), then the function returns this value.

LENGTH

Returns the number of characters in a string.

LENGTH (  string  )

string
A character expression.

TRIM

Also ( RTRIM / LTRIM )

Removes leading and trailing white space, or other specified characters, from a CHARACTER or LONGCHAR expression

TRIM ( expression  , trim-chars )

expression
An expression whose value is a character or string.

Right-Time and Left Trim options are also available

NUM-ENTRIES

Returns the number of elements in a list of character strings

NUM-ENTRIES ( list [ , character ] )

list

A character expression containing a list of character strings separated with a character delimiter.

character

A delimiter you define for the list. The default is a comma (,)

DATE

Converts a single character string, a set of month, day, and year values, an integer expression, a DATETIME expression, or a DATETIME-TZ expression into a date

DATETIME (date-exp )
DATETIME ( string )
DATETIME (month, day, year, hours, minutes)

date-exp
An expression whose value is a DATE.

string
A character expression whose value is a string containing a DATETIME.

month
An expression whose value is an integer from 1 to 12, inclusive.

day
An expression whose value is an integer from 1 to the highest valid day of the month.

year
An expression that evaluates to a year.

hours
An expression whose value is an integer from 0 to 23, inclusive.

minutes
An expression whose value is an integer from 0 to 59, inclusive.

DATETIME

Converts date and time values, or a character string, into a DATETIME

DATETIME (date-exp )
DATETIME ( string )
DATETIME (month, day, year, hours, minutes  )

date-exp
An expression whose value is a DATE.

string
A character expression whose value is a string containing a datetime.

month        
An expression whose value is an integer from 1 to 12, inclusive.

day
An expression whose value is an integer from 1 to the highest valid day of the month.

year
An expression that evaluates to a year.

hours
An expression whose value is an integer from 0 to 23, inclusive.

minutes
An expression whose value is an integer from 0 to 59, inclusive.

TODAY

Returns the current system date

TODAY

MONTH

Evaluates a date expression and returns a month integer value from 1 to 12, inclusive

MONTH ( date )
MONTH ( datetime-expression )

date
A date expression where you want a month value.

datetime-expression
An expression that evaluates to a datetime.

YEAR

Evaluates a date expression and returns the year value of that date including the century

YEAR ( date )
YEAR ( datetime-expression )

date
A date expression for which you want to determine the year.

datetime-expression
An expression that evaluates to a datetime

 

 

 


Copyright © 2003-2017 DataPA Limited, all rights reserved. DataPA OpenAnalytics 6.0