' *** EXECUTE.LST *** 2nd GFA-Manual, page 19-8 > PROCEDURE execute_prg(file$,bytes%,cmd$,VAR ok!,return%) ' ' *** Reserve bytes% memory and start program file$ (*.PRG) with EXEC 0 ' *** Use complete path for file$ (including drive/folder) ' *** The commandline cmd$ usually is "" ' *** Returns ok!=TRUE if program was started succesfully ' *** In that case return% is value returned by program (<0 if error) ' ' *** Procedure: Program_exit ' LOCAL free%,m$,k IF cmd$<>"" cmd$=CHR$(LEN(cmd$)+1)+cmd$ ! special commandline-format ENDIF free%=FRE() bytes%=bytes%+256-MOD(bytes%,256) ! multiple of 256 IF bytes%>free% m$=" *** Error ***|Not enough memory |available for " m$=m$+RIGHT$(file$,LEN(file$)-RINSTR(file$,"\")) m$=m$+"|("+STR$(bytes%)+" bytes needed)" ALERT 3,m$,1,"Continue|Quit",k IF k=1 ok!=FALSE ELSE @program_exit ENDIF ELSE IF EXIST(file$) RESERVE -bytes% DEFMOUSE 0 SHOWM ok!=TRUE IF INSTR(file$,":",2) CHDRIVE LEFT$(file$,3) CHDIR MID$(file$,3,RINSTR(file$,"\")-3) ELSE CHDIR LEFT$(file$,RINSTR(file$,"\")) ENDIF ~SHEL_WRITE(1,1,1,"",file$) return%=EXEC(0,file$,cmd$,"") ! start program file$ ~SHEL_WRITE(0,1,1,"","") RESERVE ELSE m$="*** Error ***| |File "+RIGHT$(file$,LEN(file$)-RINSTR(file$,"\")) m$=m$+"|not found " ALERT 3,m$,1,"Continue|Quit",k IF k=1 ok!=FALSE ELSE @program_exit ENDIF ENDIF ENDIF RETURN ' ********* '