| Execute a DML subroutine. |
| Format | |||
| Gosub | | SUBR | [/Parameters=(par1 [,par2...])] | ||
| | #expr | | |||
| SUBR | Name of the subroutine to execute. | ||
| #expr | Expression indicating the name of the subroutine to execute. | ||
| Example | |
| Gosub CALCULATE_PAYROLL | |
| Gosub #"CALCULATE_PAYROLL" & n | |
| Gosub SUBR22 /Parameters=a, DB(FLD), item[], data[1] | |
| The last example shows a subroutine being called with parameters of a variable, a database field, a whole array, and an element of an array. The routine must also receive the parameters with the PARAMETERS statement. | |
| For the above example, this could be: | |
| Invoke a SUBROUTINE. This command will invoke a subroutine; a clearly identifiable program section. Using subroutines can greatly aid the readability of a program. They can also be very useful when trying to debug a program. |