home *** CD-ROM | disk | FTP | other *** search
- /*
- Control Tower Arexx Script
- Written By J.L. White
- (C)1995 Merlin's Software
- */
-
- signal on error
- signal on syntax
- Options Results
-
- Quotes = '22'X
- SingleQ = '27'X
-
- Main:
- call OpenStuff()
- call Docs()
- call Routine()
- call CloseStuff()
- exit
- return
-
- GetFile:
- parse Arg Title, Path
- Address FLY_1 SetString Path
- Address FLY_1 GetFileNameNT Title
- return result
-
-
- GetPath:
- parse Arg Title, Path
- Address FLY_1 SetString Path
- Address FLY_1 GetPathNameNT Title
- return result
-
- GetText:
- parse Arg Title, Text
- Address FLY_1 SetString Text
- Address FLY_1 GetStringNT Title
- return result
-
-
- OpenStuff:
- address command "run CT:FLY"
- do while (POS('FLY_1',SHOW('Ports')) = 0)
- address command "wait 1"
- end
- TOASTERLIB="ToasterARexx.port"
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- return
-
- CloseStuff:
- Address FLY_1 Quit
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- exit
- return
-
- YesOrNo: procedure
- parse Arg Title,Yes,No
- Address FLY_1 OK_TEXT Yes
- Address FLY_1 CANCEL_TEXT No
- Address FLY_1 AskYesNoNT Title
- if result = "OK" then YesNo = 1
- else YesNo = 0
- return YesNo
-
- Info:
- parse Arg Title,Yes
- Address FLY_1 OK_TEXT Yes
- Address FLY_1 FYINT Title
- return
-
- FindDrive:
- address command "C:Info >RAM:FLY-List"
- call open TempFile,"RAM:FLY-List",R
- do until eof(TempFile)
- line = readln(TempFile)
- parse var line Drive" "Rest
- if Drive = "FA0:" then
- Volume = word(Rest,7)":"
- end
- call close TempFile
- address command "Delete >NIL: RAM:FLY-List"
- return Volume
-
- GetFileName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return substr(CompleteName, c + 1)
-
-
- GetPathName: procedure
- ARG CompleteName
- c = lastpos(":",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return left(CompleteName,c)
-
- Docs:
- Answer = YesOrNo(" Do You Need Instructions?"," YES "," NO ")
- if Answer = 0 then return
- Text = "This Macro will automatically add\
- Image FX to the Flyer Program Menu.\
- You have the option to do it just\
- for now or to come up each time you\
- boot the Flyer Software."
- Address FLY_1 OK_TEXT " Continue! "
- Address FLY_1 FYINT Text
-
- return
-
-
- Routine:
- Type = YesOrNo("Add Image FX Now Or Always?"," NOW ","ALWAYS!")
- call CreateAdd()
- if Type = 0 then do
- call CreateAlways()
- end
-
- return
-
-
- CreateAdd:
- Name = "ImageFX"
- InFile = "ImageFX:ImageFX"
- TOASTERLIB="ToasterARexx.port"
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- call Addprogram(Name,"run SYS:rexxc/rx CT:Scripts2/4/"Name,0)
-
- call open TempFile,"CT:Scripts2/4/"Name,W
- call writeln TempFile,"/* */"
- call writeln TempFile,"options results"
- call writeln TempFile,"TOASTERLIB="Quotes"ToasterARexx.port"Quotes
- call writeln TempFile,"call remlib("SingleQ"ToasterARexx.port"SingleQ")"
- call writeln TempFile,"call remlib("SingleQ"PROJECT_REXX_PORT"SingleQ")"
- call writeln TempFile,"call addlib("SingleQ"PROJECT_REXX_PORT"SingleQ" , 0)"
- call writeln TempFile,"call addlib(TOASTERLIB,0)"
- call writeln TempFile,"call Switcher(TOWB)"
- call writeln TempFile,"call remlib("SingleQ"ToasterARexx.port"SingleQ")"
- call writeln TempFile,"call remlib("SingleQ"PROJECT_REXX_PORT"SingleQ")"
- call writeln TempFile,"if (POS("SingleQ"IMAGEFX.1"SingleQ",SHOW("SingleQ"Ports"SingleQ")) = 0)"
- call writeln TempFile,"then do"
- call writeln TempFile," Address Command "Quotes"run >NIL: "InFile""Quotes
- call writeln TempFile,"end"
- call writeln TempFile,"else do"
- call writeln TempFile," address "Quotes"IMAGEFX.1"Quotes
- call writeln TempFile," ScreenToFront"
- call writeln TempFile,"end"
- call writeln TempFile,"exit"
- call close TempFile
-
- return
-
- CreateAlways:
- parse Arg Program
- Name = GetFileName(InFile)
- call open TempFile,"CT:Scripts2/4/"Name".Load",W
- call writeln TempFile,"/* */"
- call writeln TempFile,"options results"
-
- call writeln TempFile,"do while (POS("SingleQ"PROJECT_REXX_PORT"SingleQ",SHOW("SingleQ"Ports"SingleQ")) = 0)"
- call writeln TempFile,"Address command "Quotes"C:Wait 3"Quotes
- call writeln TempFile,"end"
-
- call writeln TempFile,"TOASTERLIB="Quotes"ToasterARexx.port"Quotes
- call writeln TempFile,"call remlib("SingleQ"ToasterARexx.port"SingleQ")"
- call writeln TempFile,"call remlib("SingleQ"PROJECT_REXX_PORT"SingleQ")"
- call writeln TempFile,"call addlib("SingleQ"PROJECT_REXX_PORT"SingleQ" , 0)"
- call writeln TempFile,"call addlib(TOASTERLIB,0)"
- call writeln TempFile,"call AddProgram("Quotes""Name""Quotes","Quotes"run SYS:rexxc/rx CT:Scripts2/4/"Name""Quotes",0)"
- call writeln TempFile,"call remlib("SingleQ"ToasterARexx.port"SingleQ")"
- call writeln TempFile,"call remlib("SingleQ"PROJECT_REXX_PORT"SingleQ")"
- call writeln TempFile,"exit"
- call close TempFile
-
- call open TempFile,"Toaster:Programs/StartToaster",A
- call writeln TempFile,"rx >NIL: CT:Scripts2/4/"Name".Load"
- call close TempFile
-
- return
-
- syntax:
- error:
- Address FLY_1 OK_TEXT " OK "
- Title = "An Error Was Found With This Macro On Line #"SIGL"!"
- Address FLY_1 FYINT Title
- Address FLY_1 Quit
- exit
-