VARINIT

Contents


Varinit is used to determine if a mask variable is initialised or not.

 

Syntax

   varinit ( zone_name [, exp_index ] )

 

Parameters

Element

Description

Restrictions

zone_name

[ class ] name_of_variable.

Must match an open mask zone.

exp_index

Integer expression for the index of the variable.

The index must be in the range defined by the repeat factor.

 

Examples

   # Initialisation routine for the TTVA zone
    If varinit ([M]TTVA) = 0
       Call CODTVA From SAIFAC
    Endif

   # A scrolling table has (at least) the QALIV and QCOM zones. The
   # following routine is called on initialisation of QALIV before
   # each input (zone in '@')
    If varinit ([M]QALIV, indice) = 0
       zc = [M]QCOM(indice)
    Endif

 

Description and comments

The function varinit is used to determine if a zone defined in a mask is initialised or not. A zone is not initialised as long as it has not been entered or assigned. It becomes non-initialised again when its value is deleted by the Effzo or Raz instruction.

varinit includes one or two arguments (the second is zero by default). For a dimensioned zone, a second argument is given to determine if the corresponding index element in the table is initialised or not. The Adonix system variable index may be used to give the current index.

The function varinit returns an integer that is:
1 : if the zone is initialised
0 : if the zone is not initialised.

 

Associated errors

Error

Description

ERVARI ( 6)

Non-existent variable.

ERINDI ( 8)

Incorrect index.

ERDOM (50)

- zone_name does not match a variable.
- zone_name does not match a variable of a mask.

ERCLAS ( 7)

Non-existent class.

 

Associated key words

EFFZO


CONTENTS


Copyright © Sage 1999 - 2007