REXX Tips & Tricks, Version 2.80


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


Workaround for the SYS0008 error





 
/* workaround for the SYS0008 error                                   */

                    /* get the current round count and session no.    */
  parse arg round sessionNo

  if round = "" then
    round = 1           /* initial value is 1                         */

  if sessionNo = "" then
    sessionNo = 1       /* initial value is 1                         */

                        /* get the name of this program               */
  parse source . . thisProg

  if sessionNo = 1 then
  do
                        /* do initialisations only once               */
    "C:"
    "CD \"
    "MD C:\TOTO"
    "MD C:\TOTO\TOTO"
    "MD C:\TOTO\TOTO\TOTO"
    "CD C:\TOTO\TOTO\TOTO"
  end /* if sessionNo = 1 then */

  CHEMIN = "TATA\TATA\TATA.TXT"

                    /* this is an endless loop!                       */
  do i = round
    if i // 40 = 0 then
    do
                    /* start a new session every 40 rounds            */
                    /* You may use additional parameters or a private */
                    /* queue to pass global variables to the next     */
                    /* pass                                           */
      "start /c /f " thisProg  i+1  sessionNo+1

                    /* close this session                             */
      "exit"
    end /* if i // 40 = 0 then */

                    /* execute the needed OS/2 commands               */
    "DIR "CHEMIN ">NUL"

                    /* process the results here                       */
    say "session: " || sessionNo || ", round " || i || " --> RC = "rc
  end /* do i = round */

exit


  

Inf-HTML End Run - Successful