//for Genero V2+#define fCall(aName,anArgC) fglcapi_call4gl(aName,anArgC)//Simple function call with 1 parameter and single return parameter.int call_4gl(int nargs) { char funcname[100]; long recno; short status; poplong(&recno); //get argument for 4GL call popvchar(funcname,99); //get function name for 4GL call pushlong(recno); //push argument for call to 4GL fCall(funcname,1); //call 4gl function with single parameter popshort(&status); //get functions return parameter retshort(status); //return to caller return(1);}
FUNCTION fetch_prod(l_prod_unique_key) DEFINE l_prod_unique_key INTEGER SELECT * INTO g_prod_rec.* WHERE prod_unique_key = l_prod_unique_key RETURN status = 0 END FUNCTION MAIN DEFINE l_ok SMALLINT DEFINE l_unique_key INTEGER PROMPT "Record to fetch?" FOR l_unique_key CALL call_4gl("fetch_prod",l_unique_key) RETURNING l_ok END MAIN