Progress
Language Reference


ENTRY Statement

Interfaces
OS
SpeedScript
All
All
Yes

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

SYNTAX

ENTRY ( element , list [ , character ] ) = expression 

element

An integer value that corresponds to the position of a character string in a list of values. If the value of element does not correspond to an entry in the list, Progress raises the ERROR condition. If the value of element is unknown (?), ENTRY returns an unknown value. If element is less than or equal to 0, or is larger than the number of elements in list, ENTRY returns an error.

list

A list of character strings. Separate entries with commas. If the value of list is unknown (?), ENTRY returns an unknown value.

character

A delimiter you define for the list. The default is a comma. This allows functions to operate on non-comma-separated lists. The delimiter must be only a single character. If you specify a string of more than one character, only the first character is used. If you specify a null string (""), a space character is used as the delimiter. If you use an alphabetic character, this delimiter is case sensitive.

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.

EXAMPLE

This procedure uses three ENTRY statements.

r-ent-eq.p
DEFINE VARIABLE num-recs AS INTEGER.
DEFINE VARIABLE msg-txt  AS CHARACTER INITIAL
 "There are <x> records in the table.".

/* count the records. */
FOR EACH customer:
  num-recs = num-recs + 1.
END.

/* if there is only one record, 
  make the message singular. */
IF num-recs = 1 THEN
  ASSIGN
    ENTRY(2,msg-txt," ") = "is"
    ENTRY(4,msg-txt," ") = "record".

/* insert the record count into the string. */
ENTRY(3,msg-txt," ") = STRING(num-recs).

MESSAGE msg-txt. 

NOTE

The ENTRY statement is double-byte enabled. It can insert an entry that contains double-byte characters into a specified list and the character delimiter can be a double-byte character.

SEE ALSO

ENTRY Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095