home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / CEDIT.ZIP / cedit.cmd
OS/2 REXX Batch file  |  1992-10-06  |  21KB  |  566 lines

  1. /*
  2. program: CEDIT.cmd
  3. type:    REXXSAA-OS/2, version 2.x
  4. purpose: Edit Config.SYS File
  5. version: 1.0
  6. date:    1992-08-27 (Internal)
  7. changed: 1.1 1992-09-13 (Internal)
  8.              -SET logic to allow additon of variable
  9.               if it doesn't currently exist
  10.              -Allow no duplicate directory adds on path or set statements
  11.                 (only valid if input has semicollons!!)
  12.          2.0 1992-10-06 (External)
  13.              -Can Now accept flags from the command line.
  14.              -Commands changed for clarity.
  15.  
  16. author:  Byron Stephan,
  17.          Email through OS/2 Shareware BBS
  18.  
  19. needs:   OS/2 2.0 & Rexx Fixes
  20.  
  21. Plans:    Need to standardize the Input logic.
  22.           Should check when a directory is involved that a Semi-colon is on the end.
  23.           Should have SET input flag as error attemp to modify PATH, DPATH, ...
  24.           ?Error if SET line previously had a semi-colon ending it?
  25.  
  26. Problems: none known
  27.           Email through OS/2 Shareware BBS if any detected please!
  28.  
  29. All rights reserved, copyrighted 1992, no guarantee that it works without
  30. errors, etc. etc.
  31.  
  32. donated to the public domain granted that you are not charging anything (money
  33. etc.) for it and derivates based upon it, as you did not write it,
  34. etc. if that holds you may bundle it with commercial programs too
  35.  
  36. you may freely distribute this program, granted that no changes are made
  37. to it.
  38.  
  39. Please, if you find an error, post me a message describing it, I will
  40. try to fix and rerelease it to the net.
  41.  
  42. procedures:
  43.  
  44.  
  45. usage:   CEDIT [/F:filename]
  46.          CEDIT [/E:config.sys line]
  47.          CEDIT [/B:config.sys line]
  48.          CEDIT [/D:directories]
  49.          CEDIT [/L:directories]
  50.          CEDIT [/P:directories]
  51.          CEDIT [/S:variable=value]
  52.  
  53.          CEDIT [/?] _____
  54.          CEDIT [/H]      \ --- Help
  55.          CEDIT      _____/
  56.  
  57.          CEDIT [/FH] Command File Help
  58.  
  59. syntax:
  60.     FILENAME .... Filename of commands
  61.  
  62. flags:
  63.     /B:  ........ Add at beginning of Config.sys
  64.     /D:  ........ Add to DPATH variable
  65.     /E:  ........ Add at end of config.sys
  66.     /L:  ........ Add to LIBPATH Variable
  67.     /P:  ........ Add to PATH Variable
  68.     /S:  ........ Add to a SET Variable
  69.  
  70. */
  71.  
  72. /****************************************************************
  73. ** Set up error handling.
  74. ** Intialize.
  75. ** Parse Command line arguments.
  76. ** Process commands.
  77. *****************************************************************/
  78.  
  79.  
  80. SIGNAL ON FAILURE NAME Error
  81. SIGNAL ON HALT NAME Halt
  82. SIGNAL ON ERROR NAME Error
  83. SIGNAL ON SYNTAX NAME Error
  84.  
  85. global. = ""
  86.  
  87. CALL Initialize                 /* initialize array "global."           */
  88. CALL parse_args ARG(1)
  89. CALL Process
  90. exit
  91.  
  92.  
  93. Initialize: PROCEDURE EXPOSE global.
  94. /****************************************************************
  95. ** Define colors.
  96. ** Load necessary functions if not already loaded.
  97. ** Initialize global variables.
  98. *****************************************************************/
  99.  
  100. /* define some ANSI.SYS-colors */
  101. esc    = '1B'x          /* escape-char */
  102.     
  103. /* define ANSI-colors */
  104. global.iRedWhite  = esc||"[31;47m"    /* ANSI.SYS-control for red foreground */
  105. global.iRed       = esc||"[31;40m"    /* ANSI.SYS-control for yellow foreground */
  106. global.iGreen     = esc||"[32;40m"    /* ANSI.SYS-control for yellow foreground */
  107. global.iYellow    = esc||"[33;40m"    /* ANSI.SYS-control for yellow foreground */
  108. global.iBlue      = esc||"[34;40m"    /* ANSI.SYS-control for yellow foreground */
  109. global.iMagenta   = esc||"[35;40m"    /* ANSI.SYS-control for yellow foreground */
  110. global.iCyan      = esc||"[36;40m"    /* ANSI.SYS-control for cyan foreground */
  111. global.iNormal    = esc||"[0;40m"     /* ANSI.SYS-control for resetting attributes to normal */
  112. global.iScrLength = LENGTH(global.iRedWhite)
  113.  
  114. /* Set Colorful program prompt */
  115. global.CEDIT = global.iYellow||"CEDIT"||global.iNormal
  116.  
  117. /* hint for options */
  118. global.defaultHint = global.iCyan || "(" || global.iYellow || "default" || global.iCyan || ")"
  119. /* hint for default yes or no */
  120. global.yesHint = global.iCyan || " (" || global.iYellow || "Y" || global.iCyan || "/N) " || global.iYellow
  121. global.noHint  = global.iCyan || " (Y/" || global.iYellow || "N" || global.iCyan || ") " || global.iYellow
  122.  
  123. /* check whether RxFuncs are loaded, if not, load them */
  124. IF RxFuncQuery('SysLoadFuncs') THEN do
  125.    /* load the load-function */
  126.    CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'       
  127.  
  128.    /* load the Sys* utilities */
  129.    CALL SysLoadFuncs                                                 
  130. END
  131.  
  132. /* get screen dimensions */
  133. PARSE VALUE SysTextScreenSize() WITH row columns
  134. global.iRows = row
  135. global.iColumns = columns
  136. global.iBlankLine = global.iRedWhite || RIGHT("", columns - 1) || global.iCyan
  137.  
  138. global.cLibpath = ""
  139. global.cPath    = ""
  140. global.cDpath   = ""
  141. global.AddBegin = ""
  142. global.AddEnd  = ""
  143. global.AddBegin.0 = 0
  144. global.AddEnd.0  = 0
  145. global.SetVar.0  = 0
  146.  
  147. RETURN
  148.  
  149. Parse_ARGS: PROCEDURE EXPOSE Global.
  150. /****************************************************************
  151. ** Check for no arguments or Help switches.
  152. ** Parse various switches until no more switches.
  153. ** --While switches exist...
  154. ** --   Find next switch
  155. ** --   Parse Switch & Value to seperate them out
  156. ** --   (Note: Requires that a colon exist as part of the switch)
  157. ** --   For switch do appropriate action
  158. *****************************************************************/
  159.  
  160. IF ARG(1) = '' | POS('/?',ARG(1)) | POS('/H',TRANSLATE(ARG(1))) THEN
  161.    SIGNAL Usage
  162. IF POS('/FH',TRANSLATE(ARG(1))) THEN
  163.    SIGNAL FileUsage
  164.  
  165.  
  166. SwitchPos = pos('/',ARG(1))
  167. do while SwitchPos > 0
  168.    EndSwitchPos = pos('/',value,SwitchPos+3) - 1
  169.    if EndSwitchPos < 1 then
  170.       EndSwitchPos = Length(arg(1))
  171.  
  172.    Switch_value = substr(arg(1),SwitchPos,EndSwitchPos)
  173.  
  174.    parse value Switch_Value with '/' Switch ':' Value 
  175.    Switch = TRANSLATE(Switch)
  176.    Select
  177.       when Switch = 'B' then do
  178.          global.AddBegin.0 = global.AddBegin.0 + 1
  179.          iTemp = global.AddBegin.0
  180.          global.AddBegin.iTemp = value
  181.       end  /* Do */
  182.       when Switch = 'E' then do
  183.          global.AddEnd.0 = global.AddEnd.0 + 1
  184.          iTemp = global.AddEnd.0
  185.          global.AddEnd.iTemp = value
  186.       end  /* Do */
  187.       when Switch = 'F' then do
  188.          global.filein = STRIP(Value)          /* get rid of leading and trailing spaces */
  189.          global.eFilein = STREAM(global.filein, "C", "QUERY EXISTS") /* File exists? */
  190.  
  191.          IF global.eFilein = "" THEN do
  192.             SAY global.CEDIT": file "||global.iGreen||"["||global.iCyan || global.filein || global.iGreen||"]"||global.iNormal" does not exist."
  193.             EXIT -2
  194.          END
  195.          else
  196.             call Read_File
  197.       end  /* Do */
  198.       when Switch = 'L' then
  199.          global.cLibpath = global.cLibpath||value
  200.       when Switch = 'D' then
  201.          global.cDpath = global.cDpath||value
  202.       when Switch = 'P' then
  203.          global.cPath = global.cPath||value
  204.       when Switch = 'S' then do
  205.          /* If SET keyword exists then add value to keywords value 
  206.          ** else add new SET keyword and value. 
  207.          */ 
  208.          eVariableFound = 0
  209.          PARSE VALUE value WITH keyword "=" value
  210.  
  211.          DO iTemp = 1 TO global.setvar.0
  212.             if global.setvar.Keys.itemp = TRANSLATE(keyword) then do
  213.                global.SetVar.KeyValue.iTemp = global.SetVar.KeyValue.iTemp||value
  214.                eVariableFound = 1
  215.             END
  216.          END
  217.          if eVariableFound = 0 then DO
  218.             global.SetVar.0 = global.SetVar.0 + 1
  219.             iTemp = global.SetVar.0
  220.  
  221.             global.SetVar.Keys.iTemp = TRANSLATE(keyword)
  222.             global.SetVar.KeyValue.iTemp   = value
  223.             global.SetVar.SetExists.iTemp = 0
  224.          end
  225.       END
  226.  
  227.    otherwise
  228.       /* Unknown switch - show help */
  229.       Signal Usage
  230.  
  231. end  /* select */
  232.  
  233. RETURN
  234.  
  235. Read_File: PROCEDURE EXPOSE global.
  236. /****************************************************************
  237. ** While not EOF
  238. **    Read line. Ignore comments and blank lines.
  239. **    Parse file input
  240. **    if problem show line and exit
  241. *****************************************************************/
  242. SAY "Reading Command file..."
  243. iline_no = 0             /* line-number */
  244. DO WHILE LINES(global.filein) > 0
  245.    line = LINEIN(global.filein)
  246.    iline_no = iline_no + 1
  247.  
  248.    /* no empty lines and no comments */
  249.    IF line = "" | SUBSTR(STRIP(line), 1, 2) = "--" THEN ITERATE
  250.  
  251.    SAY "parsing "||global.iGreen||"["||global.iNormal || line || global.iGreen||"]"||global.iNormal
  252.  
  253.    IF Parse_File_Input(line, iline_no) > 0 THEN do
  254.       SAY global.iredwhite
  255.       SAY "Line No:" iline_no
  256.       SAY ">>> " line global.inormal
  257.       SAY 
  258.       exit -3
  259.    END
  260. END
  261.  
  262. CALL STREAM global.filein, "C", "CLOSE"        /* make sure file is closed */
  263.  
  264. RETURN
  265.  
  266. Process: PROCEDURE EXPOSE global.
  267. /****************************************************************
  268. ** Find Boot drive
  269. ** Update temporary file.
  270. ** Backup Config.sys file
  271. ** If no problems then replace config.sys with temporary file.
  272. *****************************************************************/
  273.  
  274. global.cBootdrive = substr(VALUE('PATH',,'OS2ENVIRONMENT'),POS('\OS2\SYSTEM',VALUE('PATH',,'OS2ENVIRONMENT')) - 2,2)
  275.  
  276. SAY "Creating temporary file..."
  277.  
  278. cTempFilename = SysTempFileName(Global.cBootdrive||'\Temp????.SYS')
  279. DO WHILE LINES(global.cbootdrive||"\CONFIG.SYS") > 0
  280.    line = LINEIN(global.cbootdrive||"\CONFIG.SYS")
  281.    UPPERline = TRANSLATE(LINE)
  282.  
  283.    SELECT
  284.       WHEN ("IFS=" = SUBSTR(UPPERline,1,4)) THEN
  285.          DO
  286.          CALL LINEOUT cTempFilename, line
  287.          DO iTemp = 1 TO global.AddBegin.0
  288.             CALL LINEOUT cTempFilename,Global.AddBegin.iTemp
  289.          END
  290.          END
  291.       WHEN ("LIBPATH=" = SUBSTR(UPPERline,1,8)) THEN
  292.          do
  293.          Path = CheckPath(upperline,Global.cLibpath)
  294.          CALL LINEOUT cTempFilename,path 
  295.          end
  296.       WHEN ("SET PATH=" = SUBSTR(UPPERline,1,9)) THEN
  297.          do
  298.          Path = CheckPath(upperline,Global.cPath)
  299.          CALL LINEOUT cTempFilename,Path 
  300.          end
  301.       WHEN ("SET DPATH=" = SUBSTR(UPPERline,1,10)) THEN
  302.          do
  303.          Path = CheckPath(upperline,Global.cDpath)
  304.          CALL LINEOUT cTempFilename,path 
  305.          end
  306.       WHEN ("SET " = SUBSTR(UPPERline,1,4)) THEN
  307.          do
  308.          if global.setvar.0 = 0 then
  309.             CALL LINEOUT cTempFilename,line 
  310.          else
  311.             DO
  312.             eKeywordFound = 0
  313.             DO iTemp = 1 TO global.SetVar.0
  314.                PARSE VAR UPPERline with "SET " keyword "=" 
  315.                if global.setvar.keys.iTemp = keyword then
  316.                   DO
  317.                   Path = CheckPath(upperline,Global.SetVar.KeyValue.iTemp,"Set")
  318.                   CALL LINEOUT cTempFilename,path
  319.                   eKeywordFound = 1
  320.                   global.SetVar.SetExists.iTemp = 1
  321.                   END
  322.             END
  323.             if eKeywordFound = 0 then
  324.                CALL LINEOUT cTempFilename,line 
  325.             END
  326.          END
  327.     OTHERWISE
  328.          CALL LINEOUT cTempFilename,line 
  329.    END
  330. END
  331.  
  332. DO iTemp = 1 TO global.SetVar.0
  333.    if global.setvar.SetExists.iTemp = 0 then do
  334.        Path = CheckPath("",Global.SetVar.KeyValue.iTemp,"Set")
  335.        CALL LINEOUT cTempFilename, "SET "||global.setvar.keys.iTemp||"="||path
  336.    END
  337. END
  338.  
  339.  
  340. DO iTemp = 1 TO global.AddEnd.0
  341.    CALL LINEOUT cTempFilename,Global.AddEnd.iTemp 
  342. END
  343. CALL STREAM cTempFilename, "C", "CLOSE"        /* make sure file is closed */
  344. CALL STREAM global.cbootdrive||"\CONFIG.SYS", "C", "CLOSE"        /* make sure file is closed */
  345.  
  346. call backup_file global.cbootdrive||"\CONFIG.SYS"
  347.  
  348. SAY "Updating Config.SYS file..."
  349.  
  350. "@copy "||cTempFilename||" "||global.cbootdrive||"\CONFIG.SYS"
  351. RC = SysFileDelete(cTempFilename)
  352. if RC = 0 then
  353.    exit 0
  354. else
  355.    do
  356.    say global.red||"ERROR!! File could not be deleted!!"||global.inormal
  357.    exit -2
  358.    end
  359. */
  360. Say "Finished..."
  361. return 0
  362.  
  363. Backup_File: PROCEDURE EXPOSE global.
  364. /****************************************************************
  365. ** Backup file with Backini if exists
  366. ** else do generic backup
  367. *****************************************************************/
  368. original_file = arg(1)
  369.  
  370. SAY "Backing up Config.SYS file..."
  371.  
  372. BackiniPath = SysSearchPath('PATH','Backini.exe')
  373. if BackiniPath<>"" then
  374.    "@"||BackiniPath||" "||original_file||" 25 "
  375. else do
  376.    iBackup = 0
  377.    DO FOREVER
  378.       iBackup = iBackup + 1
  379.       extension = lastpos(".", original_file)
  380.       if extension = 0 then do
  381.          extension = length(original_file) + 1
  382.          backup_file = original_file||"."||iBackup
  383.       end
  384.       else
  385.          backup_file = substr(original_file,1,extension)||iBackup
  386.  
  387.       global.eBackup = STREAM("CONFIG."||iBackup, "C", "QUERY EXISTS")
  388.  
  389.       IF global.eBackup = "" THEN do
  390.          "@copy "||original_file||" "||backup_file
  391.          leave
  392.       END /* End-If */
  393.    END /* End-DO */
  394. END /* End-Else */
  395.  
  396. return 0
  397.  
  398. Parse_File_Input: PROCEDURE EXPOSE global.
  399. /****************************************************************
  400. ** Parse file records for keywords.
  401. ** If unknown keyword exists then return bad error code.
  402. *****************************************************************/
  403.  
  404. to_parse = ARG(1)
  405. line_no  = ARG(2)
  406. iErrorExists = 0
  407.  
  408. PARSE VALUE to_parse WITH keyword "=" value
  409.  
  410. SELECT
  411.    WHEN translate(keyword) = "LIBPATH" THEN
  412.       global.cLibpath = global.cLibpath||value
  413.    WHEN translate(keyword) = "DPATH" THEN
  414.       global.cDpath = global.cDpath||value
  415.    WHEN translate(keyword) = "PATH" THEN
  416.       global.cPath = global.cPath||value
  417.    WHEN translate(keyword) = "ADDBEGIN" THEN
  418.       DO
  419.       global.AddBegin.0 = global.AddBegin.0 + 1
  420.       iTemp = global.AddBegin.0
  421.       global.AddBegin.iTemp = value
  422.       END
  423.    WHEN translate(keyword) = "ADDEND" THEN
  424.       DO
  425.       global.AddEnd.0 = global.AddEnd.0 + 1
  426.       iTemp = global.AddEnd.0
  427.       global.AddEnd.iTemp = value
  428.       END
  429.    WHEN translate(keyword) = "SETVAR" THEN
  430.       DO
  431.       eVariableFound = 0
  432.       PARSE VALUE value WITH keyword "=" value
  433.  
  434.       DO iTemp = 1 TO global.setvar.0
  435.          if global.setvar.Keys.itemp = TRANSLATE(keyword) then
  436.             DO
  437.             global.SetVar.KeyValue.iTemp = global.SetVar.KeyValue.iTemp||value
  438.             eVariableFound = 1
  439.             END
  440.       END         
  441.       if eVariableFound = 0 then
  442.          DO
  443.          global.SetVar.0 = global.SetVar.0 + 1
  444.          iTemp = global.SetVar.0 
  445.  
  446.          global.SetVar.Keys.iTemp = TRANSLATE(keyword)
  447.          global.SetVar.KeyValue.iTemp   = value
  448.          global.SetVar.SetExists.iTemp = 0
  449.          end
  450.       END
  451.    OTHERWISE
  452.       iErrorExists = iErrorExists + 1
  453. END
  454.  
  455. RETURN iErrorExists
  456.  
  457. CheckPath: PROCEDURE
  458. /****************************************************************
  459. ** If new value for SET statment doesn't have semi-colon 
  460. **    Replace SET value
  461. ** else 
  462. **    Check PATH being built for duplicate directory.
  463. *****************************************************************/
  464. line = arg(1)
  465. value = arg(2)
  466. Source = arg(3)
  467. path = line
  468. startingpos = pos('=',value) + 1
  469. lastpos = pos(';',value)
  470. if translate(source) = 'SET' & lastpos = 0 then do
  471.    SetStatement = substr(line,1,pos('=',line))||value
  472.    return SetStatement
  473. end
  474. else
  475.    do while lastpos > 0
  476.       subvalue = translate(substr(value,startingpos,lastpos-startingpos+1))
  477.       if pos(subvalue, path) > 0 then
  478.          nop /*Say 'Value '||subvalue||' already exists in '||line*/
  479.       else
  480.          path = path||subvalue
  481.       Startingpos = lastpos + 1
  482.       lastpos = pos(';',value,startingpos)
  483.    end
  484. return path
  485.  
  486. USAGE:
  487. /****************************************************************
  488. ** Help on switches
  489. *****************************************************************/
  490.    
  491.    SAY global.cedit||": Modifies Config.SYS file"
  492.    SAY
  493.    SAY "      /"||global.iMagenta||"H"||global.iNormal"                  ... This Screen of switches"||global.iNormal
  494.    SAY "      /"||global.iMagenta||"FH"||global.iNormal"                 ... Help for File commands"||global.iNormal
  495.    SAY "      /"||global.iMagenta||"F:"||global.iGreen||"["||global.iCyan||"filename"||global.iGreen||"]"||global.iNormal"       ... contains file of commands"||global.iNormal
  496.    SAY "      /"||global.iMagenta||"L:"||global.iGreen||"["global.icyan||"directory;"||global.iGreen||"]"||global.iNormal
  497.    SAY "      /"||global.iMagenta||"P:"||global.iGreen||"["global.icyan||"directory;"||global.iGreen||"]"||global.iNormal
  498.    SAY "      /"||global.iMagenta||"D:"||global.iGreen||"["global.icyan||"directory;"||global.iGreen||"]"||global.iNormal
  499.    SAY global.iBlue||"......         "||global.ired||"(Must use ; after directory names!) "||global.inormal
  500.    SAY "      /"||global.iMagenta||"B:"||global.iGreen||"["global.icyan||"Config.SYS line"||global.iGreen||"]"||global.iNormal
  501.    SAY global.iBlue||"......         "||global.icyan||"(After File System is loaded... After IFS Statement) "||global.inormal
  502.    SAY "      /"||global.iMagenta||"E:"||global.iGreen||"["global.icyan||"Config.SYS line"||global.iGreen||"]"||global.iNormal
  503.    SAY global.iBlue||"......         "||global.icyan||"(Add to end of Config.SYS file) "||global.inormal
  504.    SAY "      /"||global.iMagenta||"S:"||global.iGreen||"["global.icyan||"Keyword"||global.iGreen||"]"||global.iNormal||"="||global.iGreen||"["global.icyan||"Value"||global.iGreen||"]"||global.iNormal
  505.    SAY global.iBlue||"......     "||global.iyellow||"Keyword"||global.inormal||":"||global.icyan||" Keyword for SET Statment "||global.inormal
  506.    SAY global.iBlue||"......     "||global.iyellow||"Value"||global.inormal||":"||global.icyan||" Value to SET keyword "||global.inormal
  507.    SAY global.iBlue||"......   "||global.ired||"(Must use ; if VALUE is directory names!) "||global.inormal
  508.    SAY global.iBlue||"......   "||global.ired||"(Set Variable cannot have ""/"" for it's value - Do through command file) "||global.inormal
  509.  
  510.    SAY
  511.  
  512.    EXIT -1
  513.  
  514. FileUsage:
  515. /****************************************************************
  516. ** Help on File Commands.
  517. *****************************************************************/
  518.    
  519.    SAY global.cedit||": Modifies Config.SYS file"
  520.    SAY "    : File Format"
  521.    SAY 
  522.    SAY "            "||global.iMagenta||"--"||global.iNormal||"                  ... Comment Line"
  523.    SAY "       "||global.iMagenta||"LIBPATH"||global.inormal||"="||global.iGreen||"["global.icyan||"directory;"||global.iGreen||"]"||global.iNormal
  524.    SAY "          "||global.iMagenta||"PATH"||global.inormal||"="||global.iGreen||"["global.icyan||"directory;"||global.iGreen||"]"||global.iNormal
  525.    SAY "         "||global.iMagenta||"DPATH"||global.inormal||"="||global.iGreen||"["global.icyan||"directory;"||global.iGreen||"]"||global.iNormal
  526.    SAY global.iBlue||"......         "||global.ired||"(Must use ; after directory names!) "||global.inormal
  527.    SAY "      "||global.iMagenta||"AddBegin"||global.inormal||"="||global.iGreen||"["global.icyan||"Config.SYS line"||global.iGreen||"]"||global.iNormal
  528.    SAY global.iBlue||"......         "||global.icyan||"(After File System is loaded... After IFS Statement) "||global.inormal
  529.    SAY "        "||global.iMagenta||"AddEnd"||global.inormal||"="||global.iGreen||"["global.icyan||"Config.SYS line"||global.iGreen||"]"||global.iNormal
  530.    SAY global.iBlue||"......         "||global.icyan||"(Add to end of Config.SYS file) "||global.inormal
  531.    SAY "        "||global.iMagenta||"SetVar"||global.inormal||"="||global.iGreen||"["global.icyan||"Keyword"||global.iGreen||"]"||global.iNormal||"="||global.iGreen||"["global.icyan||"Value"||global.iGreen||"]"||global.iNormal
  532.    SAY global.iBlue||"......         "||global.iyellow||"Keyword"||global.inormal||":"||global.icyan||" Keyword for SET Statment "||global.inormal
  533.    SAY global.iBlue||"......         "||global.iyellow||"Value"||global.inormal||":"||global.icyan||" Value to SET keyword "||global.inormal
  534.    SAY global.iBlue||"......         "||global.ired||"(Must use ; if VALUE is directory names!) "||global.inormal
  535.  
  536.    SAY
  537.  
  538.    EXIT -1
  539.  
  540. HALT:
  541. /****************************************************************
  542. ** User stopped program! Shame on them!!
  543. *****************************************************************/
  544.    CALL STREAM filein, "C", "CLOSE"             /* make sure, file is closed */
  545.    SAY global.cedit||": User interrupted program."
  546.    EXIT -1
  547.  
  548. ERROR:        
  549. /****************************************************************
  550. ** Error of some sort occured!
  551. *****************************************************************/
  552.    myrc = RC
  553.    SAY global.cedit||': error occurred !'
  554.    SAY
  555.  
  556.    SAY 'REXX error' myrc 'in line' SIGL':' ||global.iRedWhite||ERRORTEXT(myrc)||global.iNormal
  557.    SAY global.iRed||Substr('     ',1,6-Length(SIGL))(SIGL)' *-*   'Sourceline(sigl)||global.iNormal
  558.  
  559. IF MYRC = 43 THEN
  560.    SAY 'Chances are you are in OS/2 1.3 where this routine will not work.'
  561.    SAY
  562.    SAY global.iCyan||'Please contact the author with a description of the error.'||global.iNormal
  563.  
  564.    EXIT -99
  565.  
  566.