home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lansystk.zip
/
MPTSUTIL
/
APPLETS
/
CASENG6.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-05-08
|
37KB
|
1,267 lines
/* Stripped by STRIPRX.EXE */
parse arg cmdline
glob.0logfile = "caseng6.log"
CALL LINEOUT glob.0logfile,"CASENG6 invoked at" TIME() "on" DATE()
CALL LINEOUT glob.0logfile,cmdline
OPTIONS "ETMODE"
CALL LoadRexxUtil
YES = 0
NO = 1
CALL init
PARSE VAR cmdline parm1 .
IF parm1 = "/?" | parm1 = "-?" THEN SIGNAL help
irc = ParseCmdLine(cmdline)
IF irc = YES THEN
DO
CALL ReadParmFile glob.ParmFile
irc = ReadDatabase(glob.database)
IF irc = YES THEN
DO
CALL BuildAliasTable
irc = ParseList(glob.listfile)
IF irc = YES THEN
DO
irc = BuildPrepFile()
IF glob.MayBeProblems <> 0 THEN
CALL msgbox GetMsg(glob.0msg.PROBLEMS_TEXT),GetMsg(glob.0msg.PROBLEMS_TITLE),"OK","WARNING"
END
END
END
SIGNAL CommonExit
init:
E1MsgBase = 131
E3MsgBase = 151
E6MsgBase = 200
glob.0msg.CANCEL_TEXT = E1MsgBase + 13
glob.0msg.CANCEL_TITLE = E1MsgBase + 14
glob.0msg.MISSINGLIST_TEXT = E6MsgBase + 0
glob.0msg.MISSINGLIST_TITLE = E6MsgBase + 1
glob.0msg.BADLISTELEM_TEXT = E6MsgBase + 2
glob.0msg.NOLISTELEM_TITLE = E6MsgBase + 3
glob.0msg.NOLISTELEM_TEXT = E6MsgBase + 4
glob.0msg.COMMENT_TITLE = E6MsgBase + 5
glob.0msg.COMMENT_GEN = E6MsgBase + 6
glob.0msg.COMMENT_TIME = E6MsgBase + 7
glob.0msg.COMMENT_PARMS = E6MsgBase + 8
glob.0msg.COMMENT_APPLIST = E6MsgBase + 9
glob.0msg.COMMENT_CONTENTS = E6MsgBase + 10
glob.0msg.TOOMANYOS_TEXT = E6MsgBase + 11
glob.0msg.TOOMANYOS_TITLE = E6MsgBase + 12
glob.0msg.TOOMANYFIXES_TEXT = E6MsgBase + 13
glob.0msg.CLProblem_TEXT = E6MsgBase + 14
glob.0msg.CLProblem_TITLE = E6MsgBase + 15
glob.0msg.Help_Text = E6MsgBase + 16
glob.0msg.Help_Title = E6MsgBase + 17
glob.0msg.DriveNotReady_Text = E6MsgBase + 18
glob.0msg.DriveNotReady_Title = E6MsgBase + 19
glob.0msg.NO_INSTCMD_Text = E6MsgBase + 20
glob.0msg.DISKFULL_Text = E6MsgBase + 21
glob.0msg.DISKIOERROR_Text = E6MsgBase + 22
glob.0msg.DISKIOERROR_Title = E6MsgBase + 23
glob.0msg.NO_MSCMD_Text = E6MsgBase + 24
glob.0msg.OSFIXMISMATCH_Title = E6MsgBase + 25
glob.0msg.OSFIXMISMATCH_Text = E6MsgBase + 26
glob.0msg.PROBLEMS_Text = E6MsgBase + 27
glob.0msg.PROBLEMS_Title = E6MsgBase + 28
glob.0msg.NOOSINSTALLED_Text = E6MsgBase + 29
glob.ThisProgName = "CASSETUP"
glob.ThisProgVer = "2.0"
glob.Popup_Environment = "cmsgbox"
glob.MsgFileName = "cassetup.msg"
glob.0vars.DefaultHomeDrive = "X:"
glob.0vars.Drives = "XYZSTUVW"
glob.0vars.DefaultBootDrive = "C:"
glob.0vars.DefaultMaintDrive = "C:"
glob.0vars.DefaultMaintDir = "service"
glob.0rc.MB_OK = 1
glob.0rc.MB_CANCEL = 2
glob.0rc.MB_ABORT = 3
glob.0rc.MB_RETRY = 4
glob.0rc.MB_IGNORE = 5
glob.0rc.MB_YES = 6
glob.0rc.MB_NO = 7
glob.0rc.MB_ENTER = 8
glob.0cmdline = cmdline
glob.MayBeProblems = 0
RETURN
ParseCmdLine: PROCEDURE EXPOSE glob. YES NO
PARSE ARG cmdline
glob.listfile = ""
glob.target = ""
glob.database = ""
glob.parmfile = ""
DO WHILE cmdline <> ""
PARSE VAR cmdline ThisOne cmdline
PARSE VALUE STRIP(ThisOne,'b') WITH tag"="value
tag = TRANSLATE(STRIP(tag,'b'))
value = STRIP(value)
SELECT
WHEN tag = "/T" THEN glob.target = value
WHEN tag = "/P" THEN glob.listfile = value
WHEN tag = "/D" THEN glob.database = value
WHEN tag = "/R" then glob.parmfile = value
OTHERWISE nop
END
END
BadParm = "/P"
IF glob.listfile = "" THEN
DO
BadValue = "No Value"
SIGNAL BadCL
END
ELSE
IF STREAM(glob.listfile,'C','QUERY EXISTS') = "" THEN
DO
BadValue = glob.listfile
SIGNAL BadCL
END
IF glob.target = "" THEN
glob.target = "stdout"
BadParm = "/D"
IF glob.database = "" THEN
DO
BadValue = "No Value"
SIGNAL BadCL
END
ELSE
IF STREAM(glob.database,'C','QUERY EXISTS') = "" THEN
DO
BadValue = glob.database
SIGNAL BadCL
END
BadParm = "/R"
IF glob.parmfile <> "" THEN
IF STREAM(glob.parmfile,'C','QUERY EXISTS') = "" THEN
DO
BadValue = glob.parmfile
SIGNAL BadCL
END
RETURN YES
ReadDatabase: PROCEDURE EXPOSE glob. YES NO
parse arg dbfile
appno = 0
aliasno = 0
glob.servername = ""
glob.SERVERPATH = ""
glob.SRVIFSFLAG = 0
glob.cmdpath = ""
glob.lcupath = ""
glob.lcualias = ""
glob.lcualias.0drive = ""
glob.logalias = ""
glob.logalias.0drive = ""
glob.exealias = ""
glob.exealias.0drive = ""
glob.dllalias = ""
glob.dllalias.0drive = ""
glob.cmdalias = ""
glob.cmdalias.0drive = ""
glob.rspalias = ""
glob.rspalias.0drive = ""
state = STARTING
DO WHILE LINES(dbfile) > 0 & state <> DONE
line = STRIP(LINEIN(dbfile),'b')
if left(line,1) = "*" | line = "" then
iterate
parse var line key"="val
key = strip(key,"b")
val = strip(val,"b")
parse upper var key key
SELECT
WHEN state = STARTING THEN
DO
SELECT
WHEN key = "SERVER." THEN state = IN_SERVER
OTHERWISE nop
END
END
WHEN state = IN_SERVER THEN
DO
SELECT
WHEN key = "SRVIFS." THEN state = IN_SRVIFS
WHEN key = "SRVAPP." THEN
DO
appno = appno + 1
glob.0app.appno.verified = NO
glob.0app.appno.appname = ""
glob.0app.appno.appnick = ""
glob.0app.appno.profile = ""
glob.0app.appno.images = ""
glob.0app.appno.work = ""
glob.0app.appno.dll = ""
glob.0app.appno.log = ""
glob.0app.appno.resp = ""
glob.0app.appno.imgalias = ""
glob.0app.appno.progtype = ""
glob.0app.appno.imgalias.0drive = ""
glob.0app.appno.package = 1
glob.0app.appno.fixto = ""
glob.0app.appno.maintsysreq = 0
state = IN_APP
END
WHEN key = "ALIAS." THEN
DO
aliasno = aliasno + 1
glob.0alias.aliasno.aliasname = ""
glob.0alias.aliasno.aliaspath = ""
glob.0alias.aliasno.aliasdrive = ""
state = "IN_ALIAS"
END
WHEN key = "SRVNAME" THEN
glob.ServerName = val
WHEN key = "ENDSERVER." THEN
state = DONE
OTHERWISE nop
END
END
WHEN state = IN_APP THEN
DO
SELECT
WHEN key = "APPNAME" THEN glob.0app.appno.appname = val
WHEN key = "APPNICK" THEN glob.0app.appno.appnick = TRANSLATE(val)
WHEN key = "APPDIR" THEN glob.0app.appno.images = val
WHEN key = "APPWRKDIR" THEN glob.0app.appno.work = val
WHEN key = "APPPRO" THEN glob.0app.appno.profile = val
WHEN key = "APPDLLDIR" THEN glob.0app.appno.dll = val
WHEN key = "APPLOGDIR" THEN glob.0app.appno.log = val
WHEN key = "APPRSPDIR" THEN glob.0app.appno.resp = val
WHEN key = "APPALIAS" THEN glob.0app.appno.imgalias = val
WHEN key = "APPPROGTYPE" THEN glob.0app.appno.progtype = val
WHEN key = "APPFIXTO" THEN glob.0app.appno.fixto = val
WHEN key = "APPPACKAGE" THEN glob.0app.appno.package = val
WHEN key = "APPMAINTSYS" THEN glob.0app.appno.maintsysreq = val
WHEN key = "ENDSRVAPP." THEN
DO
state = IN_SERVER
IF glob.0app.appno.dll = "" THEN
glob.0app.appno.dll = glob.0app.appno.work
END
OTHERWISE nop
END
END
WHEN state = IN_ALIAS THEN
DO
SELECT
WHEN key = "ALIASNAME" THEN glob.0alias.aliasno.aliasname = TRANSLATE(val)
WHEN key = "ALIASPATH" THEN glob.0alias.aliasno.aliaspath = TRANSLATE(val)
WHEN key = "ALIASDRIVE" THEN glob.0alias.aliasno.aliasdrive = TRANSLATE(val)
WHEN key = "ENDALIAS." THEN state = "IN_SERVER"
OTHERWISE nop
END
END
WHEN state = IN_SRVIFS THEN
DO
SELECT
WHEN key = "ENDSRVIFS." THEN state = IN_SERVER
WHEN key = "SERVERPATH" THEN glob.SERVERPATH = val
WHEN key = "SRVIFSFLAG" THEN glob.SRVIFSFLAG = val
WHEN key = "CMDDIR" THEN glob.cmdpath = val
WHEN key = "LCUPATH" THEN glob.lcupath = val
WHEN key = "LCUALIAS" THEN glob.lcualias = val
WHEN key = "LOGALIAS" THEN glob.logalias = val
WHEN key = "WRKALIAS" THEN glob.wrkalias = val
WHEN key = "DLLALIAS" THEN glob.dllalias = val
WHEN key = "RSPALIAS" THEN glob.rspalias = val
WHEN key = "CMDALIAS" THEN glob.cmdalias = val
OTHERWISE nop
END
END
END
END
glob.0app.0 = appno
glob.0alias.0 = aliasno
CALL STREAM dbfile,'c','CLOSE'
IF glob.SRVIFSFLAG <> 1 THEN
DO
CALL msgbox GetMsg(glob.0msg.BADLISTELEM_TEXT,"SRVIFS"),GetMsg(glob.0msg.NOLISTELEM_TITLE),"OK","ERROR"
RETURN NO
END
RETURN YES
BuildAliasTable: PROCEDURE EXPOSE glob. YES NO
IF glob.lcualias = "" THEN CALL LINEOUT glob.0logfile,"Error no lcu alias"
IF glob.logalias = "" THEN CALL LINEOUT glob.0logfile,"Error no log alias"
IF glob.wrkalias = "" THEN CALL LINEOUT glob.0logfile,"Error no work alias"
IF glob.dllalias = "" THEN CALL LINEOUT glob.0logfile,"Error no DLL alias"
IF glob.rspalias = "" THEN CALL LINEOUT glob.0logfile,"Error no response file alias"
IF glob.cmdalias = "" THEN CALL LINEOUT glob.0logfile,"Error no command alias"
DO i = 1 to glob.0app.0
IF glob.0app.i.IMGALIAS = "" THEN
CALL LINEOUT glob.0logfile,"Error no application image alias"
END
glob.0UniqAlias.0 = 0
glob.lcualias.0drive = AddAlias(glob.lcualias)
glob.logalias.0drive = AddAlias(glob.logalias)
glob.wrkalias.0drive = AddAlias(glob.wrkalias)
glob.dllalias.0drive = AddAlias(glob.dllalias)
glob.rspalias.0drive = AddAlias(glob.rspalias)
glob.cmdalias.0drive = AddAlias(glob.cmdalias)
DO i = 1 to glob.0app.0
IF glob.0app.i.imgalias <> "" THEN
glob.0app.i.imgalias.0drive = AddAlias(glob.0app.i.imgalias)
END
glob.ThinString = TheAliasThatHas(glob.lcualias.0drive)
IF glob.dllalias.0drive <> glob.lcualias.0drive THEN
glob.ThinString = Glob.ThinString" "TheAliasThatHas(glob.dllalias.0drive)
IF glob.logalias.0drive <> glob.lcualias.0drive & glob.logalias.0drive <> glob.dllalias.0drive THEN
glob.ThinString = glob.ThinString" "TheAliasThatHas(glob.logalias.0drive)
IF glob.cmdalias.0drive <> glob.lcualias.0drive & glob.cmdalias.0drive <> glob.dllalias.0drive & glob.cmdalias.0drive <> glob.logalias.0drive THEN
glob.ThinString = glob.ThinString" "TheAliasThatHas(glob.cmdalias.0drive)
RETURN
AddAlias: PROCEDURE EXPOSE glob. YES NO
parse arg alias
alias = TRANSLATE(alias)
DO i = 1 to glob.0UniqAlias.0
IF glob.0UniqAlias.i = alias THEN
RETURN glob.0UniqAlias.i.0Drive
END
i = FindAliasIndex(alias)
IF i =0 THEN
RETURN SUBSTR(glob.0vars.Drives,1,1)
DO k = 1 to glob.0UniqAlias.0
j = glob.0UniqAlias.0index
IF glob.0alias.j.aliaspath = glob.0alias.i.aliaspath & glob.0alias.j.aliasro = glob.0alias.i.aliasro THEN
RETURN glob.0UniqAlias.k.0drive
END
glob.0UniqAlias.0 = k
glob.0UniqAlias.k = alias
glob.0UniqAlias.k.0index = i
glob.0UniqAlias.k.0drive = SUBSTR(glob.0vars.Drives,k,1)
RETURN glob.0UniqAlias.k.0Drive
FindAliasIndex: PROCEDURE EXPOSE glob. YES NO
parse arg alias
alias = TRANSLATE(alias)
DO i = 1 to glob.0alias.0
IF glob.0alias.i.aliasname = alias THEN RETURN i
END
RETURN 0
TheAliasThatHas: PROCEDURE EXPOSE glob. YES NO
parse arg drive
DO i = 1 to glob.0UniqAlias.0
IF glob.0UniqAlias.i.0Drive = drive THEN LEAVE
END
IF i > glob.0UniqAlias.0 THEN
do
CALL LINEOUT glob.0logfile,"Error no uniq alias found"
RETURN glob.0UniqAlias.1
end
ELSE
RETURN glob.0UniqAlias.i
ParseList: PROCEDURE EXPOSE glob. YES NO
parse arg filename
glob.TheOS = 0
glob.TheOSFix = 0
glob.TheTransport = 0
glob.TheTransportFix = 0
glob.MaintSysReq = 0
glob.TheOSWillBeInstalled = 0
glob.TheOSFixWillBeInstalled = 0
glob.TheTransportWillBeInstalled = 0
glob.OnlyAppsWillBeInstalled = 1
glob.0list.0 = 0
DO WHILE LINES(filename) > 0
line = STRIP(LINEIN(filename),'b')
IF line = "" | LEFT(line,1) = "*" THEN ITERATE
PARSE VAR line lappname','target_override
IF VerifyListElement(STRIP(lappname,'b'),YES) = NO THEN
RETURN NO
i = glob.0list.0
glob.0list.i.tgt = STRIP(target_override,'b')
END
glob.NumAppsSelected = glob.0list.0
IF glob.NumAppsSelected = 0 THEN
DO
CALL msgbox GetMsg(glob.0msg.NOLISTELEM_TEXT),GetMsg(glob.0msg.NOLISTELEM_TITLE),"OK","ERROR"
RETURN NO
END
CALL STREAM filename,'c','close'
IF glob.TheOS = 0 & glob.TheOSFix = 0 THEN
DO
IF glob.0parm.LvlOfOS = "" THEN
DO
glob.0parm.LvlOfOS = ""
DO i = 1 to glob.0app.0
IF glob.0app.i.PROGTYPE = 1 & glob.0app.i.PACKAGE = 1 THEN
glob.0parm.LvlOFOS = glob.0app.i.APPNICK
END
IF glob.0parm.LvlOfOS = "" & glob.MaintSysReq = 1 THEN
glob.0parm.LvlOfOS = "OS/2"
END
IF glob.0parm.LvlOfOS <> "" THEN
IF VerifyListElement(glob.0parm.LvlOfOS,NO) = NO THEN
RETURN NO
i = glob.0list.0
glob.0list.i.tgt = ""
END
ELSE
IF glob.TheOS = 0 & glob.TheOSFix <> 0 THEN
DO
i = glob.TheOSFix
j = glob.0list.i.DBindex
IF VerifyListElement(glob.0app.j.FIXTO,NO) THEN
RETURN NO
i = glob.0list.0
glob.0list.i.tgt = ""
END
ELSE
IF glob.TheOS <> 0 & glob.TheOSFix <> 0 THEN
DO
i = glob.TheOS
j = glob.TheOSFix
ix = glob.0list.i.DBindex
jx = glob.0list.j.DBindex
IF TRANSLATE(glob.0app.jx.FIXTO) <> TRANSLATE(glob.0app.ix.appnick) THEN
DO
CALL MsgBox GetMsg(glob.0msg.OSFIXMISMATCH_Text),GetMsg(glob.0msg.OSFIXMISMATCH_Title),"OK","ERROR"
RETURN NO
END
END
IF glob.MaintSysReq = 0 THEN
RETURN YES
IF glob.TheTransport = 0 THEN
DO
DO i = 1 to glob.0app.0
IF glob.0app.i.PROGTYPE = 2 THEN LEAVE
END
IF i <= glob.0app.0 THEN
DO
CALL VerifyListElement glob.0app.i.appnick,NO
i = glob.0list.0
glob.0list.i.tgt = ""
END
ELSE
IF glob.MaintSysReq = 1 THEN
DO
CALL msgbox GetMsg(glob.0msg.BADLISTELEM_TEXT,"MPTS"),GetMsg(glob.0msg.NOLISTELEM_TITLE),"OK","ERROR"
RETURN NO
END
END
RETURN YES
ReadParmFile: PROCEDURE EXPOSE glob. YES NO
parse arg TheParmfile
glob.0parm.BootD = "Y"
glob.0parm.BootDrive = glob.0vars.DefaultBootDrive
glob.0parm.MaintDrive = glob.0vars.DefaultMaintDrive
glob.0parm.LvlOfOS = ""
glob.0parm.oslofos = ""
glob.0parm.FixLvl = ""
glob.MaintDrive = glob.0parm.MaintDrive
IF TheParmfile = "" THEN RETURN
parmlist = "BOOTD BOOTDRIVE MAINTDRIVE OSLOFOS FIXLVL"
DO WHILE LINES(TheParmfile) > 0
line = STRIP(linein(TheParmfile),'b')
PARSE var line key"="val
key = TRANSLATE(STRIP(key,'b'))
IF WORDPOS(key, parmlist) > 0 THEN
glob.0parm.key = STRIP(val,'b')
END
CALL STREAM TheParmfile,'c','close'
glob.0parm.LvlOfOs = glob.0parm.oslofos
glob.MaintDrive = LEFT(glob.0parm.MaintDrive,1)":"
RETURN
VerifyListElement: PROCEDURE EXPOSE glob. YES NO
parse arg lappname,installable
lappname = STRIP(lappname,'b')
j = AppIndexInDatabase(lappname)
IF j = 0 THEN
DO
CALL msgbox GetMsg(glob.0msg.BADLISTELEM_TEXT,lappname),GetMsg(glob.0msg.NOLISTELEM_TITLE),"OK","ERROR"
RETURN NO
END
i = glob.0list.0 + 1
glob.0list.i = lappname
glob.0list.i.DBIndex = j
glob.0list.0 = i
irc = ReadProfile(glob.0app.j.profile,i)
IF irc <> YES THEN LEAVE
type = glob.0APP.j.PROGTYPE
IF type <> 4 & installable = YES THEN
glob.OnlyAppsWillBeInstalled = 0
IF type = 1 THEN
DO
IF glob.0APP.j.PACKAGE = 1 THEN
DO
IF glob.TheOS <> 0 THEN
DO
msgno = glob.0msg.TOOMANYOS_TEXT
ix = glob.TheOS
parm1 = glob.0list.ix
msg = GetMsg(msgno,parm1,glob.0list.i)
title = GetMsg(glob.0msg.TOOMANYOS_TITLE)
CALL MsgBox msg,title,"OK","ERROR"
RETURN NO
END
ELSE
DO
glob.TheOS = i
IF installable = YES THEN
glob.TheOSWillBeInstalled = 1
END
END
ELSE
DO
IF glob.TheOSFix <> 0 THEN
DO
ix = glob.TheOSFix
msg = GetMsg(glob.0msg.TOOMANYFIXES_TEXT,glob.0list.ix,glob.0list.i)
title = GetMsg(glob.0msg.TOOMANYOS_TITLE)
CALL MsgBox msg,title,"OK","ERROR"
END
ELSE
DO
glob.TheOSFix = i
IF installable = YES THEN
glob.TheOSFixWillBeInstalled = 1
END
END
END
j = glob.0LIST.i.DBindex
IF type = 2 THEN
IF glob.0APP.j.PACKAGE = 1 THEN
IF glob.TheTransport <> 0 THEN
DO
msgno = glob.0msg.TOOMANYTRANSPORTS_TEXT
ix = glob.TheTransport
parm1 = glob.0list.ix
msg = GetMsg(msgno,parm1,glob.0list,i)
title = GetMsg(glob.0msg.TOOMANYOS_TITLE)
CALL MsgBox msg,title,"OK","ERROR"
RETURN NO
END
ELSE
DO
glob.TheTransport = i
IF installable = YES THEN
glob.TheTransportWillBeInstalled = 1
END
ELSE
IF glob.TheTransportFix <> 0 THEN
DO
ix = glob.TheTransportFix
msg = GetMsg(glob.0msg.TOOMANYFIXES_TEXT,glob.0list.ix,glob.0list.i)
title = GetMsg(glob.0msg.TOOMANYOS_TITLE)
CALL MsgBox,msg,title,"OK","ERROR"
END
ELSE
glob.TheTransportFix = i
j = glob.0LIST.i.DBindex
IF installable = YES THEN
IF glob.0APP.j.MAINTSYSREQ = 1 THEN
glob.MAINTSYSREQ = 1
RETURN YES
ReadProfile: PROCEDURE EXPOSE glob. YES
parse arg profname,appindex
findlist = "APPNAME APPNICK PACKAGE FIXTO PROGTYPE INSTCMD INSTCMDM MAINTSYSREQ MAINTSYSBUILD DEFRESPFILE"
glob.0list.appindex.APPNAME = ""
glob.0list.appindex.APPNICK = ""
glob.0list.appindex.PACKAGE = 1
glob.0list.appindex.FIXTO = ""
glob.0list.appindex.PROGTYPE = 4
glob.0list.appindex.INSTCMD = ""
glob.0list.appindex.INSTCMDM = ""
glob.0list.appindex.MAINTSYSREQ = 0
glob.0list.appindex.MAINTSYSBUILD = ""
glob.0list.appindex.DEFRESPFILE = ""
glob.0list.appindex.MSCMD.0 = 0
DO WHILE LINES(profname) > 0
line = STRIP(linein(profname),'b')
PARSE var line key"="val
key = TRANSLATE(STRIP(key,'b'))
IF WORDPOS(key, findlist) > 0 | LEFT(key,6) = "MSCMD." THEN
glob.0list.appindex.key = STRIP(val,'b')
END
CALL STREAM profname,'c','close'
IF glob.0list.appindex.INSTCMD = "" THEN
DO
glob.0list.appindex.INSTCMD = GetMsg(glob.0msg.NO_INSTCMD_Text)
glob.MayBeProblems = 1
END
DO i = 1 to glob.0list.appindex.MSCMD.0
IF glob.0list.appindex.MSCMD.i = "" | glob.0list.appindex.MSCMD.i = "GLOB.0LIST."appindex".MSCMD."i THEN
DO
glob.0list.appindex.MSCMD.i = GetMsg(glob.0msg.NO_MSCMD_TEXT,"MSCMD."i)
glob.MayBeProblems = 1
END
END
RETURN YES
BuildPrepFile: PROCEDURE EXPOSE glob. YES NO
irc = CheckAvailabilityOfTarget(glob.target)
IF irc = YES THEN
IF glob.target <> "stdout" THEN
IF STREAM(glob.target,'c','query exists') <> "" THEN
CALL SysFileDelete(glob.target)
IF irc = YES THEN
irc = BuildComments()
IF irc = YES THEN
irc = BuildVars()
IF irc = YES THEN
irc = BuildSrvAttch()
IF irc = YES THEN
irc = BuildProg()
IF irc = YES THEN
irc = BuildUtility()
IF irc = YES THEN
irc = BuildInstall()
CALL STREAM glob.target,'c','close'
RETURN irc
CheckAvailabilityOfTarget: PROCEDURE EXPOSE glob. YES NO
parse arg tgt
IF tgt = "stdout" THEN RETURN YES
IF SUBSTR(tgt,2,1) <> ":" THEN
drive = LEFT(DIRECTORY(),1)
ELSE
drive = LEFT(tgt,1)
driveinfo = SysDriveInfo(drive)
DO WHILE driveinfo = ""
brc = msgbox(GetMsg(glob.0msg.DriveNotReady_Text,drive),GetMsg(glob.0msg.DriveNotReady_Title),"WARNING","OKCANCEL")
IF circ = glob.0rc.MB_CANCEL THEN
RETURN NO
driveinfo = SysDriveInfo(drive)
END
RETURN YES
BuildComments: PROCEDURE EXPOSE glob. YES NO
rm = 69
o = glob.target
cline.1 = GetMsg(glob.0msg.COMMENT_TITLE)
cline.2 = GetMsg(glob.0msg.COMMENT_GEN,glob.ThisProgName,glob.ThisProgVer)
cline.3 = " "GetMsg(glob.0msg.COMMENT_TIME,TIME(),DATE())
cline.4 = " "
cline.5 = GetMsg(glob.0msg.COMMENT_PARMS,"CASENG6")
cline.0 = 5
cmdline = glob.0cmdline
DO WHILE cmdline <> ""
PARSE VAR cmdline ThisParm cmdline
i = cline.0 + 1
cline.i = ThisParm
cline.0 = i
END
i = cline.0 + 1
cline.i = " "
i = i + 1
cline.i = GetMsg(glob.0msg.COMMENT_APPLIST,glob.listfile)
i = i + 1
cline.i = GetMsg(glob.0msg.COMMENT_CONTENTS)
cline.0 = i
DO WHILE LINES(glob.listfile) > 0
i = cline.0 + 1
cline.i = LINEIN(glob.listfile)
cline.0 = i
END
CALL STREAM glob.listfile,'c','close'
DO i = 1 to cline.0
CALL E6LnOut o,OVERLAY("*/","/* "cline.i" ",MAX(rm, LENGTH(cline.i)+4))
END
CALL E6LnOut o," "
RETURN YES
BuildVars: PROCEDURE EXPOSE glob. YES NO
rm = 50
o = glob.target
CALL E6LnOut o," "
CALL E6LnOut o,":vars"
line = "homedrive = "glob.0vars.DefaultHomeDrive
comment = "THINIFS /D parameter"
CALL E6LnOut o,FmtLine(line,comment)
DO i = 1 to glob.0UniqAlias.0
line = "d"i "= "glob.0UniqAlias.i.0Drive":"
comment = "Drive for alias" glob.0UniqAlias.i
CALL E6LnOut o,FmtLine(line, comment)
END
line = "bootdrive = "STRIP(glob.0parm.BootDrive,'t',":")":"
comment = "boot drive"
CALL E6LnOut o,FmtLine(line,comment)
line = "maintdrive = "glob.MaintDrive
comment = "Maintenance Sys Drive"
CALL E6LnOut o,FmtLine(line,comment)
line = 'maint_dir = "maintdrive"\'glob.0vars.DefaultMaintDir
comment = "Maintenance Sys Dir"
CALL E6LnOut o,FmtLine(line,comment)
line = "srvifs_server1 ="glob.ServerName
comment = "SRVIFS server name"
CALL E6LnOut o,FmtLine(line,comment)
i = glob.TheOS
j = glob.0list.i.DBIndex
IF glob.0app.j.work = "GLOB.0APP."j".WORK" THEN
line = "exepath = "GetMsg(glob.0msg.NOOSINSTALLED_Text)
ELSE
line = "exepath = "bldpath(glob.wrkalias.0drive":",glob.0app.j.work)
comment = "SETBOOT path"
CALL E6LnOut o,FmtLine(line,comment)
line = "lcupath = "bldpath(glob.lcualias.0drive":",glob.lcupath"\img\lcu")
comment = "access to LCU commands"
CALL E6LnOut o,FmtLine(line,comment)
line = "srvifspath = "bldpath(glob.lcualias.0drive":",glob.lcupath"\img\srvifs")
comment = "access to SRVIFS commands"
CALL E6LnOut o,FmtLine(line,comment)
line = "cmdpath = "bldpath(glob.CMDALIAS.0drive":",glob.cmdpath)
comment = "path to this command file"
CALL E6LnOut o,FmtLine(line,comment)
IF glob.TheOS = 0 THEN
line = "rexxpath = "bldpath(glob.lcualias.0drive":","dll")
ELSE
DO
i = glob.TheOS
j = glob.0list.i.DBIndex
IF glob.0app.j.dll = "GLOB.0APP."j".DLL" THEN
line = "rexxpath = "GetMsg(glob.0msg.NOOSINSTALLED_Text)
ELSE
line = "rexxpath = "bldpath(glob.DLLALIAS.0drive":",glob.0app.j.dll)
END
comment = "where REXX DLLs are"
CALL E6LnOut o,FmtLine(line,comment)
line = 'ifsdir = "bootdrive"\srvifsrq'
comment = "where SRVIFS will be installed"
CALL E6LnOut o,FmtLine(line,comment)
DO i = 1 to glob.0list.0
j = glob.0list.i.DBIndex
CALL E6LnOut o," "
line = glob.0app.j.appnick"_images = "
line = line || bldpath(glob.0app.j.imgalias.0drive":",glob.0app.j.images)
comment = "image directory for "glob.0app.j.appnick
CALL E6LnOut o,FmtLine(line,comment)
line = glob.0app.j.appnick"_exepath = "
line = line || bldpath(glob.wrkalias.0drive":",glob.0app.j.work)
comment = "exe dir for "glob.0app.j.appnick
CALL E6LnOut o,FmtLine(line,comment)
line = glob.0app.j.appnick"_logpath = "
line = line || bldpath(glob.logalias.0drive":",glob.0app.j.log)
comment = "log dir for "glob.0app.j.appnick
CALL E6LnOut o,FmtLine(line,comment)
line = glob.0app.j.appnick"_rsppath = "
line = line || bldpath(glob.rspalias.0drive":",glob.0app.j.resp)
comment = "resp file dir for "glob.0app.j.appnick
CALL E6LnOut o,FmtLine(line,comment)
line = glob.0app.j.appnick"_dllpath = "
line = line || bldpath(glob.dllalias.0drive":",glob.0app.j.dll)
comment = "dll dir for "glob.0app.j.appnick
CALL E6LnOut o,FmtLine(line,comment)
line = ""
IF glob.0list.i.tgt <> "" THEN
line = glob.0app.j.appnick"_target = "glob.0list.i.tgt
IF line <> "" THEN
DO
comment = "install target override"
CALL E6LnOut o,FmtLine(line,comment)
END
END
CALL E6LnOut o,":endvars"
RETURN 0
FmtLine: PROCEDURE
parse arg ln,cmt
RETURN OVERLAY("/* "cmt "*/",ln,MAX(50,LENGTH(ln) + 2))
BuildSrvAttch: PROCEDURE EXPOSE glob. YES NO srvifs_server1
IF glob.0alias.0 = 0 THEN RETURN YES
o =glob.target
CALL E6LnOut o," "
CALL E6LnOut o,"/* SRVATTACHES */"
CALL E6LnOut o,":srvattch"
DO i = 1 to glob.0UniqAlias.0
IF WORDPOS(glob.0UniqAlias.i,glob.ThinString) = 0 THEN
CALL E6LnOut o,'"d'i'" \\"srvifs_server1"\'||glob.0UniqAlias.i
END
CALL E6LnOut o,":endsrvattch"
RETURN YES
BuildProg: PROCEDURE EXPOSE glob. YES NO
o = glob.target
CALL E6LnOut o," "
DO i = 1 to glob.NumAppsSelected
CALL MakeProg i
END
IF glob.MaintSysReq = 1 THEN
DO
IF glob.TheOSFix <> 0 THEN
CALL MakeMSProg glob.TheOSFix
IF glob.TheOSWillBeInstalled THEN
IF glob.TheTransportWillBeInstalled = 0 THEN
CALL MakeProg glob.TheTransport
IF glob.TheTransportFix <> 0 THEN
CALL MakeMSProg glob.TheTransportFix
END
RETURN YES
BuildUtility: PROCEDURE EXPOSE glob. YES NO
CALL E6LnOut glob.target," "
IF glob.MaintSysReq THEN
DO
CALL MakeMSUtil glob.TheOS
CALL MakeMSUtil glob.TheTransport
END
CALL MakeLCUUtil
CALL MakeSRVIFSUtil
RETURN YES
BuildInstall: PROCEDURE EXPOSE glob. YES NO
o = glob.target
CALL E6LnOut o," "
CALL E6LnOut o,":install keywords"
IF glob.TheOSWillBeInstalled THEN
DO
i = glob.TheOS
j = glob.0LIST.i.DBIndex
IF glob.0APP.j.MAINTSYSREQ = 1 THEN
CALL MakeSEMAINTInstall
CALL MakeSEINSTInstall
END
IF glob.TheOSFixWillBeInstalled THEN
DO
i = glob.TheOSFix
j = glob.0LIST.i.DBIndex
IF glob.0APP.j.MAINTSYSREQ = 1 THEN
CALL MakeSEMAINTInstall
CALL E6LnOut o,glob.0list.i
END
IF glob.TheTransportWillBeInstalled & glob.TheOSWillBeInstalled = 0 THEN
DO
i = glob.TheTransport
j = glob.0LIST.i.DBIndex
IF glob.0APP.j.MAINTSYSREQ = 1 THEN
CALL MakeSEMAINTInstall
CALL MakeTransportInstall
END
CALL MakeAppInstalls
CALL MakeFixInstalls
CALL E6LnOut o,"ifsdel+casdelet"
CALL E6LnOut o,":endinstall"
RETURN YES
MakeAppInstalls: PROCEDURE EXPOSE glob. YES NO
o = glob.target
list = ""
DO i = 1 to glob.0list.0
j = glob.0LIST.i.DBIndex
IF glob.0APP.j.PROGTYPE = 4 & glob.0APP.j.PACKAGE = 1 THEN
list = list||j" "
END
IF list <> "" & glob.OnlyAppsWillBeInstalled THEN
DO
CALL E6LnOut o,"userline=if BootDriveIsFixedDisk() == YES then iterate"
line = "+"
line = AddLCUToLine(line)
CALL E6LnOut o,line
END
DO WHILE list <> ""
PARSE VAR list ThisItem list
ThisItem = STRIP(ThisItem,'b')
IF glob.0APP.ThisItem.MaintSysReq = 1 THEN
CALL MakeSEMAINTInstall
CALL E6LnOut o,glob.0APP.ThisItem.APPNICK
END
RETURN
MakeSEMAINTInstall: PROCEDURE EXPOSE glob. YES NO
o = glob.target
line = ""
line = AddMSToLine(line,glob.TheOS)
line = AddMSToLine(line,glob.TheOSFix)
line = AddMSToLIne(line,glob.TheTransport)
line = AddMSToLine(line,TheTransportFix)
line = AddLCUtoLine(line)
CALL E6LnOut o,line
RETURN
MakeSEINSTinstall: PROCEDURE EXPOSE YES NO glob.
o = glob.target
i = glob.TheOS
j = glob.TheTransport
ix = glob.0LIST.i.DBindex
jx = glob.0LIST.j.DBindex
line = glob.0APP.ix.APPNICK
line = line"+"glob.0APP.jx.APPNICK"_maint"
line = AddLCUtoLine(line)
CALL E6LnOut o,line
RETURN
MakeFixInstalls: PROCEDURE EXPOSE glob. YES NO
o = glob.target
mlist = ""
nmlist = ""
DO i = 1 to glob.0list.0
DO
j = glob.0list.i.DBindex
IF glob.0app.j.PACKAGE = 2 & glob.0app.j.PROGTYPE <> 1 THEN
IF glob.0APP.j.MAINTSYSREQ = 1 THEN
mlist = mlist || glob.0app.j.appnick" "
ELSE
nmlist = nmlist || glob.0app.j.appnick" "
END
END
IF mlist <> "" THEN
DO
CALL MakeSEMAINTInstall
line = ""
DO WHILE mlist <> ""
PARSE VAR mlist ThisItem mlist
ThisItem = STRIP(ThisItem,'b')
IF line = "" THEN
line = ThisItem
ELSE
line = line"+"ThisItem
END
CALL E6LnOut o,line
END
IF nmlist <> "" THEN
DO WHILE nmlist <> ""
PARSE VAR nmlist ThisItem nmlist
ThisItem = STRIP(ThisItem,'b')
CALL E6LnOut o,ThisItem
END
RETURN
MakeTransportInstall: PROCEDURE EXPOSE glob. YES NO
o = glob.target
CALL E6LnOut o,"userline=if BootDriveIsFixedDisk() = YES then iterate"
line = "+"
j = glob.TheTransport
jx = glob.0LIST.j.DBindex
line = line||glob.0APP.jx.APPNICK"_maint"
IF glob.NumAppsSelected = 1 THEN
line = line"+"casdelet
IF glob.NumAppsSelected > 1 THEN
line = AddLCUToLine(line)
line = line ||"+"
CALL E6LnOut o,line
IF glob.NumAppsSelected > 1 THEN
CALL E6LnOut o,"userline=CALL RebootAndGoToState(2)"
ELSE
CALL E6LnOut o,"userline=CALL reboot"
i = glob.TheTransport
j = glob.0LIST.i.DBIndex
CALL E6LnOut o,glob.0app.j.appnick
RETURN
ADDLCUToLine: PROCEDURE EXPOSE glob. YES NO
parse arg line
IF line <> "" & RIGHT(line,1) <> "+" THEN
line = line || "+"
DO i = 1 to glob.0UniqAlias.0
IF WORDPOS(glob.0UniqAlias.i,glob.ThinString) <> 0 THEN
line = line || "thinifs"i || "+"
END
line = line || "casinstl"
RETURN line
MakeProg: PROCEDURE EXPOSE glob. YES NO o
parse arg i
TheFile = glob.target
TheCmd = glob.0list.i.INSTCMD
j = glob.0list.i.DBIndex
TheShortName = glob.0APP.j.appnick
TheLongName = glob.0APP.j.appname
CALL WriteProg
IF glob.0list.i.INSTCMDM <> "" THEN
DO
TheCmd = glob.0list.i.INSTCMDM
TheShortName = TheShortName"_maint"
TheLongName = TheLongName" (under maint sys)"
CALL WriteProg
END
RETURN
MakeMSProg: PROCEDURE EXPOSE glob. YES NO o
parse arg i
CALL MakeTranslateTable i
TheCmdList = glob.0list.i.MAINTSYSBUILD
DO WHILE TheCmdList <> ""
PARSE VAR TheCmdList j TheCmdList
j = STRIP(j,'b')
TheShortName = glob.0list.i.MSCMD.j.0CmdName
TheLongName = TheShortName
TheFile = glob.Target
j = glob.0list.i.DBIndex
TheCmd = StringReplace(glob.0list.i.MSCMD.j)
CALL E6LnOut o,":prog" TheShortName
CALL E6LnOut o,"name = "TheLongName
PARSE VAR TheCmd ThisPart"/"TheCmd
CALL E6LnOut o,"invoke = "ThisPart
DO WHILE TheCmd <> ""
PARSE VAR TheCmd ThisPart"/"TheCmd
CALL E6LnOut o," /"ThisPart
END
CALL E6LnOut ":endprog"
CALL E6LnOut o," "
END
RETURN
WriteProg:
CALL MakeTranslateTable i
j = glob.0LIST.i.DBIndex
IF glob.0APP.j.progtype <> 1 THEN
IF glob.0APP.j.package = 2 THEN
IF POS("FSERVICE",TRANSLATE(TheCmd)) <> 0 THEN
TheCmd = FixSlashT(TheCmd)
TheCmd = StringReplace(TheCmd)
CALL E6LnOut o,":prog" TheShortName
CALL E6LnOut o,"name = "TheLongName
PARSE VAR TheCmd ThisPart"/"TheCmd
CALL E6LnOut o,"invoke = "ThisPart
DO WHILE TheCmd <> ""
PARSE VAR TheCmd ThisPart"/"TheCmd
CALL E6LnOut o," /"ThisPart
END
IF glob.0list.i.defrespfile <> "" THEN
DO
CALL E6LnOut o,'rspdir = "'glob.0app.j.appnick'_rsppath"'
CALL E6LnOut o,'default = 'glob.0list.i.defrespfile
END
CALL E6LnOut o,":endprog"
CALL E6LnOut o," "
RETURN
MakeLCUUtil: PROCEDURE EXPOSE glob. YES NO
TheShortName = "casinstl"
TheLongName = "LAN CID Utility"
TheCmd = '"lcupath"\casinstl /cmd:"cmdpath" '
TheCmd = TheCmd || '/tu:"bootdrive" '
TheCmd = TheCmd || '/pl:"rexxpath" '
TheCmd = TheCmd || '/pa:"lcupath" '
TheCmd = TheCmd || '/l1:'glob.lcualias.0Drive':\'
IF glob.lcupath <> "" THEN
TheCmd = TheCmd || STRIP(glob.lcupath,'b','\') || "\"
TheCmd = TheCmd || 'LOG\lcu\"client".log '
TheCmd = TheCmd || '/l2:'glob.lcualias.0Drive':\'
IF glob.lcupath <> "" THEN
TheCmd = TheCmd || STRIP(glob.lcupath,'b','\') || "\"
TheCmd = TheCmd || 'LOG\lcu\srvifs_req.log '
TheCmd = TheCmd || '/req:"client"'
CALL MakeUtility TheShortName,TheLongName,TheCmd
TheShortName = "casdelet"
TheLongName = "LAN CID Utility Delete"
TheCmd = '"lcupath"\casdelet /pl:"rexxpath" '
TheCmd = TheCmd || '/tu:"bootdrive"'
CALL MakeUtility TheShortName,TheLongName,TheCmd
RETURN
MakeSRVIFSUtil: PROCEDURE EXPOSE glob. YES NO
i = 0
DO WORDS(glob.ThinString)
i = i + 1
TheShortName = "thinifs"i
ThisAlias = WORD(glob.ThinString,i)
TheLongName = "SRVIFS for alias" ThisAlias
TheCmd = '"SRVIFSpath"\thinifs /S:"SRVIFSpath" '
TheCmd = TheCmd || '/t:"ifsdir" '
TheCmd = TheCmd || '/tu:"bootdrive"\ '
TheCmd = TheCmd || '/l1:'glob.lcualias.0Drive':\'
IF glob.lcupath <> "" THEN
TheCmd = TheCmd || STRIP(glob.lcupath,'b','\') || "\"
TheCmd = TheCmd || 'LOG\srvifs\"client".log '
TheCmd = TheCmd || '/req:* '
TheCmd = TheCmd || '/srv:\\"srvifs_server1"\'ThisAlias' '
TheCmd = TheCmd || '/d:"d'
DO j = 1 to glob.0UniqAlias.0
IF ThisAlias = glob.0UniqAlias.j THEN
LEAVE
END
TheCmd = TheCmd || j'"'
CALL MakeUtility TheShortName,TheLongName,TheCmd
END
TheShortName = ifsdel
TheLongName = "SRVIFS Delete"
TheCmd = '"SRVIFSpath"\ifsdel /t:"ifsdir" /tu:"bootdrive"'
CALL MakeUtility TheShortName,TheLongName,TheCmd
RETURN
MakeMSUtil: PROCEDURE EXPOSE glob. YES NO
parse arg i
o = glob.target
TheCmdList = glob.0list.i.MAINTSYSBUILD
CALL MakeTranslateTable i
ix = glob.0LIST.i.DBIndex
DO WHILE TheCmdList <> ""
PARSE VAR TheCmdList j TheCmdList
j = STRIP(j,'b')
CALL E6LnOut o,":utility" glob.0list.i.MSCMD.j.0CmdName
CALL E6LnOut o,"name = "glob.0list.i.MSCMD.j.0CmdName
TheCmd = StringReplace(glob.0list.i.MSCMD.j)
PARSE VAR TheCmd ThisPart"/"TheCmd
CALL E6LnOut o,"invoke = "ThisPart
DO WHILE TheCmd <> ""
PARSE VAR TheCmd ThisPart"/"TheCmd
CALL E6LnOut o," /"ThisPart
END
IF glob.0list.i.MSCMD.j.0defrespfile <> "GLOB.0LIST."i".MSCMD."j".0DEFRESPFILE" THEN
DO
CALL E6LnOut o,'rspdir = "'glob.0app.ix.appnick'_rsppath"'
CALL E6LnOut o,'default = 'glob.0list.i.MSCMD.j.0defrespfile
END
CALL E6LnOut o,":endutility"
CALL E6LnOut o," "
END
RETURN
MakeUtility: PROCEDURE EXPOSE glob. YES NO
parse arg TheShortName,TheLongName,TheCmd
o = glob.target
TheCmd = StringReplace(TheCmd)
CALL E6LnOut o,":utility" TheShortName
CALL E6LnOut o,"name = "TheLongName
PARSE VAR TheCmd ThisPart"/"TheCmd
CALL E6LnOut o,"invoke = "ThisPart
DO WHILE TheCmd <> ""
PARSE VAR TheCmd ThisPart "/"TheCmd
CALL E6LnOut o," /"ThisPart
END
CALL E6LnOut o,":endutility"
CALL E6LnOut o," "
RETURN
AddMStoLine: PROCEDURE EXPOSE glob. YES NO
parse arg line,i
cmds = glob.0list.i.MAINTSYSBUILD
IF POS('.',cmds) = 0 THEN
DO WHILE cmds <> ""
PARSE VAR cmds ThisCmd cmds
ThisCmd = STRIP(ThisCmd,'b')
IF line <> "" & RIGHT(line,1) <> "+" THEN
line = line || "+"
line = line || glob.0list.i.MSCmd.ThisCmd.0CmdName
END
RETURN line
MakeTranslateTable: PROCEDURE EXPOSE glob. YES NO
parse arg i
j = glob.0list.i.DBIndex
glob.mat.0 = 12
glob.mat.1.0tag = "$T"
glob.mat.1.0rep = glob.0list.i.tgt
glob.mat.2.0tag = "$S"
glob.mat.2.0rep = '"'glob.0app.j.APPNICK'_images"'
glob.mat.3.0tag = "$W"
glob.mat.3.0rep = '"'glob.0app.j.APPNICK'_exepath"'
glob.mat.4.0tag = "$D"
glob.mat.4.0rep = '"'glob.0app.j.APPNICK'_dllpath"'
glob.mat.5.0tag = "$L"
glob.mat.5.0rep = '"'glob.0app.j.APPNICK'_logpath"'
glob.mat.6.0tag = "$R"
glob.mat.6.0rep = '"'glob.0app.j.APPNICK'_rsppath"'
glob.mat.7.0tag = "$B"
glob.mat.7.0rep = '"bootdrive"'
glob.mat.8.0tag = "$M"
glob.mat.8.0rep = '"maint_dir"'
glob.mat.9.0tag = "$V"
glob.mat.9.0rep = '"srvifs_server1"'
glob.mat.10.0tag = "$F"
glob.mat.10.0rep = glob.fixpath
glob.mat.11.0tag = "$C"
glob.mat.11.0rep = '"client"'
glob.mat.12.0tag = "$O"
glob.mat.12.0rep = '"bootdrive"'
RETURN
FindDrive: PROCEDURE EXPOSE glob. YES NO
parse arg alias
alias = TRANSLATE(alias)
DO i = 1 to glob.0UniqAlias.0
IF alias = glob.0UniqAlias.i.aliasname THEN
RETURN SUBSTR(glob.0vars.SubsequentDrives,i,1)":"
END
RETURN glob.0vars.DefaultHomedrive
BldPath: PROCEDURE EXPOSE glob. YES NO
parse arg FrontPart,BackPart
val = STRIP(FrontPart,"t","\")"\"STRIP(BackPart,"L","\")
RETURN val
StringReplace: PROCEDURE EXPOSE glob.
parse arg TheString
Do i = 1 to glob.mat.0
len = LENGTH(glob.mat.i.0tag) - 1
n = POS(glob.mat.i.0tag,TheString)
DO WHILE n > 0
NewString = SUBSTR(TheString,1,n-1)||glob.mat.i.0rep||SUBSTR(TheString,n+len+1)
TheString = NewString
n = POS(glob.mat.i.0tag,TheString)
END
END
RETURN TheString
LoadRexxUtil: PROCEDURE EXPOSE glob.
irc = RxFuncAdd("SysLoadFuncs","REXXUTIL","SysLoadFuncs")
irc = RxFuncQuery("SysLoadFuncs")
IF irc <> 0 THEN SIGNAL No_RexxUtils
irc = SysLoadFuncs()
RETURN
AppIndexInDatabase: PROCEDURE EXPOSE glob.
PARSE UPPER ARG ThisApp
DO i = 1 to glob.0app.0
IF ThisApp = glob.0app.i.appnick THEN
LEAVE
END
IF i > glob.0app.0 THEN
RETURN 0
RETURN i
FixSlashT: PROCEDURE EXPOSE glob. YES NO
parse arg TheCmd
n = POS("/T:",TRANSLATE(TheCmd))
IF glob.AlreadyHaveSlashT <> 1 THEN
IF n = 0 THEN
TheCmd = TheCmd || " /T:$M"
ELSE
NOP
ELSE
IF n = 0 THEN
NOP
ELSE
DO WHILE n <= LENGTH(TheCmd) & SUBSTR(TheCmd,n,1) <> " "
TheCmd = OVERLAY(" ",TheCmd,n)
n = n + 1
END
glob.AlreadyHaveSlashT = 1
RETURN TheCmd
GetMsg: PROCEDURE EXPOSE glob.
parse arg msgno,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9
TheMsg = SysGetMessage(msgno,glob.MsgFileName,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9)
IF glob.Popup_Environment = "cmsgbox" THEN
DO
CRLF = D2C(13)||D2C(10)
n = POS(CRLF,TheMsg)
DO WHILE n > 0
TheMsg = OVERLAY(" ~",TheMsg,n,2)
n = POS(CRLF,TheMsg)
END
END
RETURN TheMsg
msgbox: PROCEDURE EXPOSE glob.
PARSE ARG message,title,buttons,icon
done = 0
DO WHILE done = 0
done = 1
IF glob.Popup_Environment = "cmsgbox" THEN
DO
message = TRANSLATE(message,"'",'"')
title = TRANSLATE(title,"'",'"')
ADDRESS CMD "@cmsgbox" '"'message'"' '"'title'"' buttons icon
irc = rc
END
ELSE
irc = RxMessageBox(message,title,buttons,icon)
IF irc = glob.0rc.MB_CANCEL THEN
DO
circ = msgbox(GetMsg(glob.0msg.Cancel_Text),GetMsg(glob.0msg.Cancel_Title),"YESNO","WARNING")
IF circ = glob.0rc.MB_NO THEN
done = 0
END
END
RETURN irc
PathConcat: PROCEDURE
i = 1
path = ""
DO FOREVER
part = STRIP(ARG(i),'t','\')
IF part = "" THEN LEAVE
IF i > 1 THEN part.i = STRIP(part.i,'b','\')
path = path || "\" || part
i = i + 1
END
RETURN path
E6LnOut: PROCEDURE EXPOSE glob. YES NO
parse arg o,line
DO WHILE LINEOUT(o,line) <> 0
statstring = STREAM(o,'DESCRIPTION')
PARSE var statstring stat":"info
IF stat = "ERROR" & info = "112" THEN
msg = GetMsg(glob.0msg.DISKFULL_Text,o)
ELSE
msg = GetMsg(glob.0msg.DISKIOERROR_Text,o)
mb = msgbox(msg,GetMsg(glob.0msg.DISKIOERROR_Title),"OKCANCEL","ERROR")
IF mb <> glob.0rc.MB_OK THEN
DO
irc = NO
SIGNAL CommonExit
END
END
RETURN
BadCL:
Msg = GetMsg(glob.0msg.CLProblem_Text,BadParm,BadValue)
CALL msgbox Msg,GetMsg(glob.0msg.CLProblem_Title),"OK","ERROR"
irc = NO
SIGNAL CommonExit
help:
CALL msgbox GetMsg(glob.0msg.HELP_TEXT),GetMsg(glob.0msg.HELP_TITLE),"OK","ERROR"
irc = NO
SIGNAL CommonExit
BadApp:
CALL msgbox GetMsg(glob.0msg.BADLISTELEM_TEXT,TheAppName),GetMsg(glob.0msg.NOLISTELEM_TITLE),"OK","ERROR"
irc = NO
SIGNAL CommonExit
CommonExit:
CALL STREAM glob.0logfile,'c','close'
EXIT irc