Once the CSUB arguments are defined, you can proceed to create the CSUB prototype PROG file. It provides the CSUB name and argument definitions that will be used later by the CSUB builder utility. It is created from within HTBasic using the EDIT mode as follows:
• Enter the SUB, any COM, and SUBEND program lines.
• Move back to the SUB line and press INSERT-LINE.
• Enter 1 END.
For example:
1 END
10 SUB Test12( INTEGER A(*), REAL B, C$ )
20 SUBEND
This creates a small main context and a SUB context named Test12. If you are defining several entry points in one CSUB context then continue to enter the additional SUB definitions after the first. For example:
30 SUB Test13( A$, INTEGER B, C )
40 SUBEND
After all the desired SUBs have been defined you must pre-run the program and then store it as a PROG file as follows:
• Press the STEP key or enter RUN to pre-run the SUB program.
• STORE the program to a PROG file:
STORE "your_routine.pro"
Remember that if you include COM statements in a SUB definition, you must enter the full COM definition in the main context to allow a prerun. For more information on using COM variables in CSUBs, see the "COM Variables" section.