version 2003
PA_FormulaEditor (defaultTable; text; len) char
Parameter | Type | Description | |
defaultTable | short | Default table | |
text | char * | Default formula for the enterable text area | |
User formula | |||
len | long * | Length of the defaut formula | |
Length of the user formula | |||
Function result | char | 1 if the user has validated the dialog box |
Description
The routine PA_FormulaEditor displays the 4D standard Formula Editor.
tableNumber is the number of the table whose fields will fill the main list (this can be changed by the user if he uses the table pop-up menu). If 0 is passed, all tables are listed.
formula is the formula displayed in the editor.
len is a pointer to the length of formula. If *len is 0, no default formula will be displayed upon entry.
If the user validates the dialog box, PA_FormulaEditor returns 1 and fills formula with the formula the user has entered. *len contains the length of this formula.
4th Dimension does not execute the formula. This routine is an accessor to the 4th Dimension Formula Editor. Using this routine, the developer can save/execute/tokenize/detokenize user specific formulas.
Example
Execute a user specific formula.
void UserFormula () { char *formula; long len; formula = malloc(32000); if(PA_FormulaEditor(0, formula, &len)) PA_ExecuteMethod(formula); free(formula); }
See Also
PA_Detokenize, PA_ExecuteMethod, PA_Tokenize.
Error Handling
PA_GetLastError always returns eER_NoErr