CALCULATEX
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Revelation Technologies | 14 NOV 1989 | 2.X | EXPERT | CALCULATEX |
CALCULATEX
CALCULATEX is an external function that evaluates the specified field.
result = CALCULATEX(field, dict, id, record, mv)
Using CALCULATEX
CALCULATEX differs from R/BASIC CALCULATE only in relieving the user of the necessity to save and restore the values of @DICT, @RECORD, and @ID.
field
Field contains the name of the dictionary field to evaluate.
dict
Dict contains the source dictionary file.
id
Put the record key of the source record in id.
record
Place the source record in record.
mv
Mv contains the value number of the source value in a multivalued field. This value should be 0 (zero) if the field is single-valued.
Values returned
CALCULATEX returns the result of evaluating field in the specified dictionary.
Correct Use of CALCULATEX
/* The following code opens a file and its associated dictionary, then uses CALCULATEX to evaluate one multivalue in a field from SAMPLE_CUSTOMERS. */ DECLARE SUBROUTINE FSMSG, MSG DECLARE FUNCTION CALCULATEX file = "SAMPLE_CUSTOMERS" field = "CONTACT_NAME" dict = "DICT SAMPLE_CUSTOMERS" id = 6 mv = 2 OPEN file TO filevar ELSE FSMSG(); STOP OPEN dict TO @DICT ELSE FSMSG(); STOP READ @RECORD FROM filevar,id ELSE FSMSG(); STOP result = CALCULATEX(field, @DICT, id, @RECORD, mv) text = "Multivalue ":mv:" of the ":field:" field" text<<-1>> = "for record ":id:" evaluates to |":result MSG(text,"","","")