EVALUE

Contents


"evalue" is used to evaluate a formula contained in a character string.

 

Syntax

evalue ( string_to_evaluate [, exp_tok ] )

 

Parameters

Element

Description

Restrictions

string_to_evaluate

Alphanumeric expression containing the calculation formula to be evaluated.

None.

exp_tok

Reserved

None.

 

Example

# Management of errors in evaluating a calculated string
Local Char FORMULE(100), RESULTAT(100)
Local Integer ERN
 
# In the event of error, go to ERCALC, where ERN will be updated.
Onerrgo ERCALC
 
# Translation of key-words
FORMULE = "date$$"
ERN = 0
 
# the formula is evaluated and formatted as a string
# vireblc deletes unnecessary spaces.
RESULTAT = vireblc(format$("K:100X", evalue(FORMULE)), 2)
 
# If ERN is not null, ERCALC goes to
# display of message: "Error in calculation: illegal character"
If ERN
Errbox "Error in calculation :"-errmes$(ERN)
Endif
End
 
# Error management sub-programme: errn only has a meaning here
ERCALC
ERN = errn
Resume

 

Description and comments

"evalue" is used to evaluate the content of a a character string containing a formula.

 

Associated errors

Error

Description

ERMODE (10) :

·The formula is not a Char type.

·The 2nd argument is not a numerical type.

 

Associated key words

PARSE


CONTENTS


Copyright © Sage 1999 - 2007