Programming Guide |

int sm_calc(int field_number, int occurrence, char *expression);

`field_number`

- The field to use for relative field references, for backward compatibility only. If
`expression`

references fields according to current conventions, supply 0.`occurrence`

- The occurrence in
`field_number`

to use for relative field references, for backward compatibility only. If`expression`

references fields according to current conventions, supply 0.`expression`

- A math expression. Refer to "Performing Calculations and Validating Numbers" in
Using the Editorsfor information on creating math expressions.

`sm_calc`

lets you execute a math expression. Use this function to perform mathematical operations that use the contents of one or more fields and then insert the result into a field.

/* Compute payment due date. */

sm_calc(0, 0, "paymentduedate = @date(shipdate) + 30");