CONST

Contents


Const allows you to declare a subroutine's parameters by specifying that they are passed by address, but without ability to modify.

 

Syntax

   Const type_word dim_var_list

 

Parameters

Element

Description

Restrictions

type_word

One of the keywords used for the declarations:
Description, Shortint, Date, Integer, Decimal, Char.
In the case of Char, the name of the
variable is then followed by ().

This must be one of Adonix's types.

dim_var_list

dim_var list separated by the comma (,)

None

dim_var

Variable expressed in one of the following
formats:
var_name or
var_name '('sep_list')'

None

var_name

variable_name

None

sep_list

List of comma (,) separators
The space usually taken by the expression of the dimensions remains empty - only the number of dimensions is declared accordingly.

Not more than three separators, because the number of dimensions is limited to four

 

Examples

   # Declaration of parameters of a Call
   Subprog SOUS_TRAIT(ARGUMENT1, ARGUMENT2,  ARGUMENT3)
   Const Integer ARGUMENT1(,,) :# ARGUMENT1 is a table with three dimensions
   Const Char ARGUMENT2()(,)   :# ARGUMENT2 is a table with two dimensions
   Const Date ARGUMENT3        :# ARGUMENT3 is a date (with no dimensions)

 

Description and Comments

Const allows you to declare that the parameters of a subroutine are passed by address, but will not be able to be modified by the subroutine. The variables declared accordingly are only accessible in read mode.

 

Associated Errors

Error

Description

ERMODE (10)

Incompatibility of type between the declaration of the parameter and the parameter passed in the Call

ERDIM (55)

The number of dimensions declared does not correspond to the dimension of the variable passed in parameters.

ERARGTY (70)

The parameter passed to the Call is an expression; it can only be passed by value.

 

Associated Keywords

SHORTINT - DECIMAL - CHAR - DATE - INTEGER - LIBELLE - VALUE - VARIABLE - SUBPROG - CALL


CONTENTS


Copyright © Sage 1999 - 2007