HTBasic Help
×
Menu
Index

Write the CSUB Routines

 
Once the CSUB prototype PROG file is created, you can proceed to write the CSUB routines. The basic outline of a CSUB routine in the C language is as follows:
 
/* Define Static Data Here */
static int saveit;
static char name[20];
 
int name( int NPAR, parameters.... ) {
 
        code to implement function
 
return error;
}
 
static int other_routines( parameters.... ) {
 
        code to implement function
}
 
Remember that the C language routine receives the value of NPAR as the first argument and that it must return an error value. Define all global data and routines as static to make the DLL symbol table as small as possible.
 
CSUB Examples
Complete working C language CSUB examples are given later in this manual.
 
Routine Name
You may choose any routine name that is unique from any other DLL routine name in use in the Windows system.