CompuServe Messages

String->Expression?

    17-Jul-93 16:33:26
Fm: Tom Nalevanko 76004,1525
To: Simon DeDeo 72702,1024
Simon, We have a higher level function in both our VIP-C and VIP-BASIC products called _evaluate_expression. It works similarly to what you have described. Here is a description of the function. _evaluate_expression Use _evaluate_expression to evaluate an expression given as a character string. SYNTAX void _evaluate_expression (char expression[], char nb_param, char param_names[][256], extended param_values[], char *status_code, extended *expr_value); expression Address of a character string that contains the expression to be evaluated. nb_param Number of parameters. param_names Address of a character string that contains the parameter's names. param_value Array of extended variables that contains the values of the parameters. status_code Address of a char variable that, upon return, contains a zero value if the expression can be correctly parsed and computed. Otherwise, status_code contains a nonzero value and expr_value is undefined. The following values may be returned: Value Indicates 0 No error. 1 Undefined parameter in expression. 2 Invalid numeric constant in expression. 3 Illegal operand in expression. 4 Intrinsic function has invalid argument expression. 5 Intrinsic function has wrong number of arguments. 6 Invalid intrinsic function. 7 Syntax error in expression. expr_value Address of an extended variable that, upon return, contains the result of the expression. NOTE Even though an expression may be evaluated as an integer, its value will be converted to a real number in expr_value. EXAMPLE See "Eval" example in the "Math Library" folder. VIP-C will be released later this month. VIP-BASIC will be released in 6 to 8 weeks. For some product literature, pls. provide your address. To see both products in action, visit us at Macworld Boston, Aug. 2-6, Booth 5328 WTC. Thanks for your interest in VIP-C and VIP-BASIC. Tom Nalevanko Mainstay