When you are developing C functions for inclusion into a QA Build program, you must perform the following tasks:
Define the C function in QA Build (name, description and parameters)
Include the function in your QA Build program
Write the C source code
Compile your QA Build program and generate the C function interface
Compile and link the source files
The following is an example C function that is called whenever a QA Build program uses the function unittoword():
void f_unittoword(word,number1,number2)
/* Function to convert a numeral to a character word */
char *word;
double *number1, *number2;
{
int i;
static char *word_for_nr[] =
{
"Zero","One","Two","Three","Four",
"Five","Six","Seven","Eight","Nine"
};
strcpy(word,word_for_nr[(int) *number1]);
/* Tell QA Build the return string is 5 characters long */
set_occurs(5);
}
|