FORMULA

Concept Link IconSee also Concept Link IconExample

Activate or modify a formula.

WebVue support - Yes.

Mode

Mnemonic

Syntax

1 ADD 1
2 ENABLE 2
3 DISABLE 2
5 DEL 2
6 DELALL 3

Syntax 1

IntVal = FORMULA(Mode, handle);

Argument

Meaning

handle

Points to the buffer in which all the arguments needed for the formula are specified. Type LONG.

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

1

ADD

Creates the formula named "label". All the arguments are specified in the buffer pointed to by "handle". The contents of the buffer must follow the syntax of the file FORMULA.DAT. Several formulas may be defined in the same buffer. The formula created is temporary. Any formula created by the configuration cannot be deleted or modified in this way.

 

 

Return: The number of the formula correctly configured and running.

Syntax 2

IntVal = FORMULA(Mode, label, branch);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

2

ENABLE

Activates the formula specified by the label and branch. This may be applied to all configured formula.

 

 

Return: 1 if the formula exists and the syntax is correct, else 0.

3

DISABLE

Disables the formula specified by the label and branch. This may be applied to all configured formula.

 

 

Return: 1 if the formula exists and the syntax is correct, else 0.

5

DEL

Deletes the formula specified by the label and the branch.

 

 

Return: 1 if the formula exists, else 0.

Syntax 3

IntVal = FORMULA(Mode[, Class] );

Argument

Meaning

Class

Identifies the class of formula.

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

6

DELALL

Deletes all the existing temporary formulae. If the class is given, only formulae of that class will be deleted.

 

 

Return: 1 if the formulae are correctly deleted, else 0.

Example

SUB main()
DIM hdl as LONG;
hdl = filetobuf("ftest.dat"); 'formula file
print(formula("ADD",hdl));
free_buffer (hdl);
END SUB
 

SUB actif()
formula("ENABLE","formula test1 tempo","");
END SUB
 

SUB noactif()
formula("DISABLE","formula test1","");
END SUB

For further examples, select the Example link above.