REM Thomas Figg =>theskung@hotmail.com
REM To run an Application... use the proc below
REM CMD1$ is the Application file name, (for rom files see below)
REM * CMD2$ is the file to run it with
REM * CMD3$ is the action 'O' or 'C'
REM * CMD5$ is the Application name (Used to show app in the system screen)
REM * ALIAS$ is the alias info, (for word only) See Below
REM Can be used to run APP's or OPA's
REM (* Optional)
REM Will return 0 if successfull an error number if not
REM example uses
REM RUN%:("ROM::WORD.APP","\WRD\ggg.WRD","C","WORD","") For an APP that uses files
REM RUN%:("\APP\DRAW.OPA","\PIC\balh.pic","C","DrawMan","") for an OPA that uses files
REM RUN%:("\OPO\cool.opo","","","RunOpo","") For an OPO T
REM RUN%:("ROM::WORD.APP","\OPL\jik.Opl","C","Program","") For Opl files
REM RUN%:("\APP\CRACKSV2.OPA","","","File","") For A Type $1000 Opa
REM RUN%:("\IMG\SWITCHER.IMG","","","Switcher","") For an Img file
REM see below for Built in Apps, And explanation fo aliases
REM and now the proc you've been waiting for...
PROC Run%:(CMD1$,CMD2$,CMD3$,CMD5$,ALIAS$)
LOCAL lc92z$(6),lc88z$(255),lc91z$(8)
LOCAL lc90z$(1),lc100z%,lc98z$(255),lc99z%,lc89z$(255)
LOCAL lc96z$(255),lc95z%,lc94z%,lc93z%,lc97z%
lc88z$=CMD1$
lc89z$=CMD2$
lc90z$=CMD3$
IF LOC(lc89z$,".")=0
lc91z$=""
ELSE
lc91z$=RIGHT$(lc89z$,LEN(lc89z$)-LOC(lc89z$,".")+1)
ENDIF
IF ALIAS$=""
IF UPPER$(lc91z$)=".OPL"
lc92z$="OROPO*"
ELSEIF UPPER$(lc91z$)=".TXT"
lc92z$="$"
ELSEIF UPPER$(lc91z$)=".SCR"
lc92z$="SRSCO*"
ENDIF
ELSE lc92z$=ALIAS$
ENDIF
lc93z%=IOOPEN(lc94z%,lc88z$,1024)
lc95z%=ADDR(lc96z$)
IF lc93z%<0
RAISE lc93z%
ENDIF
lc93z%=IOREAD(lc94z%,lc95z%+1,255)
IF lc93z%<0
RAISE lc93z%
ENDIF
POKEB lc95z%,4
IF LEFT$(lc96z$,4)<>"OPLO"
lc97z%=-1
ENDIF
lc93z%=IOCLOSE(lc94z%)
IF lc93z%<0
RAISE lc93z%
ENDIF
IF lc97z%
lc88z$=lc88z$+CHR$(0)
lc98z$=lc90z$+CMD5$+CHR$(0)+lc91z$+" "+lc92z$+CHR$(0)+lc89z$+CHR$(0)
ELSE
lc98z$=lc90z$+CMD5$+CHR$(0)+lc91z$+CHR$(0)+lc89z$+CHR$(0)+lc88z$+CHR$(0)
lc88z$="ROM::SYS$PRGO.IMG"+CHR$(0)
ENDIF
lc99z%=CALL(391,ADDR(lc88z$)+1,ADDR(lc98z$),0,0,ADDR(lc100z%))
IF lc99z%<0
lc88z$=LEFT$(lc88z$,LEN(lc88z$)-1)
RETURN lc99z%
ELSE
CALL(1672,lc100z%)
ENDIF
ENDP
REM Rom Applications
REM ROM::WORD.APP Word
REM ROM::DATA.APP Data
REM ROM::WORLD.APP World
REM ROM::S3.APP Sheet
REM ROM::AGENDA.APP Agenda
REM ROM::TIME.APP Time
REM ROM::CALC.APP Calc
REM ROM::SPELL.APP Spell
REM ROM::PATIENCE.APP Patience
REM Alias meanings (advanced)
REM these are uses for WORD only
REM It is made up of a few chracters
REM The extensions TXT OPL and SCR are built in to the
REM proc so no alias is needed. If you want to open a file as an (TXT, OPL or SCR)
REM file which doesnt have the extension, you must use aliases, othereise is will be opened
REM as in Word, Not program
REM Examples:-
REM Text Editor = $
REM Program = OROPO*
REM Script = SRSCO*
REM
REM To run other translators Eg (opp)
REM OROPO*
REM O = the translator name eg SYS$PRGO.IMG
REM If you wanted to run Opp (SYS$PRGP.IMG) It would be P
REM R = if the translator can run files Put an R in for yes
REM Any other charcter for no
REM OPO =The directory where translated files are found eg OPO means \OPO\
REM * = If the translator can Translate S3 files
REM
REM Opp uses PROPO*
|
|