Chapter 4-7: Predefined Fields and Processes
RETURN CODE
This field is returned whenever a CALL or RUN statement is completed. Its value is determined by the process that was called or run.
RUN /appx/deal END?
N FAIL 0
IF --- RETURN CODE EQ 52
T GOSUB :ACE OF SPADES
Assuming that the directory /appx contains the following sample C program, this program will be executed and a return code of 1 to 52 will be passed back to the APPX process that executed the RUN statement.
/* deal.c */
#include <stdlib.h>
#include <time.h>
int main( int argc, char ** argv )
{
/*
** Initialize the random number generator
*/
srand(( unsigned ) time(0) );
/*
** Return a random number between 1 and 52
*/
return( rand() % 52 + 1 );
}
APPX Application Design Manual (01/13/03)
© 2003 by APPX Software, Inc. All rights reserved