home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
pocketbk
/
utilsm
/
np52
/
RUN3CIS.ZIP
/
RUN3CIS.MCR
< prev
next >
Wrap
Text File
|
1995-06-26
|
4KB
|
129 lines
#define GeneralManager $008b
#define GenEnvBufferGet $2100
#define GenEnvBufferSet $2200
Proc Macro:
local d$(2),s$(2),changed%,var$(129),rname$(129)
rname$="m:\cis\config\readCIS.nam" /* Default .nam file */
d$=ff$:("\app\readcis\threecis.sco") /* Look for Threecis script */
if d$="" /* Script Not found */
error:
return
endif
s$=ff$:("\Cis\Switch\autoexec.on") /* Script found on s$ */
if s$=""
s$=ff$:("\Cis\Switch\autoexec.off")
if s$<>""
trap rename s$+"\Cis\Switch\autoexec.off",s$+"\Cis\Switch\autoexec.on"
else
trap mkdir "M:\Cis\Switch"
lopen "M:\cis\switch\autoexec.on" /* Make autoexec switch */
lclose /* We need this to run unattended */
endif
endif
var$=environ$:("C$N",1,"") /* Get current environment variable */
if loc(var$,"readcis.nam")=0 /* if it's not readcis.nam */
environ$:("C$N",2,rname$) /* Set it */
changed%=1
endif
launch:(d$+"\app\readcis\threecis.sco") /* Launch script */
pause 15*20 /* Important - wait for script to start */
if changed%
environ$:("C$N",2,var$) /* Change it back to what it was */
endif
Endp
PROC launch:(sco$)
local pid%
local cmdl$(128),appname$(128)
local ret%
if exist("LOC::c:\App\Fcomms.app") /* Check for 3fax first */
appname$="LOC::C:\APP\FCOMMS.APP"+chr$(0)
elseif exist("ROM::comms.app") /* Check ROM second */
appname$="ROM::COMMS.APP"+chr$(0)
elseif exist("LOC::c:\App\comms.app") /* Lastly check 3link */
appname$="LOC::C:\APP\COMMS.APP"+chr$(0)
else beep 5,450 :return
endif
cmdl$="OComms"+chr$(0)+".SCO "+chr$(0)+sco$+chr$(0)
ret%=call($0187,addr(appname$)+1,addr(cmdl$),0,0,addr(pid%))
if ret%<0
pid%=0
error:
else
call($0688,pid%,0,0,0,0)
endif
return pid%
ENDP
Proc FF$:(p$) /* Checks all drives for a file */
local dr$(3,2),l%
dr$(1)="M:" :dr$(2)="A:" :dr$(3)="B:"
onerr fe
l%=1
top::
do
if exist(dr$(l%)+p$)
return dr$(l%)
endif
l%=l%+1
until l%>3
return ""
fe::
l%=l%+1
if l%<4
goto top
endif
Endp
Proc environ$:(var$,mode%,new$) /* Get or Set Environment var */
/* mode 1 = Get, mode 2 = Set */
LOCAL ax%,bx%,cx%,dx%,si%,di% /* Set needs CL=Length of new name */
LOCAL flags%
LOCAL env$(8),penv%,lenenv%
LOCAL pbuff%,lenbuff%
Local name$(129)
env$ = var$
penv% = ADDR(env$) + 1
lenenv% = LEN(env$)
pbuff% = ADDR(name$)+1
if mode%=1
ax% = GenEnvBufferGet
elseif mode%=2
ax% = GenEnvBufferSet
name$=new$
cx%=len(name$) /* Set length of new name */
endif
bx% = 0
di% = penv%
dx% = lenenv%
si% = pbuff%
flags% = OS(GeneralManager,ADDR(ax%))
IF flags% AND 1
error:
return ""
ELSE
if mode%=1
lenbuff% = ax%
POKEB ADDR(name$),lenbuff%
endif
return name$
ENDIF
ENDP
Proc Error:
beep 10,450
Endp