SCHAR

Summary


Schar is used to declare the variables of the type ASCII character string.

Syntax

   Schar        list_chr_dim
   Local  Scharlist_chr_dim
   Global Scharlist_chr_dim
   Extern Scharlist_chr_dim

Parameters

Element

Description

Restrictions

list_chr_dim

List of chr_dim separated by the character ','.

None.

chr_dim

Name of a variable expressed in one of the following forms :

name'(' maxlen ')'
name'(' maxlen ')' '(' lis_dim ')'

None.

name

variable_name.

None

maxlen

Maximum admissible length for
the character string concerned

Integer expression
before 1 and MAXSTR
(255).

lis_dim

List of exp_dim separated by the character ','.

Number limited to 4.

exp_dim

Integer expression representing
the number of elements for the
variable (from 0 to exp_dim-1)
or
2 integer expressions separated
by the 2 characters '..'
representing the interval
for the possible indexes for the variable

The number of the elements
must belong
to [1,65535]. If
an interval is
given, the starting index
must
belong to
[-32768,32767].

Examples

# Declaration of a variable of 250 ASCII characters.
    Local Schar STRING (250)

Description and comments

Schar is used to declare the variables of the type character strings, coded in ASCII 

Schar should be used more often than char when only ASCII characters are being processed and when wanting to economise on memory usage. ( Schar codes over a byte, char codes over two bytes).

Associated errors

Error

Description

ERDIM (55)

Too many dimensions given (>4).

ERVARI (6)

Non existent variable (External).

ERMODE (10)

- The given dimensions are not numeric.
- The variable is of the incorrect type (External).

ERINDI ( 8)

One of the dimensions is null.

ERDOM (50)

- The dimensions do not fall between -32768 and +32767.
- The number of characters requested is negative or greater than MAXSTR (255).

Associated keywords

CHAR - LIBELLE - SHORTINT - DATE - INTEGER - DECIMAL - TYPE - DIM - GLOBAL - LOCAL - EXTERN


SUMMARY


Copyright © Sage 1999 - 2007