home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / ccx1apcd.zip / CCX1APCD.CMD
OS/2 REXX Batch file  |  1998-04-20  |  2KB  |  56 lines

  1. /*REXX exec to invoke the Debugger under APPC */
  2. Parse Arg Parms '(' Debug;
  3. If Parms="?" Then Signal Help;
  4.  
  5. If Parms="" Then Do;
  6.   Parse Source . . SPath .;
  7.   SPath=Left(SPath,LastPos("\",SPath)-1);
  8. End;
  9. Else SPath=Parms;
  10. If SubStr(SPath,2,2)\=":\" Then Do;
  11.   Say "Path specification must include a drive:\";
  12.   Say "Push Enter to continue";
  13.   Parse Pull .;
  14.   Exit 16;
  15. End;
  16.  
  17. If Right(SPath,1)="\" Then SPath=Left(SPath,Length(SPath)-1);
  18. SPath=Translate(SPath);
  19. If Translate(Directory(SPath))\=SPath Then Do;
  20.   Say "Specified path ("SPath") does not exist";
  21.   Say "Push Enter to continue";
  22.   Parse Pull .;
  23.   Exit 16;
  24. End;
  25.  
  26. If Debug\="" Then Do;
  27.   RC=Value("ICLUI_TRACE","ON","OS2ENVIRONMENT");
  28.   RC=Value("ICLUI_TRACETO","STDERR","OS2ENVIRONMENT");
  29.   RC=Value("ICLUI TRACE","ON","OS2ENVIRONMENT");
  30.   RC=Value("ICLUI TRACETO","STDERR","OS2ENVIRONMENT");
  31.   ToDevice="2>TRC.OUT";
  32. End;
  33. Else ToDevice="";
  34.  
  35. /* The following must be a string of 8 characters so that   */
  36. /* it can be replaced with up to an 8 character string  */
  37. debugCmd = "idbug   "
  38.  
  39. debugCmd " -r -Qconnect=wait -Qprotocol=appc a123" ToDevice;
  40. Exit;
  41.  
  42. Help:
  43.   Parse Source . . SPath .;
  44.   I=LastPos("\",SPath);
  45.   J=LastPos(".",SPath);
  46.   Parse Value SubStr(SPath,I+1) With Cmd "." .;
  47.   Say Cmd "- invoke the MVS debugger under APPC.  This exec MUST be executed under APPC";
  48.   Say " ";
  49.   Say "    Syntax:" Cmd "<drive:path>";
  50.   Say " ";
  51.   Say "    Where:  drive:path - is an optional path specification (including drive) which";
  52.   Say "                         indicates the directory containing the debugger files";
  53.   Say " ";
  54.   Say "     Defaults: The default <drive:path> is the directory containing this command";
  55.   Exit;
  56.