home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: CPR.ttx 2.1 (17.8.93)
- ** By Kenneth Yarnall. This code may be freely distributed.
- **
- ** Starts CPR on an executable, that is assumed to exist in the same
- ** directory as the current file, and whose name is gotten by stripping
- ** the '.c'or '.cpp' or whatever off the current filename.
- ** Accepts one command line argument, mode, which should be either 'wb'
- ** or 'cli', and is used to determine what sort of environment the program
- ** is debugged in.
- */
-
- Options RESULTS
-
- parse arg mode /* Get the mode from the command line */
-
- GetFilePath /* Gets the complete path+filename for the current doc */
- path = RESULT
-
- dotpos = LastPos('.', path)
- if dotpos ~= 0 then do
- ext = SubStr(path, dotpos+1)
- if ext ~= 'c' & ext ~= 'cpp' & ext ~= 'cxx' then do
- SetStatusBar "Must be editing a C file"
- exit 10
- end
- end
- else do
- SetStatusBar "Must be editing a C file"
- exit 10
- end
-
- executable = Left(path, dotpos-1)
-
- /* Pass the CPR commandline to the shell */
-
- Address 'COMMAND'
- 'run cpr -' || mode || ' ' || executable
-