The usual technique is to use the same technique as the Windows API offers - instead of using SUB's, use a function that returns an error code. You could also call a function that could be used to store the ERR and ERRAPI values in static variables, and then these could be retrieved from other subs/functions.
Code:
' Psuedocode FUNCTION GlobalError(BYVAL PBerr&) AS LONG STATIC LastErr& IF PBErr& = 0 THEN FUNCTION = LastErr& ELSE LastErr& = PBerr& END IF END FUNCTION ... call GlobalError(7) ' set "lasterr" to 7 ... if GlobalError(0) = 7 THEN... ' Retrieve the last error ...
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment: