long GetParmLong(Value p) //accepts float and int, returns int { if ( p.ev_type == 'N' ) return (int)p.ev_real; else if ( p.ev_type == 'I' ) return p.ev_long; else return 0; }So for example, for an external declaration
FoxInfo myFoxInfo[] = { ... {"PD_SETPROGRESS", (FPFI) SetProgress, 2, "N.N"}, ... }The function is implemented as follows. Note that I also check if the second parameter (declared as optional) exists, otherwise it is replaced with a default value 100.
void SetProgress( ParamBlk *parm ) { long dwCompleted = GetParmLong( parm->p[0].val ); long dwTotal = parm->pCount > 1 ? GetParmLong( parm->p[1].val ) : 100; // ... the rest of code }