Function items_line_total

This function calculates the value of line_total for any new rows that are inserted into the arr_items array.

Function items_line_total:
01 FUNCTION items_line_total(curr_pa)
02   DEFINE curr_pa SMALLINT
03   LET arr_items[curr_pa].line_total = 
04       arr_items[curr_pa].quantity * arr_items[curr_pa].price 
05 END FUNCTION
Note:
  • Line 02 The index of the current row in the array is passed to this function and stored in the variable curr_pa.
  • Lines 03 and 04 calculate the line_total for the current row in the array.