home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 8.ddi / DOC.ZIP / UTIL.DOC < prev    next >
Encoding:
Text File  |  1991-02-13  |  107.9 KB  |  3,052 lines

  1. HOW TO USE THIS FILE: This file has a table of contents and
  2. an index that refer to "pages" in this file. If your editor
  3. has a search facility, you can use it to search for the page
  4. numbers listed in either the table of contents or in the index.
  5. The phrase "Page n" (where n represents the actual page number)
  6. appears at the bottom left of the "page" it refers to. Thus, at
  7. the bottom of page 1, you'll find "Page 1" as the last item on
  8. that "page."
  9.  
  10.                            UTILITIES
  11.                        TABLE OF CONTENTS
  12. ___________________________________________________________________
  13.  
  14. Chapter 1  Other utilities     1       Report by public names (/
  15. BGIOBJ: Conversion utility for         RP) . . . . . . . . . . . 27
  16. graphics drivers and fonts . . 2       Report by module (/RM)  . 27
  17.   Adding the new .OBJ files to         Report by reference
  18.   GRAPHICS.LIB . . . . . . . . 2       (/RR) . . . . . . . . . . 28
  19.   Registering the drivers and          Report by external
  20.   fonts  . . . . . . . . . . . 2       references (/RX)  . . . . 28
  21.     An example . . . . . . . . 3       Report of module sizes
  22.   The /F option  . . . . . . . 4       (/RS) . . . . . . . . . . 29
  23.   Advanced features  . . . . . 5       Report by class type
  24. CPP: The preprocessor                  (/RC) . . . . . . . . . . 29
  25. utility  . . . . . . . . . . . 8       Report of unreferenced
  26.   CPP as a macro                       symbol names (/RU)  . . . 30
  27.   preprocessor . . . . . . . . 8       Verbose reporting (/RV) . 31
  28.   An example . . . . . . . . . 9     Examples of how to use
  29. GREP: A text-search utility  . 9     OBJXREF . . . . . . . . . . 31
  30.   Command-line syntax  . . .  10       Example 1 . . . . . . . . 31
  31.   GREP options . . . . . . .  11       Example 2 . . . . . . . . 31
  32.     Order of precedence  . .  13       Example 3 . . . . . . . . 31
  33.   The search string  . . . .  13       Example 4 . . . . . . . . 32
  34.     Operators in regular             OBJXREF error messages and
  35.     expressions  . . . . . .  14     warnings  . . . . . . . . . 32
  36.   File specifications  . . .  15       Error messages  . . . . . 32
  37.   Some GREP examples . . . .  15       Warnings  . . . . . . . . 32
  38.     Example 1  . . . . . . .  15   PRJCFG  . . . . . . . . . . . 33
  39.     Example 2  . . . . . . .  16   PRJCNVT: Old projects for
  40.     Example 3  . . . . . . .  16   new . . . . . . . . . . . . . 34
  41.     Example 4  . . . . . . .  16   PRJ2MAK: From project file to
  42.     Example 5  . . . . . . .  17   MAKE file . . . . . . . . . . 34
  43.     Example 6  . . . . . . .  18   THELP: The Turbo Help
  44.     Example 7  . . . . . . .  18   utility . . . . . . . . . . . 36
  45.     Example 8  . . . . . . .  19     Loading and invoking
  46. OBJXREF: The object module           THELP . . . . . . . . . . . 36
  47. cross-reference utility  . .  19     Navigating THELP  . . . . . 36
  48.   The OBJXREF command line .  20     THELP options . . . . . . . 38
  49.     The OBJXREF command-line           /C#xx (select color)  . . 38
  50.     options  . . . . . . . .  21       /Fname (full path and name
  51.       Control options  . . .  21       for help file)  . . . . . 40
  52.       Report options . . . .  23       /H, /?, and ? (display help
  53.   Response files . . . . . .  24       screen) . . . . . . . . . 40
  54.     Free-form response                 /Kxxyy (reassign hot
  55.     files  . . . . . . . . .  25       key)  . . . . . . . . . . 40
  56.     Project files  . . . . .  25       /S (snow checking)  . . . 41
  57.     Linker response files  .  26       /U (remove THELP from
  58.   Sample OBJXREF reports . .  26       memory) . . . . . . . . . 41
  59.  
  60. Page                             i
  61.  
  62.     /W (write options to           Appendix A: Turbo Editor Macro
  63.     THELP.COM and exit)  . .  41   Language (TEML)               45
  64. TOUCH  . . . . . . . . . . .  41
  65. TRANCOPY . . . . . . . . . .  42   Index                         56
  66. TRIGRAPH: A character-conversion
  67. utility . . . . . . . . . . . 42
  68.  
  69.  
  70. Page                            ii
  71.  
  72. ===================================================================
  73. Borland C++ comes with a host of standalone utilities that you can
  74. use with your Borland C++ files or other modules. Of these, IMPDEF,
  75. IMPLIB, MAKE, TLIB, and TLINK are documented in User's Guide. The
  76. rest of them, listed below, are documented in this file.
  77.  
  78. BGIOBJ, a conversion utility for graphics drivers and fonts
  79.  
  80. CPP, the preprocessor
  81.  
  82. GREP, a file-search utility
  83.  
  84. IMPDEF, which creates a module definition file for a DLL
  85. (documented in the User's Guide)
  86.  
  87. IMPLIB, which creates an import library for a DLL (documented in
  88. User's Guide)
  89.  
  90. MAKE, the standalone program manager (documented in User's Guide)
  91.  
  92. OBJXREF, an object module cross-referencer
  93.  
  94. PRJ2MAK, which converts Borland C++ project files to MAKE files
  95.  
  96. PRJCFG, which updates options in a project file from a
  97. configuration file, or converts a project file to a configuration
  98. file
  99.  
  100. PRJCNVT, which converts Turbo C project files to the Borland C++
  101. format
  102.  
  103. THELP, the Turbo Help utility
  104.  
  105. TLIB, the Turbo Librarian (documented in User's Guide)
  106.  
  107. TLINK, the Turbo Linker (documented in User's Guide)
  108.  
  109.  
  110.  
  111.  
  112. Chapter 1 Page 1
  113.  
  114.  
  115. TOUCH, which changes the file date and time
  116.  
  117. TRANCOPY, which copies transfer items from one project to another
  118.  
  119. TRIGRAPH, a character-conversion utility
  120.  
  121. In addition, there is a powerful macro language you can use with
  122. the editor; it's called TEML, and is documented in Appendix A.
  123.  
  124. This file explains what each utility is and illustrates, with code
  125. and command-line examples, how to use them.
  126.  
  127.  
  128. BGIOBJ: Conversion utility for graphics drivers and fonts
  129.  
  130. You can use BGIOBJ to convert graphics driver files and character
  131. sets (stroked font files) to object (.OBJ) files. Once they're con-
  132. verted, you can link them into your program, making them part of
  133. the executable file. This is in addition to the graphics package's
  134. dynamic loading scheme, in which your program loads graphics
  135. drivers and character sets (stroked fonts) from disk at run time.
  136.  
  137. Linking drivers and fonts directly into your program is advanta-
  138. geous because the executable file contains all (or most) of the
  139. drivers and/or fonts it might need, and doesn't need to access the
  140. driver and font files on disk when running. However, linking the
  141. drivers and fonts into your executable file increases its size.
  142.  
  143. To convert a driver or font file to a linkable object file, use the
  144. BGIOBJ.EXE utility. This is the simplified syntax:
  145.  
  146.   BGIOBJ source_file
  147.  
  148. where source_file is the driver or font file to be converted to an
  149. object file. The object file created has the same file name as the
  150. source file, with the extension .OBJ; for example, EGAVGA.BGI
  151. yields EGAVGA.OBJ, SANS.CHR gives SANS.OBJ, and so on.
  152.  
  153.  
  154.   Adding the new .OBJ files to GRAPHICS.LIB
  155.  
  156. You should add the driver and font object modules to GRAPHICS.LIB,
  157. so the linker can locate them when it links in the graphics
  158. routines. If you don't add these new object modules to
  159. GRAPHICS.LIB, you'll have to add them to the list of files in the
  160. project (.PRJ) file, on the BCC command line, or on the TLINK com-
  161. mand line. To add these object modules to GRAPHICS.LIB, invoke TLIB
  162. with the following command line:
  163.  
  164.   tlib graphics + object_file_name [+ object_file_name ...]
  165.  
  166. where object_file_name is the name of the object file created by
  167. BGIOBJ.EXE (such as CGA, EGAVGA, GOTH, and so forth). The .OBJ
  168. extension is implied, so you don't need to include it. You can add
  169. several files with one command line to save time; see the example
  170. in the following section.
  171.  
  172.  
  173.  
  174.  
  175. Chapter 1 Page 2                                                  BGIOBJ
  176.  
  177.  
  178.  Registering the drivers and fonts
  179.  
  180. After adding driver and font object modules to GRAPHICS.LIB, you
  181. have to register all the drivers and fonts that you want linked in;
  182. you do this by calling registerbgidriver and registerbgifont in
  183. your program (before calling initgraph). This informs the graphics
  184. system of the presence of those files, and ensures that they will
  185. be linked in when the executable file is created by the linker.
  186.  
  187. The registering routines each take one parameter; a symbolic name
  188. defined in graphics.h. Each registering routine returns a
  189. nonnegative value if the driver or font is successfully registered.
  190.  
  191. The following table shows the names to be used with
  192. registerbgidriver and registerbgifont. It is a complete list of
  193. drivers and fonts included with Borland C++.
  194. ___________________________________________________________________
  195.  
  196.  Driver file    registerbgidriver    Font file   registerbgifont
  197.  (*.BGI)        symbolic name        (*.CHR)     symbolic name
  198. -------------------------------------------------------------------
  199.  
  200.  CGA            CGA_driver            TRIP       triplex_font
  201.  EGAVGA         EGAVGA_driver         LITT       small_font
  202.  HERC           Herc_driver           SANS       sansserif_font
  203.  ATT            ATT_driver            GOTH       gothic_font
  204.  PC3270         PC3270_driver
  205.  IBM8514        IBM8514_driver
  206. ___________________________________________________________________
  207.  
  208.   An example
  209.  
  210. Suppose you want to convert the files for the CGA graphics driver,
  211. the gothic font, and the triplex font to object modules, then link
  212. them into your program. Here's what you do:
  213.  
  214. 1. Convert the binary files to object files using BGIOBJ.EXE, as
  215.    shown in the following separate command lines:
  216.  
  217.      bgiobj  cga
  218.      bgiobj  trip
  219.      bgiobj  goth
  220.  
  221.    This creates three files: CGA.OBJ, TRIP.OBJ, and GOTH.OBJ.
  222.  
  223. 2. You can add these object files to GRAPHICS.LIB with this TLIB
  224.    command line:
  225.  
  226.       tlib  graphics  +cga  +trip  +goth
  227.  
  228.  
  229.  
  230. Chapter 1 Page 3                                                  BGIOBJ
  231.  
  232.  
  233.  
  234. 3. If you don't add the object files to GRAPHICS.LIB, you must add
  235.    the object file names CGA.OBJ, TRIP.OBJ, and GOTH.OBJ to your
  236.    project list (if you are using Borland C++'s integrated
  237.    environment), or to the BCC command line. For example, the BCC
  238.    command line would look like this:
  239.  
  240.       BCC  niftgraf graphics.lib  cga.obj  trip.obj  goth.obj
  241.  
  242. 4. You register these files in your graphics program like this:
  243.  
  244. Note:  If you ever get a linker error "Segment exceeds 64K" after linking
  245. in some drivers and/or fonts, refer to the following section.
  246.  
  247.      /* Header file declares CGA_driver, triplex_font & gothic_font */
  248.      #include <graphics.h>
  249.  
  250.      /* Register and check for errors (one never knows...) */
  251.  
  252.      if (registerbgidriver(CGA_driver) < 0) exit(1);
  253.      if (registerbgifont(triplex_font) < 0) exit(1);
  254.      if (registerbgifont(gothic_font)  < 0) exit(1);
  255.  
  256.      /* ... */
  257.  
  258.      initgraph(....);     /* initgraph should be called after registering */
  259.  
  260.      /* ... */
  261.  
  262.  
  263.    The /F option
  264.  
  265. This section explains what steps to take if you get the linker
  266. error "Segment exceeds 64K" (or a similar error) after linking in
  267. several driver and/or font files (especially with small- and
  268. compact-model programs).
  269.  
  270. By default, the files created by BGIOBJ.EXE all use the same
  271. segment (called _TEXT). This can cause problems if your program
  272. links in many drivers and/or fonts, or when you're using the small
  273. or compact memory model.
  274.  
  275. To solve this problem, you can convert one or more of the drivers
  276. or fonts with the BGIOBJ /F option. This option directs BGIOBJ to
  277. use a segment name of the form filename_TEXT, so that the default
  278. segment is not overburdened by all the linked-in drivers and fonts
  279. (and, in small and compact model programs, all the program code).
  280. For example, the following two BGIOBJ command lines direct BGIOBJ
  281. to use segment names of the form EGAVGA_TEXT and SANS_TEXT.
  282.  
  283.   bgiobj  /F  egavga
  284.   bgiobj  /F  sans
  285.  
  286.  
  287.  
  288. Chapter 1 Page 4                                                  BGIOBJ
  289.  
  290.  
  291. When you select /F, BGIOBJ also appends F to the target object file
  292. name (EGAVGAF.OBJ, SANSF.OBJ, and so forth), and appends _far to
  293. the name that will be used with registerfarbgidriver and registerfarbgifont.
  294. (For example, EGAVGA_driver becomes EGAVGA_driver_far.)
  295.  
  296. For files created with /F, you must use these far registering
  297. routines instead of the regular registerbgidriver and
  298. registerbgifont. For example,
  299.  
  300.   if (registerfarbgidriver(EGAVGA_driver_far) < 0) exit(1);
  301.   if (registerfarbgifont(sansserif_font_far)  < 0) exit(1);
  302.  
  303.  
  304.   Advanced features
  305.  
  306. This section explains some of BGIOBJ's advanced features, and the
  307. routines registerfarbgidriver and registerfarbgifont. Only
  308. experienced users should use these features.
  309.  
  310. This is the full syntax of the BGIOBJ.EXE command line:
  311.  
  312.    BGIOBJ  [/F] source destination public-name seg-name seg-class
  313.  
  314. This table describes each component of the BGIOBJ command line.
  315. ___________________________________________________________________
  316.  
  317. Component      Description
  318. ___________________________________________________________________
  319.  
  320.  
  321. /F or -F       This option instructs BGIOBJ.EXE to use a segment name
  322.                other than _TEXT (the default), and to change the public
  323.                name and destination file name. (See page 4 for a detailed
  324.                discussion of /F.)
  325.  
  326. <source>       This is the driver or font file to be converted. If the
  327.                file is not one of the driver/font files shipped with
  328.                Borland C++, you should specify a full file name (including
  329.                extension).
  330.  
  331. <destination>  This is the name of the object file to be produced. The
  332.                default destination file name is source.OBJ, or sourceF.OBJ
  333.                if you use the /F option.
  334.  
  335. public-name    This is the name that will be used in the program in a call
  336.                to registerbgidriver or registerbgifont (or their
  337.                respective far versions) to link in the object module.
  338.  
  339.                The public name is the external name used by the linker, so
  340.                it should be the name used in the program, prefixed with an
  341.                underscore. If your program uses Pascal calling conventions,
  342.                use only uppercase letters, and do not add an underscore.
  343.  
  344.  
  345.  
  346. Chapter 1 Page 5                                                  BGIOBJ
  347.  
  348.  
  349. seg-name       This is an optional segment name; the default is _TEXT (or
  350.                filename_TEXT if /F is specified)
  351.  
  352. seg-class      This is an optional segment class; the default is CODE.
  353. ___________________________________________________________________
  354.  
  355. All parameters except source are optional. However, if you need to
  356. specify an optional parameter, all the parameters preceding it must
  357. also be specified.
  358.  
  359. If you choose to use your own public name(s), you have to add
  360. declaration(s) to your program, using one of the following forms:
  361.  
  362.   void public_name(void);        /* if /F not used, */
  363.                                  /* default segment name used */
  364.  
  365.   extern int far public_name[];  /* if /F used, or */
  366.                                  /* segment name not _TEXT */
  367.  
  368. In these declarations, public_name matches the public-name you used
  369. when converting with BGIOBJ. The graphics.h header file contains
  370. declarations of the default driver and font public names; if you
  371. use those default public names you don't have to declare them as
  372. just described.
  373.  
  374. After these declarations, you have to register all the drivers and
  375. fonts in your program. If you don't use the /F option and don't
  376. change the default segment name, you should register drivers and
  377. fonts through registerbgidriver and registerbgifont; otherwise, use
  378. registerfarbgidriver and registerfarbgifont.
  379.  
  380. Here is an example of a program that loads a font file into memory:
  381.  
  382.   /* Example of loading a font file into memory */
  383.  
  384.   #include <graphics.h>
  385.   #include <io.h>
  386.   #include <fcntl.h>
  387.   #include <stdio.h>
  388.   #include <conio.h>
  389.   #include <stdlib.h>
  390.   #include <process.h>
  391.   #include <alloc.h>
  392.  
  393.   main()
  394.   {
  395.  
  396.  
  397.  
  398.  
  399. Chapter 1 Page 6                                                  BGIOBJ
  400.  
  401.  
  402.      void    *gothic_fontp;    /* points to font buffer in memory */
  403.      int      handle;          /* file handle used for I/O */
  404.      unsigned fsize;           /* size of file (and buffer) */
  405.  
  406.      int errorcode;
  407.      int graphdriver;
  408.      int graphmode;
  409.  
  410.   /* open font file */
  411.      handle = open("GOTH.CHR", O_RDONLY|O_BINARY);
  412.      if (handle == -1)
  413.      {
  414.         printf("unable to open font file 'GOTH.CHR'\n");
  415.         exit(1);
  416.      }
  417.   /* find out size of the file */
  418.      fsize = filelength(handle);
  419.   /* allocate buffer */
  420.      gothic_fontp = malloc(fsize);
  421.      if (gothic_fontp == NULL)
  422.      {
  423.        printf("unable to allocate memory for font file 'GOTH.CHR'\n");
  424.        exit(1);
  425.      }
  426.   /* read font into memory */
  427.      if (read(handle, gothic_fontp, fsize) != fsize)
  428.      {
  429.         printf("unable to read font file 'GOTH.CHR'\n");
  430.         exit(1);
  431.      }
  432.   /* close font file */
  433.      close(handle);
  434.   /* register font */
  435.      if (registerfarbgifont(gothic_fontp) != GOTHIC_FONT)
  436.      {
  437.         printf("unable to register font file 'GOTH.CHR'\n");
  438.         exit(1);
  439.      }
  440.   /* detect and initialize graphix */
  441.      graphdriver = DETECT;
  442.      initgraph(&graphdriver, &graphmode, "..");
  443.      errorcode = graphresult();
  444.      if (errorcode != grOk)
  445.      {
  446.         printf("graphics error: %s\n",grapherrormsg(errorcode));
  447.         exit(1);
  448.      }
  449.      settextjustify(CENTER_TEXT, CENTER_TEXT);
  450.      settextstyle(GOTHIC_FONT, HORIZ_DIR, 4);
  451.      outtextxy(getmaxx()/2,getmaxy()/2, "Borland Graphics Interface (BGI)");
  452.  
  453.  
  454.  
  455. Chapter 1 Page 7
  456.  
  457.  
  458.   /* press a key to terminate */
  459.      getch();
  460.   /* shut down graphics system */
  461.      closegraph();
  462.      return(0);
  463.   }
  464.  
  465.  
  466. CPP: The preprocessor utility
  467.  
  468. CPP produces a list (in a file) of a C source program in which
  469. include files and #define macros have been expanded. It is not
  470. needed for normal compilations of C programs.
  471.  
  472. Often, when the compiler reports an error inside a macro or an
  473. include file, you can get more information about what the error is
  474. if you can see the include files or the results of the macro
  475. expansions. In many multi-pass compilers, a separate pass performs
  476. this work, and the results of the pass can be examined. Since
  477. Borland C++ uses an integrated single-pass compiler, we provided
  478. CPP to supply the first-pass functionality found in other compil-
  479. ers.
  480.  
  481. You use CPP just as you would use BCC, the standalone compiler. CPP
  482. reads the same TURBOC.CFG file for default options, and accepts the
  483. same command-line options as BCC.
  484.  
  485. The BCC options that don't pertain to CPP are simply ignored by
  486. CPP. To see the list of arguments handled by CPP, type cpp at the
  487. DOS prompt.
  488.  
  489. With one exception, the file names listed on the CPP command line
  490. are treated like they are in BCC, with wildcards allowed. The
  491. exception to this is that all files are treated as C source files.
  492. There is no special treatment for .OBJ, .LIB, or .ASM files.
  493.  
  494. For each file processed by CPP, the output is written to a file in
  495. the current directory (or the output directory named by the -n
  496. option) with the same name as the source name but with an extension
  497. of .I.
  498.  
  499. This output file is a text file containing each line of the source
  500. file and any include files. Any preprocessing directive lines have
  501. been removed, along with any conditional text lines excluded from
  502. the compile. Unless you use a command-line option to specify other-
  503. wise, text lines are prefixed with the file name and line number of
  504. the source or include file the line came from. Within a text line,
  505. any macros are replaced with their expansion text.
  506.  
  507. Important!
  508. The resulting output of CPP cannot be compiled because of the file
  509. name and line number prefix attached to each source line.
  510.  
  511.  
  512.  
  513. Chapter 1 Page 8                                                  CPP
  514.  
  515.  
  516.   CPP as a macro preprocessor
  517. The -P option to CPP tells it to prefix each line with the source
  518. file line number. If you give it -P- (turning this option
  519. off), CPP omits this line number information. With this option
  520. turned off, CPP can be used as a macro preprocessor; the resulting
  521. .I file can then be compiled with BC or BCC.
  522.  
  523.  
  524.   An example
  525. The following simple program illustrates how CPP preprocesses a
  526. file, first with -P selected, then with -P-.
  527.  
  528. Source file: HELLOAJ.C
  529.   #define NAME "AJ McInnis"
  530.   #define BEGIN {
  531.   #define END   }
  532.  
  533.   main()
  534.   BEGIN
  535.      printf("%s\n", NAME);
  536.   END
  537.  
  538. Command line used to invoke CPP as a preprocessor:
  539.    CPP HELLOAJ.C
  540.  
  541. Output:
  542.   HELLOAJ.c 1:
  543.   HELLOAJ.c 2:
  544.   HELLOAJ.c 3:
  545.   HELLOAJ.c 4:
  546.   HELLOAJ.c 5: main()
  547.   HELLOAJ.c 6: {
  548.   HELLOAJ.c 7:    printf("%s\n","AJ McInnis");
  549.   HELLOAJ.c 8: }
  550.  
  551. Command line used to invoke CPP as a macro preprocessor:
  552.    CPP -P- HELLOAJ.C
  553.  
  554. Output:
  555.   main()
  556.   {
  557.      printf("%s\n","AJ McInnis");
  558.   }
  559.  
  560.  
  561. GREP: A text-search utility
  562.  
  563. GREP (Global Regular Expression Print) is a powerful text-search
  564. program derived from the UNIX utility of the same name. GREP
  565. searches for a text pattern in one or more files or in its standard
  566. input stream.
  567.  
  568.  
  569.  
  570. Chapter 1 Page 9                                                  GREP
  571.  
  572.  
  573. Here's a quick example of a situation where you might want to use
  574. GREP. Suppose you wanted to find out which text files in your
  575. current directory contained the string "Elisabeth." You would issue
  576. the command
  577.  
  578.    grep Elisabeth *.txt
  579.  
  580. and GREP would respond with a list of the lines in each file (if
  581. any) that contained the string "Elisabeth". Because the default for
  582. GREP is case sensitive, the strings "elisabeth" and "ELISABETH"
  583. would be considered different. You can use options to make your
  584. search to ignore case.
  585.  
  586. GREP can do a lot more than match a single, fixed string. In the
  587. section that follows, you'll see how to make GREP search for any
  588. string that matches a particular pattern.
  589.  
  590.  
  591.   Command-line syntax
  592. The command-line syntax for GREP is
  593.  
  594.   grep [options] searchstring [file(s) ... ]
  595.  
  596. options consist of one or more letters, preceded by a hyphen (-),
  597. that let you change various aspects of GREP's behavior.
  598.  
  599. searchstring gives the pattern to search for.
  600.  
  601. file(s) tells GREP which files to search. (If you don't specify a
  602. file, GREP searches its standard input; this lets you use GREP with
  603. pipes and redirection.) If you find that the results of your GREP
  604. are longer than one screen, you can redirect the output to a file.
  605. For example, you could use this command
  606.  
  607.    GREP "Elisabeth McInnis" *.txt >gfile
  608.  
  609. which searches all files in the current directory that end with
  610. .TXT, then places the results in a file called GFILE. (You can name
  611. this file anything you like.) Then, use your word processor (or
  612. Borland C++'s eidotr) to access GFILE to read the results of the
  613. search.
  614.  
  615. The command
  616.  
  617.    GREP ?
  618.  
  619. prints a brief help screen showing GREP's command-line options,
  620. special characters, and defaults. (See the description of the -u
  621. command-line option for information on how to change GREP's
  622. defaults.)
  623.  
  624.  
  625.  
  626. Chapter 1 Page 10                                                 GREP
  627.  
  628.  
  629.   GREP options
  630.  
  631. In the command line, options are one or more single characters
  632. preceded by a hyphen (-). Each individual character is a switch
  633. that you can turn on or off: A plus symbol (+) after a character
  634. turns the option on; a hyphen (-) after the character turns the
  635. option off. The + sign is optional; for example, -r means the same
  636. thing as -r+. You can list multiple options individually (like
  637. this: -i -d -l), or you can combine them (like this: -ild or -il,
  638. -d, and so on); it's all the same to GREP.
  639.  
  640. Here are the GREP option characters and their meanings:
  641. __________________________________________________________
  642.  
  643. Option Meaning
  644. ----------------------------------------------------------
  645.  
  646.  
  647.   -c   Match Count only: Prints only a count of matching
  648.        lines. For each file that contains at least one
  649.        matching line, GREP prints the file name and a
  650.        count of the number of matching lines. Matching
  651.        lines are not printed. This option is off by
  652.        default.
  653.  
  654.   -d   Search subdirectories: For each file specified on
  655.        the command line, GREP searches for all files that
  656.        match the file specification, both in the directory
  657.        specified and in all subdirectories below the
  658.        specified directory. If you give a file without a
  659.        path, GREP assumes the files are in the current
  660.        directory. This option is off by default.
  661.  
  662.   -i   Ignore case: GREP ignores upper/lowercase
  663.        differences (case folding). When this option is on,
  664.        GREP treats all letters a to z as identical to the
  665.        corresponding letters A to Z in all situations.
  666.        This option is off by default.
  667.  
  668.   -l   List file names only: Prints only the name of each
  669.        file containing a match. After GREP finds a match,
  670.        it prints the file name and processing immediately
  671.        moves on to the next file. This option is off by
  672.        default.
  673.  
  674.   -n   Line Numbers: Each matching line that GREP prints
  675.        is preceded by its line number. This option is off
  676.        by default.
  677.  
  678.   -o   UNIX output format: Changes the output format of
  679.        matching lines to support more easily the UNIX
  680.        style of command-line piping. All lines of output
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687. Chapter 1 Page 11                                                 GREP
  688.  
  689.  
  690.        are preceded by the name of the file that contained
  691.        the matching line. This option is off by default.
  692.  
  693.   -r   Regular expression search: The text defined by
  694.        searchstring is treated as a regular expression
  695.        instead of as a literal string. This option is on
  696.        by default. This option is on by default.
  697.  
  698.        A regular expression is one or more occurrences of
  699.        one or more characters optionally enclosed in
  700.        quotes. The following symbols are treated
  701.        specially:
  702.         ^  start of line       $  end of line
  703.         .  any character       \  quote next character
  704.         *  match zero or more  +  match one or more
  705.  
  706.         [aeiou0-9]             match a, e, i, o, u, and 0
  707.                                thru 9
  708.         [^aeiou0-9]            match anything but a, e, i,
  709.                                o, u, and 0 thru 9
  710.  
  711.   -u   Update options: GREP will combine the options given
  712.        on the command line with its default options and
  713.        write these to the GREP.COM file as the new
  714.        defaults. (In other words, GREP is self-
  715.        configuring.) This option allows you to tailor the
  716.        default option settings to your own taste. If you
  717.        want to see what the defaults are in a particular
  718.        copy of GREP.COM, type
  719.  
  720.         GREP ?
  721.  
  722.        at the DOS prompt. Each option on the help screen
  723.        will be followed by a + or a - depending on its
  724.        default setting. This option is off by default.
  725.  
  726.   -v   Nonmatch: Prints only nonmatching lines. Only lines
  727.        that do not contain the search string are
  728.        considered to be nonmatching lines. This option is
  729.        off by default.
  730.  
  731.   -w   Word search: Text found that matches the regular
  732.        expression is considered a match only if the
  733.        character immediately preceding and following
  734.        cannot be part of a word. The default word
  735.        character set includes A to Z, 0 to 9, and the
  736.        underscore ( _ ). This option is off by default.
  737.  
  738.        An alternate form of this option lets you specify
  739.        the set of legal word characters. Its form is -
  740.        w[set], where set is any valid regular expression
  741.        set definition.
  742.  
  743.  
  744.  
  745. Chapter 1 Page 12                                                 GREP
  746.  
  747.  
  748.        If you define the set with alphabetic characters,
  749.        it is automatically defined to contain both the
  750.        uppercase and lowercase values for each letter in
  751.        the set (regardless of how it is typed), even if
  752.        the search is case-sensitive. If you use the -w
  753.        option in combination with the -u option, the new
  754.        set of legal characters is saved as the default
  755.        set.
  756.  
  757.   -z   Verbose: GREP prints the file name of every file
  758.        searched. Each matching line is preceded by its
  759.        line number. A count of matching lines in each file
  760.        is given, even if the count is zero. This option is
  761.        off by default.
  762. __________________________________________________________
  763.  
  764.  
  765.   Order of precedence
  766. Remember that each of GREP's options is a switch: Its state reflects
  767. what you last set it. At any given time, each option can only be on
  768. or off. Each occurrence of a given option on the command line
  769. overrides its previous definition. Given this command line,
  770.  
  771.    grep -r -i- -d -i -r-  main( my*.c
  772.  
  773. GREP runs with the -d option on, the -i option on, and the -r option
  774. off.
  775.  
  776. You can install your preferred default setting for each option in
  777. GREP.COM with the -u option. For example, if you want GREP to always
  778. do a verbose search (-z on), you can install it with the following
  779. command:
  780.  
  781.    grep -u -z
  782.  
  783.  
  784.   The search string
  785. To use GREP well, you'll need to become proficient at writing search
  786. strings. The value of <searchstring> defines the pattern GREP searches
  787. for. A search string can be either a regular expression or a literal
  788. string.
  789.  
  790. In a regular expression, certain characters have special meanings:
  791. They are operators that govern the search.
  792.  
  793. In a literal string, there are no operators: Each character is treated
  794. literally.
  795.  
  796. You can enclose the search string in quotation marks to prevent spaces
  797. and tabs from being treated as delimiters. The text matched by the
  798. search string cannot cross line boundaries; that is, all the text
  799. necessary to match the pattern must be on a single line.
  800.  
  801.  
  802.  
  803. Chapter 1 Page 13                                                 GREP
  804.  
  805.  
  806. A regular expression is either a single character or a set of
  807. characters enclosed in brackets. A concatenation of regular
  808. expressions is a regular expression.
  809.  
  810.  
  811.   Operators in regular expressions
  812. When you use the -r option (on by default), the search string is
  813. treated as a regular expression (not a literal expression). The
  814. following characters take on special meanings:
  815. __________________________________________________________
  816.  
  817. Option Meaning
  818. ----------------------------------------------------------
  819.  
  820.   ^    A circumflex at the start of the expression matches
  821.        the start of a line.
  822.  
  823.   $    A dollar sign at the end of the expression matches
  824.        the end of a line.
  825.  
  826.   .    A period matches any character.
  827.  
  828.   *    An expression followed by an asterisk wildcard
  829.        matches zero or more occurrences of that
  830.        expression. For example, in to*, the * operates on
  831.        the expression o; it matches t, to, too, etc. (t
  832.        followed by zero or more os), but doesn't match ta.
  833.  
  834.   +    An expression followed by a plus sign matches one
  835.        or more occurrences of that expression: to+ matches
  836.        to, too, etc., but not t.
  837.  
  838.   [ ]  A string enclosed in brackets matches any character
  839.        in that string, but no others. If the first
  840.        character in the string is a circumflex (^), the
  841.        expression matches any character except the
  842.        characters in the string.
  843.  
  844.        For example, [xyz] matches x, y, or z, while [^xyz]
  845.        matches a and b, but not x, y, or z. You can
  846.        specify a range of characters with two characters
  847.        separated by a hyphen (-). These can be combined to
  848.        form expressions (like [a-bd-z?], which matches the
  849.        ? character and any lowercase letter except c).
  850.  
  851.   \    The backslash escape character tells GREP to search
  852.        for the literal character that follows it. For
  853.        example, \. matches a period instead of "any
  854.        character." The backslash can be used to quote
  855.        itself; that is, you can use \\ to indicate a
  856.        literal backslash character in a GREP expression.
  857. ___________________________________________________________
  858.  
  859.  
  860.  
  861. Chapter 1 Page 14                                                 GREP
  862.  
  863.  
  864. Note: Four of the "special" characters ($, ., *, and +) don't have any
  865. special meaning when used within a bracketed set. In addition, the
  866. character ^ is only treated specially if it immediately follows the
  867. beginning of the set definition (immediately after the [
  868. delimiter).
  869.  
  870. Any ordinary character not mentioned in the preceding list matches
  871. that character. For example, the greater than sign, >, matches the
  872. greater than sign (>), # matches #, and so on.
  873.  
  874.  
  875.   File specifications
  876.  
  877. <file(s)> tells GREP which files (or groups of files) to search.
  878. <file(s)> can be an explicit file name, or a "generic" file name
  879. incorporating the DOS ? and * wildcards. In addition, you can enter
  880. a path (drive and directory information) as part of file(s). If you
  881. give file(s) without a path, GREP searches the current directory.
  882.  
  883. If you don't specify any files, input to GREP must come from
  884. redirection (<) or a vertical bar (|).
  885.  
  886.  
  887.   Some GREP examples
  888. The following examples show how to combine GREP's features to do
  889. different kinds of searches. They assume GREP's default settings
  890. are unchanged.
  891.  
  892.  
  893.   Example 1
  894. The search string here tells GREP to search for the word main with
  895. no preceding lowercase letters ([^a-z]), followed by zero or more
  896. occurrences of blank spaces (\ *), then a left parenthesis.
  897.  
  898. Since spaces and tabs are normally considered to be command-line
  899. delimiters, you must quote them if you want to include them as part
  900. of a regular expression. In this case, the space after main is
  901. quoted with the backslash escape character. You could also
  902. accomplish this by placing the space in double quotes.
  903.  
  904. Command line:
  905.             grep -r [^a-z]main\ *( *.c
  906.  
  907. Matches:    main(i:integer)
  908.             main(i,j:integer)
  909.             if (main  ()) halt;
  910.             if (MAIN  ()) halt;
  911.  
  912. Does not match:
  913.             mymain()
  914.  
  915. Files searched:
  916.             *.C in current directory.
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923. Chapter 1 Page 15                                                 GREP
  924.  
  925.  
  926.   Example 2
  927. Because the backslash (\) and period (.) characters usually have special
  928. meaning in path and file names, you must place the backslash escape
  929. character immediate- ly in front of them if you want to search
  930. for them. The -i option is used here, so the search is not case
  931. sensitive.
  932.  
  933. Command line:
  934.             grep -ri [a-c]:\\data\.fil *.c *.inc
  935.  
  936. Matches:    A:\data.fil
  937.             c:\Data.Fil
  938.             B:\DATA.FIL
  939.  
  940. Does not match:
  941.             d:\data.fil
  942.             a:data.fil
  943.  
  944. Files searched:
  945.             *.C and *.INC in current directory.
  946.  
  947.  
  948.   Example 3
  949. This format defines how to search for a given word.
  950.  
  951. Command line:
  952.             grep -ri [^a-z]word[^a-z] *.doc
  953.  
  954. Matches:    every new word must be on a new line.
  955.             MY WORD!
  956.             word--smallest unit of speech.
  957.             In the beginning there was the WORD, and the WORD
  958.  
  959. Does not match:
  960.             Each file has at least 2000 words.
  961.             He misspells toward as toword.
  962.  
  963. Files searched:
  964.             *.DOC in the current directory.
  965.  
  966.  
  967.  
  968. Chapter 1 Page 16                                                 GREP
  969.  
  970.  
  971.   Example 4
  972. This format defines another, even more basic single-word search.
  973.  
  974. Command line:    grep -iw word *.doc
  975.  
  976. Matches:         every new word must be on a new line  However,
  977.                  MY WORD!
  978.                  word: smallest unit of speech which conveys
  979.                  In the beginning there was the WORD, and
  980.  
  981. Does not match:  each document contains at least 2000 words!
  982.                  He seems to continually misspell "toward" as "toword."
  983.  
  984. Files searched:  *.DOC in the current directory.
  985.  
  986.  
  987.   Example 5
  988. This is an example of how to search for a string with embedded spaces.
  989.  
  990. Command line:    grep "search string with spaces" *.doc *.c a:\work\myfile.*
  991.  
  992. Matches:         This is a search string with spaces in it.
  993.  
  994. Does not match:  This search string has spaces in it.
  995.  
  996. Files searched:  *.DOC and *.C in the current directory, and MYFILE.* in a
  997.                  directory called \WORK on drive A.
  998.  
  999. Chapter 1 Page 17 GREP
  1000.  
  1001.  
  1002.   Example 6
  1003. This example searches for any one of the characters " . : ? ' and , at
  1004. the end of a line.
  1005.  
  1006. The double quote within the range is preceded by an escape character so
  1007. it is treated as a normal character instead of as the ending quote for
  1008. the string. Also, the $ character appears outside of the quoted string.
  1009. This demonstrates how regular expressions can be concatenated to form a
  1010. longer expression.
  1011.  
  1012. Command line:    grep -rd "[ ,.:?'\"]"$ \*.doc
  1013.  
  1014. Matches:         He said hi to me.
  1015.                  Where are you going?
  1016.                  In anticipation of a unique situation,
  1017.                  Examples include the following:
  1018.                  "Many men smoke, but  fu man chu."
  1019.  
  1020. Does not match:  He said "Hi" to me
  1021.                  Where are you going? I'm headed to the
  1022.  
  1023. Files searched:  *.DOC in the root directory and all its subdirectories on
  1024.                  the current drive.
  1025.  
  1026.  
  1027.   Example 7
  1028. This example ignores case and just prints the names of any files that
  1029. contain at least one match. The three command-line examples show
  1030. different ways of specifying multiple options.
  1031.  
  1032. Command line:    grep -ild " the " \*.doc
  1033.                        or
  1034.                  grep -i -l -d " the " \*.doc
  1035.                        or
  1036.                  grep -il -d " the " \*.doc
  1037.  
  1038. Chapter 1 Page 18                                                 GREP
  1039.  
  1040.  
  1041. Matches:         Anyway, this is the time we have
  1042.                  do you think? The main reason we are
  1043.  
  1044. Does not match:  He said "Hi" to me just when I
  1045.                  Where are you going? I'll bet you're headed
  1046.  
  1047. Files searched:  *.DOC in the root directory and all its subdirectories on
  1048.                  the current drive.
  1049.  
  1050.  
  1051.   Example 8
  1052. This example redefines the current set of legal characters for a word as the
  1053. assignment operator (=) only, then does a word search. It matches C assignment
  1054. statements, which use a single equal sign (=), but not equality tests, which
  1055. use a double equal sign (==).
  1056.  
  1057. Command line:    grep -w[=] = *.c
  1058.  
  1059. Matches:         i = 5;
  1060.                  j=5;
  1061.                  i += j;
  1062.  
  1063. Does not match:  if (i == t) j++;
  1064.                  /* ======================= */
  1065.  
  1066. Files searched:  *.C in the current directory.
  1067.  
  1068.  
  1069. OBJXREF: The object module cross-reference utility
  1070.  
  1071. OBJXREF examines a list of object files and library files and produces
  1072. reports on their contents. One type of report lists definitions of public
  1073. names and references to them. The other type lists the segment sizes
  1074. defined by object modules.
  1075.  
  1076.  
  1077.  
  1078. Chapter 1 Page 19                                                 OBJXREF
  1079.  
  1080.  
  1081. There are two categories of public names: global variables and function
  1082. names. The TEST1.C and TEST2.C files in the section "Sample OBJXREF
  1083. reports" (page 26) illustrate definitions of public names and external
  1084. references to them.
  1085.  
  1086. Object modules are object (.OBJ) files produced by BC, BCC or TASM. A library
  1087. (.LIB) file contains multiple object modules. An object module generated by BC
  1088. is given the same name as the .C source file it was compiled from. This is also
  1089. true for BCC, unless a different output file name is specifically indicated
  1090. with the -o BCC command-line option.
  1091.  
  1092.  
  1093. The OBJXREF command line
  1094. The OBJXREF command line consists of the word OBJXREF followed by a series of
  1095. command-line options and a list of object and library file names, separated
  1096. by a space or tab character. The syntax is as follows:
  1097.  
  1098.   OBJXREF  options   filename  filename
  1099.   ...
  1100.  
  1101. The command-line options determine the kind of reports that OBJXREF will
  1102. generate and the amount of detail that OBJXREF will provide. They are discussed
  1103. in more detail in the next section.
  1104.  
  1105. Each option begins with a forward slash (/) followed by a one- or two-character
  1106. option name.
  1107.  
  1108. Object files and library files may be specified either on the command line or
  1109. in a response file. On the command line, file names are separated by a space
  1110. or a tab. All object modules specified as .OBJ files are included in reports.
  1111. Like TLINK, however, OBJXREF includes only those modules from .LIB files which
  1112. contain a public name referenced by an .OBJ file or by a previously included
  1113. module from a .LIB file.
  1114.  
  1115.  
  1116.  
  1117. Chapter 1 Page 20                                                 OBJXREF
  1118.  
  1119.  
  1120. As a general rule, you should list all the .OBJ and .LIB files that are needed
  1121. if the program is to link correctly, including the startup .OBJ file and one
  1122. or more C libraries.
  1123.  
  1124. File names may include a drive and directory path. The DOS ? and * wildcard
  1125. characters may be used to identify more than one file. File names may refer to
  1126. .OBJ object files or to .LIB library files. (If you don't give a file exten-
  1127. sion, the .OBJ extension is assumed.)
  1128.  
  1129. Options and file names may occur in any order in the command line.
  1130.  
  1131. OBJXREF reports are written to the DOS standard output. The default is the
  1132. screen. The reports can be sent to a printer (as with >LPT1:) or to a file (as
  1133. with >lstfile) with the DOS redirection character (>).
  1134.  
  1135. Entering OBJXREF with no file names or options produces a summary of available
  1136. options.
  1137.  
  1138.  
  1139.   The OBJXREF command-line options
  1140. ON+BJXREF command-line options fall into  two categories: control options and
  1141. report options
  1142.  
  1143.  
  1144.     Control options
  1145.  
  1146. Control options modify the default behavior of OBJXREF (the default is that
  1147. none of these options are enabled).
  1148. _______________________________________________________________________
  1149.  
  1150. Option Meaning
  1151. -----------------------------------------------------------------------
  1152.  
  1153.  
  1154.   /I   Ignore case differences in public names. Use this option if you use
  1155.        TLINK without the /C option (which makes case differences
  1156.        significant).
  1157.  
  1158.   /D   Look for .OBJ files in another directory. If you want OBJXREF to
  1159.        look for .OBJ files in a directory other than the current one,
  1160.  
  1161.  
  1162.  
  1163. Chapter 1 Page 21 OBJXREF
  1164.  
  1165.  
  1166.        include the directory name on the command line, prefixed with /D:
  1167.  
  1168.           OBJXREF /Ddir1 [; dir2 [; dir3]]
  1169.  
  1170.        or
  1171.  
  1172.           OBJXREF /Ddir1 [/Ddir2] [/Ddir3]
  1173.  
  1174.        OBJXREF will search each of the directories in the specified order
  1175.        for all object and library files.
  1176.  
  1177. Important!
  1178.        If you don't use a /D option, OBJXREF will search only the
  1179.        current directory. If you do use a /D option, however, the current
  1180.        directory will not be searched unless it is included in the
  1181.        directory list. For example, if you wanted OBJXREF to search first
  1182.        the BORLAND directory and then the current directory for files, you
  1183.        would enter
  1184.  
  1185.           OBJXREF /Dborland;.
  1186.  
  1187.        The period denotes the current directory.
  1188.  
  1189.  
  1190.   /F   Include full library. All object modules in specified .LIB files
  1191.        are included even if they do not contain public names that are
  1192.        referenced by an object module being processed by OBJXREF. This
  1193.        provides information on the entire contents of a library file. (See
  1194.        example 4 in the section "OBJXREF examples.")
  1195.  
  1196.   /O   Allows you to specify an output file where OBJXREF will send any
  1197.        reports generated. Its syntax is as follows:
  1198.  
  1199.           OBJXREF filename.obj /report option /Ooutputfilename.ext
  1200.  
  1201.        By default all output is sent to the screen.
  1202.  
  1203.  
  1204.  
  1205. Chapter 1 Page 22                                                 OBJXREF
  1206.  
  1207.  
  1208.   /V   Verbose output. Lists names of files read and displays totals of
  1209.        public names, modules, segments, and classes.
  1210.  
  1211.   /Z   Include zero-length segment definitions. Object modules may
  1212.        define a segment without allocating any space in it.
  1213.        Listing these zero length segment definitions normally makes the
  1214.        module size reports harder to use but it can be valuable if you are
  1215.        trying to remove all definitions of a segment.
  1216. _______________________________________________________________________
  1217.  
  1218.  
  1219.    Report options
  1220.  
  1221. Report options govern what sort of report is generated, and the amount of
  1222. detail that OBJXREF provides.
  1223. _______________________________________________________________________
  1224.  
  1225. Option Report generated
  1226. _______________________________________________________________________
  1227.  
  1228.  
  1229.   /RC  Report by class type: Module sizes ordered by class type
  1230.        of segment.
  1231.  
  1232.   /RM  Report by module: Public names ordered by defining
  1233.        module.
  1234.  
  1235.   /RP  Report by public names: Public names in order with
  1236.        defining module name.
  1237.  
  1238. This is the default.
  1239.  
  1240.   /RR  Report by reference: Public name definitions and
  1241.        references ordered by name.
  1242.  
  1243.  
  1244.  
  1245.  
  1246. Chapter 1 Page 23 OBJXREF
  1247.  
  1248.  
  1249.   /RS  Report of module sizes: Module sizes ordered by
  1250.        segment name.
  1251.  
  1252.   /RU  Report of unreferenced symbol names: Unreferenced public
  1253.        names ordered by defining module.
  1254.  
  1255.   /RV  Verbose reporting: OBJXREF produces a report of every
  1256.        type.
  1257.  
  1258.   /RX  Report by external reference: External references ordered
  1259.        by referencing module name.
  1260. ______________________________________________________________________
  1261.  
  1262. Public names defined in .C files appear in reports with a leading underscore
  1263. in the reports unless the -U- option was specified when the file was compiled
  1264. (main appears as _main).
  1265.  
  1266. You can limit the modules, segments, classes, or public names that OBJXREF
  1267. reports on by entering the appropriate name on the command line prefixed with
  1268. the /N option. For example,
  1269.  
  1270.    OBJXREF filelist /RM /NC0
  1271.  
  1272. tells OBJXREF to generate a report listing information only for the module
  1273. named C0.
  1274.  
  1275.  
  1276.   Response files
  1277. The command line is limited by DOS to a maximum of 128 characters. If your list
  1278. of options and file names will exceed this limit, you must place your file
  1279. names in a response file.
  1280.  
  1281. A response file is a text file that you make with a text editor. Since you may
  1282. already have prepared a list of the files that make up your program for other
  1283. Borland C++ programs, OBJXREF recognizes several response file types.
  1284.  
  1285. Response files are called from the command line using one of the following
  1286. options. The response file name must
  1287.  
  1288.  
  1289.  
  1290. Chapter 1 Page 24                                                 OBJXREF
  1291.  
  1292.  
  1293. follow the option without an intervening space (so, for example, you would type
  1294. /Lresp, not /L resp).
  1295.  
  1296. You can specify more than one response file on the command line; additional
  1297. .OBJ and .LIB file names can precede or follow them.
  1298.  
  1299.  
  1300.   Free-form response files
  1301. You can create a free-form response file with a text editor. Just list the
  1302. names of all .OBJ and .LIB files needed to make your .EXE file.
  1303.  
  1304. Any file name listed in the response file without an extension is assumed to be
  1305. an .OBJ file. To use free-form files with OBJXREF, type in each response file
  1306. name on the command line, preceded by an @, and separate it from other
  1307. command-line entries with a space or tab:
  1308.  
  1309.    @filename  @filename ...
  1310.  
  1311.  
  1312.   Project files
  1313. You can also use project files of the type generated by Borland C++'s
  1314. integrated environment as response files. In the command line, precede the
  1315. project file name with /P, like this:
  1316.  
  1317.    /Pfilename
  1318.  
  1319. If the file name does not include an explicit extension, a .PRJ extension is
  1320. assumed.
  1321.  
  1322. File names in the project file with a .C extension or no extension are
  1323. interpreted as specifying the corresponding .OBJ file. You need not remove
  1324. file dependencies specified inside parentheses; they are ignored by OBJXREF.
  1325.  
  1326. Note
  1327. By itself, the list of files in a .PRJ file does not specify a complete
  1328. program--you must also specify a startup file (C0x.OBJ) and one or more Borland
  1329. C++ library files (MATHX.LIB, EMU.LIB, and CX.LIB, for example). In addition,
  1330.  
  1331.  
  1332.  
  1333. Chapter 1 Page 25                                                 OBJXREF
  1334.  
  1335.  
  1336. you may need to use the /D option to specify the directory where OBJXREF
  1337. should look for your .OBJ files.
  1338.  
  1339.  
  1340.  Linker response files
  1341. Files in TLINK response-file format can also be used by OBJXREF. A linker
  1342. response file called from the command line is preceded by /L, like so:
  1343.  
  1344.    /Lfilename
  1345.  
  1346. To see how to use one of these files, refer to Example 2 in the section
  1347. "Examples of how to use OBJXREF."
  1348.  
  1349.  
  1350.   Sample OBJXREF reports
  1351. Suppose you have two source files in your Borland C++ directory, and want to
  1352. generate OBJXREF reports on the object files compiled from them. The source
  1353. files are called TEST1.C and TEST2.C, and they look like this:
  1354.  
  1355.   /* test1.c */
  1356.   int i1;                       /* defines i1 */
  1357.   extern int i2;                /* refers to i2 */
  1358.   static int i3;                /* not a public name */
  1359.   extern void look(void);       /* refers to look */
  1360.   void main(void)               /* defines main */
  1361.   {
  1362.      int i4;                    /* not a public name */
  1363.      look();                    /* refers to look */
  1364.   }
  1365.  
  1366.   /* test2.c */
  1367.   #include <process.h>
  1368.   extern int i1;                /* refers to i1 */
  1369.   int i2;                       /* defines i2 */
  1370.   void look(void)               /* defines look */
  1371.   {
  1372.      exit(i1);                  /* refers to exit... */
  1373.   }                             /* and to i1 */
  1374.  
  1375.  
  1376.  
  1377. Chapter 1 Page 26                                                 OBJXREF
  1378.  
  1379.  
  1380. The object modules compiled from these source files are TEST1.OBJ and
  1381. TEST2.OBJ. You can tell OBJXREF what kind of report to generate about these
  1382. OBJ files by entering the file names on the command line, followed by a /R
  1383. and a second letter denoting report type.
  1384.  
  1385. Note: The following examples show only useful parts of the output.
  1386.  
  1387.  
  1388. Report by public names (/RP)
  1389. A report by public names lists each of public names defined in the object
  1390. modules being reported on, followed by the name of the module in which it is
  1391. defined.
  1392.  
  1393. If you enter this on the command line:
  1394.  
  1395.    OBJXREF  /RP  test1  test2
  1396.  
  1397. OBJXREF generates a report that looks like this:
  1398.  
  1399.   SYMBOL           DEFINED IN
  1400.   _i1              TEST1
  1401.   _i2              TEST2
  1402.   _look            TEST2
  1403.   _main            TEST1
  1404.  
  1405.  
  1406. Report by module (/RM)
  1407. A report by module lists each object being reported on, followed by a
  1408. list of the public names defined in it.
  1409.  
  1410. If you enter this on the command line:
  1411.  
  1412.    OBJXREF  /RM  test1  test2
  1413.  
  1414. OBJXREF generates a report that looks like this:
  1415.  
  1416.  
  1417.  
  1418.  
  1419. Chapter 1 Page 27                                                 OBJXREF
  1420.  
  1421.  
  1422.   MODULE: TEST1 defines the following symbols:
  1423.           public: _i1
  1424.           public: _main
  1425.   MODULE: TEST2 defines the following symbols:
  1426.           public: _i2
  1427.           public: _look
  1428.  
  1429.  
  1430.   Report by reference (/RR)
  1431. A report be reference lists each public name with the defining module in
  1432. parentheses on the same line. Modules that refer to this public name are listed
  1433. on following lines indented from the left margin.
  1434.  
  1435. This is the default if no report option is specified.
  1436.  
  1437. If you enter this on the command line:
  1438.  
  1439.    OBJXREF  /RR  C0  test1  test2  CS.LIB
  1440.  
  1441. OBJXREF generates a report that looks like this:
  1442.  
  1443.   _exit (EXIT)
  1444.        C0
  1445.        TEST2
  1446.   _i1 (TEST1)
  1447.        TEST2
  1448.   _i2 (TEST2)
  1449.   _look (TEST2)
  1450.        TEST1
  1451.   _main (TEST1)
  1452.        C0
  1453.  
  1454.  
  1455.   Report by external references (/RX)
  1456. A report by external references lists each module followed by a list of
  1457. the external references it contains.
  1458.  
  1459. If you enter this on the command line:
  1460.  
  1461.    OBJXREF  /RX  C0  test1  test2  CS.LIB
  1462.  
  1463. OBJXREF generates a report that looks like this:
  1464.  
  1465.   MODULE: C0 references the following symbols:
  1466.           _main
  1467.  
  1468.  
  1469.  
  1470. Chapter 1 Page 28                                                 OBJXREF
  1471.  
  1472.  
  1473.   MODULE: TEST1 references the following symbols:
  1474.           _i2
  1475.           _look
  1476.   MODULE: TEST2 references the following symbols:
  1477.           _exit
  1478.           _i1
  1479.  
  1480.  
  1481.   Report of module sizes (/RS)
  1482. A report by sizes lists segment names followed by a list of modules that define
  1483. the segment. Sizes in bytes are given in decimal and hexadecimal notation. The
  1484. word uninitialized appears where no initial values are assigned to any of the
  1485. symbols defined in the segment. Segments defined at absolute addresses in a
  1486. .ASM file are flagged Abs to the left of the segment size.
  1487.  
  1488. If you enter this on the command line:
  1489.  
  1490.    OBJXREF  /RS  test1  test2
  1491.  
  1492. OBJXREF generates a report that looks like this:
  1493.  
  1494. These files were compiled using the large memory model.
  1495.  
  1496.   TEST1_TEXT
  1497.           6 (00006h)   TEST1
  1498.           6 (00006h)   total
  1499.   TEST2_TEXT
  1500.          10 (0000Ah)   TEST2
  1501.          10 (0000Ah)   total
  1502.   _BSS
  1503.           4 (00004h)   TEST1, uninitialized
  1504.           2 (00002h)   TEST2, uninitialized
  1505.           6 (00006h)   total
  1506.  
  1507.  
  1508.   Report by class type (/RC)
  1509. A report by class type lists segment size definitions by segment class. The
  1510. CODE class contains instructions, DATA class contains initialized data and
  1511. BSS class contains uninitialized data. Segments which do not have a class
  1512. type will be listed under the notation No class type.
  1513.  
  1514.  
  1515.  
  1516. Chapter 1 Page 29 OBJXREF
  1517.  
  1518.  
  1519. If you enter this on the command line:
  1520.  
  1521.    OBJXREF  /RC  C0  test1  test2  CS.LIB
  1522.  
  1523. OBJXREF generates a report that looks like this:
  1524.  
  1525.   BSS
  1526.          4  (00004h)   TEST1
  1527.          2  (00002h)   TEST2
  1528.        ...
  1529.        132  (00084h)   total
  1530. CODE
  1531.          6  (00006h)   TEST1
  1532.         10  (0000Ah)   TEST2
  1533.         16  (00010h)   total
  1534.   DATA
  1535.        143  (0008Fh)   C0
  1536.        143  (0008Fh)   total
  1537.  
  1538.  
  1539.   Report of unreferenced symbol names (/RU)
  1540. A report of unreferenced symbol names lists modules that define public
  1541. names not referenced in other modules. Such a symbol is either:
  1542.  
  1543. 1. referenced only from within the defining module and does not need to be
  1544. defined as a public symbol (in that case, if the module is in C, the keyword
  1545. static should be added to the definition; if the module is in TASM, just
  1546. remove the public definition).
  1547.  
  1548. 2. never used (therefore, it can be deleted to save code or data space).
  1549.  
  1550. If you enter this on the command line:
  1551.  
  1552.    OBJXREF  /RU  test1  test2
  1553.  
  1554. OBJXREF generates a report that looks like this:
  1555.  
  1556.    MODULE: TEST2 defines the unreferenced symbol _i2.
  1557.  
  1558.  
  1559.  
  1560. Chapter 1 Page 30                                                 OBJXREF
  1561.  
  1562.  
  1563.   Verbose reporting (/RV)
  1564. If you enter /RV on the command line, OBJXREF generates one report of each
  1565. type.
  1566.  
  1567.  
  1568.   Examples of how to use OBJXREF
  1569. These examples assume that the application files are in the current
  1570. directory of the default drive and that the Borland C++ startup files
  1571. (C0x.OBJ) and the library files are in the \BORLANDC\LIB directory.
  1572.  
  1573.  
  1574.    Example 1
  1575.  
  1576.      C>OBJXREF \BORLANDC\lib\c0l test1 test2 \BORLANDC\lib\cl.lib
  1577.  
  1578. In this example, the TEST1.OBJ and TEST2.OBJ files and the Borland C++
  1579. startup file \BORLANDC\LIB\C0L.OBJ and the library file \TURBOC\LIB\CL.LIB are
  1580. specified. Since no report type is specified, the resulting report is the
  1581. default report by reference, listing public names and the modules that
  1582. reference them.
  1583.  
  1584.  
  1585.   Example 2
  1586.  
  1587.   C>OBJXREF /RV /Ltest1.arf
  1588.  
  1589. The TLINK response file TEST1.ARF contains the same list of files as the
  1590. command line in Example 1. The /RV option is specified, so a report of
  1591. every type will be generated. TEST1.ARF contains
  1592.  
  1593.   \BORLANDC\lib\c0l
  1594.   test1 test2
  1595.   test1.exe
  1596.   test1.map
  1597.   \BORLANDC\lib\cl
  1598.  
  1599.  
  1600.        Example 3
  1601.  
  1602. C>OBJXREF /RC  B:c0s  /Ptest1  @@libs
  1603.  
  1604. The Borland C++ project file TEST1.PRJ specifies TEST1.OBJ and TEST2.OBJ. The
  1605. response file @libs specifies libraries on a disk in the B drive. TEST1.PRJ
  1606. contains
  1607.  
  1608.   test1
  1609.   test2.c
  1610.  
  1611.  
  1612.  
  1613. Chapter 1 Page 31                                                 OBJXREF
  1614.  
  1615.  
  1616. The file LIBS contains
  1617.  
  1618.    b:maths.lib b:emu.lib b:cs.lib
  1619.  
  1620. The startup and library files specified depend on the memory model and floating
  1621. point options used in compilation. The /RC causes a report of class type to be
  1622. output.
  1623.  
  1624.  
  1625.   Example 4
  1626.  
  1627.   C>OBJXREF /F /RV \BORLANDC\lib\cs.lib
  1628.  
  1629. This example reports on all the modules in the Borland C++ library file CS.LIB;
  1630. OBJXREF can produce useful reports even when the files specified do not make a
  1631. complete program. The /F causes all modules in CS.LIB file to be included in
  1632. the report.
  1633.  
  1634.  
  1635.    OBJXREF error messages and warnings
  1636. OBJXREF generates two sorts of diagnostic messages: error messages and warnings.
  1637.  
  1638.  
  1639.   Error messages
  1640.  
  1641. Out of memory
  1642. OBJXREF performs its cross referencing in RAM memory and may run out of memory
  1643. even if TLINK is able to link the same list of files successfully. When this
  1644. happens, OBJXREF aborts. Remove memory resident programs to get more space,
  1645. or add more RAM.
  1646.  
  1647.  
  1648.   Warnings
  1649. WARNING: Unable to open input file <filename>
  1650. The input file filename could not be located or opened. OBJXREF proceeds to
  1651. the next file.
  1652.  
  1653. WARNING: Unknown option - <option>
  1654. The option name option is not recognized by OBJXREF. OBJXREF ignores the
  1655. option.
  1656.  
  1657. Chapter 1 Page 32                                                 OBJXREF
  1658.  
  1659.  
  1660. WARNING: Unresolved symbol <symbol> in module <module>
  1661. The public name symbol referenced in module module is not defined in any of
  1662. the .OBJ or .LIB files specified. OBJXREF flags the symbol in any reports it
  1663. generates as being referenced but not defined.
  1664.  
  1665. WARNING: Invalid file specification <filename>
  1666. Some part of the file name filename is invalid. OBJXREF proceeds to the next
  1667. file.
  1668.  
  1669. WARNING: No files matching <filename>
  1670. The file named filename listed on the command line or in a response file could
  1671. not be located or opened. OBJXREF skips to the next file.
  1672.  
  1673. WARNING: Symbol <symbol> defined in <module1> duplicated in <module2>
  1674. Public name symbol is defined in modules module1 and module2. OBJXREF ignores
  1675. the second definition.
  1676.  
  1677.  
  1678. PRJCFG
  1679.  
  1680. Creates the command-line configuration file from a project file. You can also
  1681. use it to create or update a project file from a configuration file.
  1682.  
  1683. The command-line compiler looks for a default configuration file named
  1684. TURBOC.CFG, but you can specify a different file with +pathname option. To
  1685. use PRJCFG to create a BCC or BCCX configuration file from a project file,
  1686. you would type the following:
  1687.  
  1688.    PRJCFG ProjFile.PRJ ConfigFile.CFG
  1689.  
  1690. To make a project file from a configuration file, type
  1691.  
  1692.    PRJCFG ConfigFile.CFG ProjFile.PRJ
  1693.  
  1694.  
  1695.  
  1696. Chapter 1 Page 33                                                 PRJCNVT
  1697.  
  1698.  
  1699. PRJCNVT: Old projects for new
  1700.  
  1701. This utility converts Turbo C 1.0, 1.5, and 2.0 project files to Borland C++
  1702. project files. The syntax for it is
  1703.  
  1704.    PRJCNVT infile[.PRJ] [outfile[.PRJ]]
  1705.  
  1706. or
  1707.  
  1708.    PRJCNVT infile[.TC]  [outfile[.PRJ]]
  1709.  
  1710. If you specify a configuration file as input, it must have a project file
  1711. defined. The compiler options in the .CFG file and the dependencies in the
  1712. Turbo C 2.0 .PRJ file will be placed into the corresponding Borland C++ .PRJ
  1713. file.
  1714.  
  1715. If you specify a project file as input, only dependencies information will be
  1716. placed into the Borland C++ .PRJ file. All compiler options will remain
  1717. default.
  1718.  
  1719. If you don't provide an extension, .TC is assumed. If PRJCVNT can't find a .TC
  1720. file, it looks for a .PRJ file.
  1721.  
  1722. The default name of the output file is the base name of the input file with the
  1723. extension .PRJ. For example, STARS.TC will turn into STARS.PRJ. If the input
  1724. and the output name are the same, the old file will be renamed to a .BAK file.
  1725.  
  1726.  
  1727. PRJ2MAK: From project file to MAKE file
  1728.  
  1729. This utility converts a .PRJ file to a .MAK file (containing all relevant
  1730. switches and settings) for use with the MAKE utility. These files can be
  1731. re-used without accessing the IDE. The syntax for PRJ2MAK is
  1732.  
  1733.    PRJ2MAK projectfile[.PRJ] [makefile[.MAK] [config[.CFG]]]
  1734.  
  1735. The extension for the project file name is assumed to be .PRJ unless you
  1736. specify otherwise.
  1737.  
  1738.  
  1739.  
  1740. Chapter 1 Page 34                                                 PRJ2MAK
  1741.  
  1742.  
  1743. The default name for the new MAKE file is the base file name of the .PRJ file
  1744. with the extension .MAK. The default name for the new .CFG file is the base
  1745. file name of the .MAK file with the extension .CFG.
  1746.  
  1747. To change the names of the makefile and configuration files, just specify
  1748. different names on the command line.
  1749.  
  1750. Examples of valid execution:
  1751.  
  1752.    PRJ2MAK MYPROJ.PRJ MAKEFILE.MAK TURBOC.CFG
  1753.  
  1754. This execution creates a makefile called MAKEFILE.MAK with a configuration file
  1755. called TURBOC.CFG.
  1756.  
  1757.    PRJ2MAK MYPROJ.PRJ MAKEFILE.MAK
  1758.  
  1759. This execution creates a makefile called MAKEFILE.MAK with a configuration file
  1760. called MYPROJ.CFG.
  1761.  
  1762.    PRJ2MAK MYPROJ
  1763.  
  1764. This execution creates a makefile called MYPROJ.MAK and a configuration file
  1765. called MYPROJ.CFG.
  1766.  
  1767. The makefile that PRJ2MAK creates will set up a redirection file for the linker
  1768. response file and for the .CFG file. They will be created when you run the
  1769. makefile that was generated. The linker response file is a temporary file
  1770. and will be deleted. The .CFG file will be left as a file on disk.
  1771.  
  1772. PRJ2MAK places options that meet the following requirements into the .CFG
  1773. file: Those that are not default to the Borland C++ command-line compiler and
  1774. have been selected in the project file.
  1775.  
  1776. PRJ2MAK will use the library search path as a command link option to TLINK, so
  1777. that TLINK can search that path for the startup module and for libraries.
  1778.  
  1779.  
  1780.  
  1781. Chapter 1 Page 35                                                 THELP
  1782.  
  1783.  
  1784. THELP: The Turbo Help utility
  1785.  
  1786. THELP.COM is a RAM-resident (TSR) utility that accesses Borland C++'s online
  1787. help information for you when you aren't using the IDE (that is, if you are
  1788. using an editor other than the one in the IDE, or you are using the
  1789. command-line version of Borland C++, or if you are using another product,
  1790. such as Turbo Debugger). THELP requires about 58K bytes of memory.
  1791.  
  1792.  
  1793.   Loading and invoking THELP
  1794. Warning! If you are going to have THELP resident in memory at the
  1795. same time as SideKick 1.x or SideKick Plus, make sure you load
  1796. THELP before you load SideKick.
  1797.  
  1798. You need to first load THELP in order to use it from within another program (or
  1799. from the command line). Make sure that TCHELP.TCH, the text file containing the
  1800. Borland C++ online help information, is in the current directory. (If you want
  1801. to keep TCHELP.TCH in another directory, THELP has a special /F command-line
  1802. option that will enable THELP to find it; the INSTALL program inserts the
  1803. correct path information into THELP.)
  1804.  
  1805. To load THELP, just type
  1806.  
  1807.    THELP [options]
  1808.  
  1809. at the DOS command line before you go into your application. This needs to be
  1810. done only once, when you first boot up.
  1811.  
  1812. Once you are in the other application, you can activate THELP at any time. Just
  1813. position the cursor under the item you want information on, then press the
  1814. THELP hot key. The default hot key is 5 on the numeric keypad (scan code
  1815. 4ch, shift state 00h).
  1816.  
  1817. Note
  1818. If you are using THELP on an ATT6300, be sure to use the /L25 option, as
  1819. described in the section "Summary of THELP command-line options."
  1820.  
  1821.  
  1822.  
  1823. Chapter 1 Page 36                                                 THELP
  1824.  
  1825.  
  1826. Navigating THELPg keys to navigate through the help screens that THELP
  1827. displays on your monitor:
  1828. _________________________________________________________________________
  1829.  
  1830. Key(s)                  What they do/it does
  1831. -------------------------------------------------------------------------
  1832.  
  1833. Up  Down  Left  Right   Move the highlight from keyword to keyword within
  1834.                         the current help screen.
  1835.  
  1836. Shift-Arrow             Moves the cursor while marking a block.
  1837.  
  1838. Home and End            Move to the beginning and end of a line,
  1839.                         respectively.
  1840.  
  1841. Tab and Shift-Tab       Moves to the next or previous keyword.
  1842.  
  1843. PgUp/PgDn               Moves from screen to screen if additional screens
  1844.                         are available.
  1845.  
  1846. Enter                   Selects a help entry for the item highlighted in
  1847.                         the current help screen.
  1848.  
  1849. Esc                     Ends help session.
  1850.  
  1851. F1                      Displays the help table of contents screen. Press
  1852.                         F1 in any help screen to call up the help index.
  1853.  
  1854. Shift-F1                Displays the Help Index. Pressing F1 in any help
  1855.                         screen brings up the Help Index. You can search
  1856.                         for a specific keyword incrementally. For
  1857.                         example, you can find printf by typing p r i.
  1858.                         With each letter you type, the list jumps to the
  1859.                         keyword that starts with p, then to pr, then to
  1860.                         pri, and so on.
  1861.  
  1862. Alt-F1                  Pressing Alt-F1 repeatedly takes you in reverse
  1863.                         order through the last 20 screens you have
  1864.                         reviewed.
  1865.  
  1866. Ctl-F1                  Brings up the help screen for THELP's hot keys.
  1867. Ctrl-P                  Pastes the marked block or example text into your
  1868.                         current application.
  1869.  
  1870.  
  1871.  
  1872. Chapter 1 Page 37 THELP
  1873.  
  1874.  
  1875. Hot-key                 If you are running THELP on a second monitor,
  1876.                         pressing the hot key or hot-key combination
  1877.                         combination you used to invoke THELP ends the
  1878.                         current help session but leaves the current help
  1879.                         screen on the second (monochrome) monitor. The
  1880.                         default key is 5 on the numeric key pad.
  1881. _________________________________________________________________________
  1882.  
  1883.  
  1884.    THELP option
  1885. Here is a summary of the THELP command-line options. If you use more than one
  1886. option, you must separate them with spaces.
  1887. _______________________________________________________
  1888.  
  1889.   Option        Specifies
  1890. _______________________________________________________
  1891.  
  1892.   /C#xx          Select color:
  1893.                     # = color number
  1894.                     xx = hex color values
  1895.  
  1896.   /D             Display window width is 80 columns
  1897.  
  1898.   /Fname         Full path and file name of help file
  1899.  
  1900.   /H, /?, ?      Display help screen
  1901.  
  1902.   /Kxxyy         Change hot key:
  1903.                     xx = shift state (hex)
  1904.                     yy = scan code (hex)
  1905.  
  1906.   /S[+|-]        Enable (+) snow checking (useful for older
  1907.                  CGA adapters) or disable (-) snow checking
  1908.                  (for snappier displays).
  1909.  
  1910.   /U             Remove THELP from memory.
  1911.  
  1912.   /W             Write options to THELP.COM (save as defaults)
  1913.                  and exit.
  1914. ______________________________________________________________
  1915.  
  1916.  
  1917.    /C#xx (select color)
  1918. This option lets you customize the background and foreground colors of
  1919. various elements in a help screen. The /C option is followed by the number of
  1920. the color you want and the hex color values for background and foreground,
  1921. respectively.
  1922.  
  1923.  
  1924.  
  1925. Chapter 1 Page 38                                                 THELP
  1926.  
  1927.  
  1928. There are twelve possible colors, numbered as follows:
  1929. _______________________________________________________
  1930.  
  1931.   Number Element
  1932. _______________________________________________________
  1933.  
  1934.  
  1935.    0     Color border attribute
  1936.    1     Monochrome border attribute
  1937.    2     Color text attribute
  1938.    3     Monochrome text attribute
  1939.    4     Color keyword attribute
  1940.    5     Monochrome keyword attribute
  1941.    6     Color selected keyword word attribute
  1942.    7     Monochrome selected keyword word attribute
  1943.    8     Color example text attribute
  1944.    9     Monochrome example text attribute
  1945.    A     Color marked block attribute
  1946.    B     Monochrome marked block attribute
  1947. _________________________________________________________
  1948.  
  1949. The color values for a standard IBM-compatible color display are as follows:
  1950. ________________________________________________________________
  1951.  
  1952.   First digit (background)        Second digit (foreground)
  1953. _________________________________________________________________
  1954.  
  1955.  
  1956.    0   Black                       0   Black
  1957.    1   Blue                        1   Blue
  1958.    2   Green                       2   Green
  1959.    3   Cyan                        3   Cyan
  1960.    4   Red                         4   Red
  1961.    5   Magenta                     5   Magenta
  1962.    6   Brown                       6   Brown
  1963.    7   Gray                        7   Gray
  1964.                                    8   Intense black
  1965.   ORing the color value with       9   Intense blue
  1966.   Hex 80 produces a blinking       A   Intense green
  1967.   color unless blinking has been   B   Intense cyan
  1968.   disabled.                        C   Intense red
  1969.                                    D   Intense magenta
  1970.                                    E   Intense brown (yellow)
  1971.                                    F   Intense gray (white)
  1972. ____________________________________________________________________
  1973.  
  1974.  
  1975. Chapter 1 Page 39                                                 THELP
  1976.  
  1977.  
  1978. On monochrome monitors, the attribute values can differ widely, so you may need
  1979. to experiment.
  1980.  
  1981.  
  1982.   /Fname (full path and name for help file)
  1983. The name that follows the /F option should be the full drive/directory path
  1984. file to use; for example,
  1985.  
  1986.   THELP /FC:\TP\TURBO.HLP
  1987.   THELP /FC:\BORLANDC\TCHELP.TCH
  1988.  
  1989. By default, THELP looks for the help file on the logged drive and directory.
  1990.  
  1991.  
  1992.   /H, /?, and ? (display help screen)
  1993. Any of these options displays a summary of THELP's command-line options.
  1994.  
  1995. /Kxxyy (reassign hot key)
  1996. This option allows you to reassign a function to a new hot key. The option
  1997. must be followed by the shift state (xx) and the scan code (yy) of the new key.
  1998. Virtually any shift state/scan code combination may be selected. Here's a
  1999. quick summary of some common shift states and scan codes:
  2000. _________________________________________
  2001.  
  2002.   Shift states (can be OR'ed together):
  2003.  
  2004.    Right Shift   01h
  2005.    Left Shift    02h
  2006.    Ctrl          04h
  2007.    Alt           08h
  2008.  
  2009.   Scan codes:
  2010.  
  2011.    A   1eh   N   31h   0   0bh   F1  3bh
  2012.    B   30h   O   18h   1   02h   F2  3ch
  2013.    C   2eh   P   19h   2   03h   F3  3dh
  2014.    D   20h   Q   10h   3   04h   F4  3eh
  2015.    E   12h   R   13h   4   05h   F5  3fh
  2016.    F   21h   S   1fh   5   06h   F6  40h
  2017.    G   22h   T   14h   6   07h   F7  41h
  2018.  
  2019.  
  2020.  
  2021. Chapter 1 Page 40                                                 THELP
  2022.  
  2023.  
  2024.    H   23h   U   16h   7   08h   F8  42h
  2025.    I   17h   V   2fh   8   09h   F9  43h
  2026.    J   24h   W   11h   9   0ah   F10 44h
  2027.    K   25h   X   2dh
  2028.    L   26h   Y   15h
  2029.    M   32h   Z   2ch
  2030.  
  2031.   Enhanced keyboards only (may not work with all computers or keyboards):
  2032.  
  2033.    F11 57h
  2034.    F12 58h
  2035. ____________________________________________________________________
  2036.  
  2037.  
  2038.   /S (snow checking)
  2039. Some older CGA screens have a tendency to produce a "snow" effect when
  2040. software tries to write directly into their memory space. If you see this
  2041. snow you should start up THELP with /S+ to enable the snow checking code.
  2042. You may want to use the /W switch to make it permanent. Snow checking
  2043. takes time and it is better to live without it. To disable snow checking
  2044. use /S-; this is the default.
  2045.  
  2046.  
  2047.   /U (remove THELP from memory)
  2048. This option removes THELP from memory. If been loaded after THELP,
  2049. make sure to remove them before removing THELP.
  2050.  
  2051.  
  2052.   /W (write options to THELP.COM and exit)
  2053. The /W parameter creates a new version of THELP that uses the options you
  2054. desire as a default. You can specify and make permanent all options.
  2055.  
  2056.  
  2057. TOUCH
  2058.  
  2059. There are times when you want to force a particular target file to be
  2060. recompiled or rebuilt, even though no changes have been made to its sources.
  2061. One way to do this is to use the TOUCH utility. TOUCH changes the date and
  2062. time of one or more files to the current date and time, making it "newer"
  2063. than the files that depend on it.
  2064.  
  2065. You can force MAKE to rebuild a target file by touching one of the files that
  2066.  
  2067.  
  2068.  
  2069. Chapter 1 Page 41                                                 TOUCH
  2070.  
  2071.  
  2072. target depends on. To touch a file (or files), type
  2073.  
  2074.   touch filename [filename ...]
  2075.  
  2076. at the DOS prompt. TOUCH will then update the file's creation date(s). Once you
  2077. do this, you can invoke MAKE to rebuild the touched target file(s).
  2078.  
  2079. You can use the DOS wildcards * and ? with TOUCH.
  2080.  
  2081. Important!
  2082. Before you use the TOUCH utility, it's vitally important to set your system's
  2083. internal clock to the proper date and time. If you're using an IBM PC, XT, or
  2084. compatible that doesn't have a battery-powered clock, don't forget to set the
  2085. time and date using the DOS "time" and "date" commands. Failing to do this will
  2086. keep both TOUCH and MAKE from working properly.
  2087.  
  2088.  
  2089. TRANCOPY
  2090.  
  2091. TRANCOPY copies transfer items from one project to another. The syntax is
  2092.  
  2093.   TRANCOPY [-r] Source[.PRJ] Dest[.PRJ]
  2094.  
  2095. TRANCOPY merges the transfer items in Source with the transfer in Dest; Dest
  2096. gets the new transfer items.
  2097.  
  2098. If the -r option is used, the set of the transfer items in Dest is replaced
  2099. by the set of transfer items in Source.
  2100.  
  2101.  
  2102. TRIGRAPH: A character-conversion utility
  2103.  
  2104. Trigraphs are three-character sequences that replace certain characters used in
  2105. the C language that are not available on some keyboards. Translating trigraphs
  2106. in the compiler would slow compilation down considerably, so Borland C++
  2107. provides a filter named TRIGRAPH.EXE to handle trigraph sequences when you need
  2108. to. The
  2109.  
  2110.  
  2111. Chapter 1 Page 42                                                 TRIGRAPH
  2112.  
  2113.  
  2114. syntax for invoking this program is as follows:
  2115.  
  2116.    TRIGRAPH [-u] file(s) [file(s) ...]
  2117.  
  2118. The following table shows the trigraph sequences that TRIGRAPH.EXE recognizes:
  2119. _______________________________
  2120.  
  2121.   Trigraph  Character
  2122.  
  2123.  
  2124.    ??=        #
  2125.    ??(        [
  2126.    ??/        \
  2127.    ??)        ]
  2128.    ??'        ^
  2129.    ??<        {
  2130.    ??!        |
  2131.    ??>        }
  2132.    ??-        ~
  2133. _______________________________
  2134.  
  2135. TRIGRAPH.EXE works in two directions: It can convert all trigraphs to their
  2136. single-character representation, and it can convert single characters to their
  2137. trigraph representation. Ordinarily, TRIGRAPH.EXE converts trigraphs to single
  2138. characters. You can specify the inverse conversion with the -u (UNDO) command-
  2139. line option, which must come before any file names on the command line.
  2140.  
  2141. TRIGRAPH.EXE takes any number of file specifiers, including wildcards, on the
  2142. command line. For each file specified, it creates a backup copy of the file
  2143. with the original file name and an extension of .BAK, and creates a new file
  2144. with the original file name and the appropriate conversions performed.
  2145. For example,
  2146.  
  2147.    trigraph test.c test1.c
  2148.  
  2149. removes all trigraphs from the two files TEST.C and TEST1.C, creating backup
  2150. files TEST.BAK and TEST1.BAK.
  2151.  
  2152. As another example, the following command inserts trigraphs into all the files
  2153. with the extension .C, and makes backup copies
  2154.  
  2155.  
  2156.  
  2157. Chapter 1 Page 43                                                 TRIGRAPH
  2158.  
  2159.  
  2160. of all those files, giving them the extension .BAK.
  2161.  
  2162.    trigraph -u *.c
  2163.  
  2164.  
  2165.  
  2166. Chapter 1 Page 44
  2167.  
  2168.                          APPENDIX A
  2169.                  TURBO EDITOR MACRO LANGUAGE
  2170.                        TABLE OF CONTENTS
  2171. ___________________________________________________________________
  2172.  
  2173.  
  2174. Appendix 1  TEMC              45     Key codes . . . . . . . . . 47
  2175. TEMC command line  . . . . . .45     Named keys  . . . . . . . . 48
  2176. Syntax . . . . . . . . . . . .46   Predefined editor commands  . 49
  2177.  
  2178.                                  i
  2179.  
  2180.  
  2181. TABLES
  2182. ___________________________________________________________________
  2183.  
  2184.  
  2185. 1.1: TEMC editor commands  . . 4                                ii
  2186. ___________________________________________________________________
  2187.  
  2188.  
  2189. TEMC.EXE is an editor macro compiler for the IDE. It processes a
  2190. script file that defines editor macros and key bindings, and
  2191. produces a configuration file that is read by the IDE to define the
  2192. effects of keyboard commands in the editor.
  2193.  
  2194. The file DEFAULTS.TEM contains the default macro definitions and
  2195. key bindings built into the IDE editor. It serves as an example
  2196. script, as well as a base from which to customize the editor.
  2197.  
  2198.  
  2199. TEMC command line
  2200.  
  2201. TEMC is invoked from the DOS command line. Type
  2202.  
  2203.   temc [-c] <script file> <config file>
  2204.  
  2205. The script file extension is .TEM if not specified otherwise. The
  2206. configuration file extensions is assumed to be .TC.
  2207.  
  2208. The configuration file need not exist. If it does not exist, it is
  2209. created. The optional -c switch can also be specified as /c, and
  2210. can appear in any argument position on the command line. If you use
  2211. this option, any existing command table in your configuration file
  2212. is thrown away before TEMC processes the script file. When -c is
  2213. not used, the key bindings in the script file are merged with those
  2214. already defined in the configuration file.
  2215.  
  2216. You can use DEFAULTS.TEM to re-create exactly the default settings.
  2217. This file is included as both a sample script file and as the
  2218. default command table. You can copy it and modify it for your own
  2219. use.
  2220.  
  2221.  
  2222. Appendix A Page 45
  2223.  
  2224.  
  2225. Syntax
  2226.  
  2227. The syntax to define a macro is
  2228.  
  2229.   MACRO <macroname> <command1>; [ <command2>; ... ] END;
  2230.  
  2231. <macroname> can consist of anything that is a legal C symbol, and
  2232. <command> can be either the name of another predefined macro or a
  2233. predefined TEMC editor command. A list of editor commands and what
  2234. they do follows.
  2235.  
  2236. When you define your macro, the following points are valid:
  2237.  
  2238. 1. A statement defines either a named macro or a key binding.
  2239.  
  2240. 2. Spaces and new lines are optional.
  2241.  
  2242. 3. Comments are in C-style /* ... */ pairs.
  2243.  
  2244. 4. Unlike C, TEMC's language is case insensitive.
  2245.  
  2246. 5. Some of the predefined editor commands have a syntax that looks
  2247.    like a C function call with one argument. For example,
  2248.  
  2249.       SetMark(5);
  2250.  
  2251.    Depending on the command, the argumment is either a decimal integer
  2252.    constant, a character constant, or a string literal. All are
  2253.    specified using C syntax.
  2254.  
  2255. Here's an example of a macro definition from DEFAULTS.TEM:
  2256.  
  2257.   MACRO MacScrollUp
  2258.         ScrollScreenUp; FixCursorPos;
  2259.   END;
  2260.  
  2261. The syntax to define a key binding is
  2262.  
  2263.   <key-sequence>: <command>;
  2264.  
  2265. or
  2266.  
  2267.   <key-sequence>: BEGIN <command1>; [ <command2>; ... ] END;
  2268.  
  2269. The <key-sequence> is either a key (a character optionally preceded
  2270. by Ctrl or Alt), or a series of keys separated by a plus sign (+).
  2271. Note that the specification of the key characters themselves is
  2272. case sensitive. For example, Ctrl-k+B is different than Ctrl-k+b,
  2273. even though the latter is the same as CTRL-K+b.
  2274.  
  2275. Whitespace is allowed between the key-sequence and the colon, and
  2276. each <command> can be either the name of a previously defined
  2277.  
  2278.  
  2279.  
  2280. Appendix A Page 46
  2281.  
  2282.  
  2283. macro, or one of the predefined editor commands listed in Table
  2284. 1.1.
  2285.  
  2286.  
  2287. Key codes
  2288. Ctrl-2 and Ctrl-6 are the only control-numeric keys that generate
  2289. codes usable by the editor. They are the same as Ctrl-@ and Ctrl-^,
  2290. respectively.
  2291.  
  2292. Some keys cannot be entered directly into a TEMC script. Those keys
  2293. can be referred to by their names, as described in the following
  2294. table.
  2295.  
  2296. Any key in a sequence--except the first key--can be preceded by one
  2297. of the characters ^ or @. The caret (^) indicates that any
  2298. combination of case and "Ctrl" can be used to type the key; that
  2299. is, lowercase, uppercase, or control characters. The @ sign is used
  2300. to indicate that case is insignificant for the following character,
  2301. although "Ctrl" is not accepted. For example,
  2302.  
  2303. Ctrl-k+b specifies a Ctrl-K followed by a lowercase b.
  2304.  
  2305. Ctrl-k+^b specifies a Ctrl-K followed by any of b, B, or Ctrl-B.
  2306.  
  2307. Ctrl-k+@b specifies Ctrl-K followed by either b or B.
  2308.  
  2309. Enter, Return, and Spacebar can appear in any position after the
  2310. first key of a key sequence; the others cannot.
  2311.  
  2312.  
  2313. Named keys
  2314.  
  2315. Key are specified as letters, numbers, or characters, optionally
  2316. preceded by Ctrl- or Alt-. The following names specify keys that
  2317. cannot be typed as themselves in the TEMC syntax.
  2318. ___________________________________________________________________
  2319.  
  2320.   Key name                      Notes
  2321. -------------------------------------------------------------------
  2322.  
  2323.   [Ctrl] Home
  2324.   [Ctrl] End
  2325.   [Ctrl] PgUp
  2326.   [Ctrl] PgDn
  2327.   [Ctrl] Left arrow
  2328.   [Ctrl] Right arrow
  2329.   Up arrow
  2330.   Down arrow
  2331.   Ins
  2332.   Del
  2333.   Enter                         Same as Return and CTRL-M.
  2334.  
  2335.  
  2336.  
  2337. Appendix A Page 47
  2338.  
  2339.  
  2340.   Return                        Same as Enter and CTRL-M.
  2341.   [Ctrl|Alt] Backspace
  2342.   Tab
  2343.   Backtab
  2344.   Esc
  2345.   Star, Minus, Plus             Star, Minus and Plus are the
  2346.                                 *, -, and + keys on the numeric
  2347.                                 keypad, respectively.
  2348.   Spacebar
  2349.   [Ctrl] PrtSc
  2350.   [Ctrl|Alt] F1 to [Ctrl|Alt] F10
  2351. ______________________________________________________
  2352.  
  2353.  
  2354. Predefined editor commands
  2355.  
  2356. TEMC lets you use built-in editor commands and user-defined macros
  2357. as commands within macros interchangeably, as long as you don't
  2358. create any loops by having two macros calling each other, even via
  2359. intermediate macros. Note that some commands cause an escape from
  2360. the editor to the surrounding IDE. There is no provision for
  2361. returning control to the editor once that is done. Thus, if one of
  2362. those commands is part of a macro, it must be the last command in
  2363. the macro. You'll get an error message if a macro definition
  2364. violates this restriction.
  2365.  
  2366. A list of all predefined TEMC editor commands is shown next.
  2367. Commands that cause an escape from the editor follow.
  2368.  
  2369.        Table 1.1
  2370.      TEMC editor
  2371.         commands
  2372. ___________________________________________________________________
  2373.  
  2374. Command name       What the editor does
  2375. -------------------------------------------------------------------
  2376.  
  2377. BackspaceDelete    Deletes character before the cursor.
  2378.  
  2379. BottomOfScreen     Moves cursor to the bottom line of the current
  2380.                    window, leaving column unchanged.
  2381.  
  2382. CenterFixScreenPos Adjusts the screen display to ensure the cursor
  2383.                    is visible. If any adjustment is necessary,
  2384.                    adjust the display so the cursor is close to
  2385.                    being centered in the window.
  2386.  
  2387.  
  2388.  
  2389.  
  2390. Appendix A Page 48
  2391.  
  2392.  
  2393. Table 1.1: TEMC editor commands (continued)
  2394. -------------------------------------------------------------------
  2395. Command name       What the editor does
  2396. -------------------------------------------------------------------
  2397.  
  2398. CopyBlock          If there is a valid and highlighted (selected)
  2399.                    text block, then at the cursor location, inserts
  2400.                    a copy of the characters that are selected and
  2401.                    makes that the new selected text location.
  2402.  
  2403. CursorCharLeft     Moves cursor left over one character. This
  2404.                    command will skip over tab characters and move
  2405.                    to the end of the previous line.
  2406.  
  2407. CursorCharRight    Moves cursor right over one character. This
  2408.                    command will skip over tab characters and
  2409.                    advance to the beginning of the next line.
  2410.  
  2411. CursorDown         Moves cursor down one row.
  2412.  
  2413. CursorLeft         Moves cursor left one screen column.
  2414.  
  2415. CursorRight        Moves cursor right one screen column.
  2416.  
  2417. CursorSwitchedLeft Like CursorLeft, but pays attention to cursor
  2418.                    through tab option setting (see
  2419.                    SetCursorThroughTabMode).
  2420.  
  2421. CursorSwitchedRight
  2422.                    Like CursorRight, but pays attention to cursor
  2423.                    through tab option setting (see
  2424.                    SetCursorThroughTabMode).
  2425.  
  2426. CursorUp           Moves cursor up one row.
  2427.  
  2428. DeleteBlock        If there is a valid and highlighted (selected)
  2429.                    text block, deletes the characters that are in
  2430.                    it.
  2431.  
  2432. DeleteChar         Deletes the character at the current cursor
  2433.                    location.
  2434.  
  2435. DeleteLine         Deletes the current line.
  2436.  
  2437. DeleteToEOL        Deletes all characters in the current line,
  2438.                    leaving a zero-length line.
  2439.  
  2440.  
  2441.  
  2442.  
  2443. Appendix A Page 49
  2444.  
  2445.  
  2446. Table 1.1: TEMC editor commands (continued)
  2447. -------------------------------------------------------------------
  2448. Command name       What the editor does
  2449. -------------------------------------------------------------------
  2450.  
  2451. DeleteWord         Deletes from cursor to beginning of next word.
  2452.  
  2453. EndCursor          Moves cursor to end of file buffer.
  2454.  
  2455. FixCursorPos       Ensures that the cursor value specifies a row
  2456.                    between 1 and the number of lines in the buffer,
  2457.                    a column greater than 0. If the cursor through
  2458.                    tab option is not set, the cursor is not placed
  2459.                    in the middle of a tab character (see SetCursor-
  2460.                    ThroughTabMode).
  2461.  
  2462. FixScreenPos       Adjusts the screen display to ensure the cursor
  2463.                    is visible.
  2464.  
  2465. FullPaintScreen    Redraws the entire window, making no assumptions
  2466.                    about what is onscreen.
  2467.  
  2468. HideBlock          Sets a flag indicating that the selected text
  2469.                    should not be highlighted.
  2470.  
  2471. HighlightBlock     Sets a flag indicating that if the beginning and
  2472.                    end selected text markers are valid, the
  2473.                    selected text should be highlighted.
  2474.  
  2475. HomeCursor         Moves cursor to beginning of the file buffer.
  2476.  
  2477. IndentBlock        Inserts a space at the beginning of each line in
  2478.                    the highlighted (selected) text.
  2479.  
  2480. InsertText         Inserts the literal "string" in the buffer at
  2481.                    the current cursor location. Use the syntax
  2482.                    InsertText(string) to call this command.
  2483.  
  2484. LeftOfLine         Moves cursor to beginning of the current line.
  2485.  
  2486. LiteralChar        Inserts the character at the current cursor
  2487.                    location, without doing any special processing
  2488.                    for newline, tab characters, etc. Use the syntax
  2489.                    LiteralChar(c), where c is a character or
  2490.                    integer value.
  2491.  
  2492. MarkBufModified    Sets a flag indicating that the contents of the
  2493.                    buffer are different than what is in the
  2494.                    corresponding disk file.
  2495.  
  2496.  
  2497. Appendix A Page 50
  2498.  
  2499.  
  2500. Table 1.1: TEMC editor commands (continued)
  2501. -------------------------------------------------------------------
  2502. Command name       What the editor does
  2503. -------------------------------------------------------------------
  2504.  
  2505. MarkBufUnModified  Clears a flag, thus indicating that the contents
  2506.                    of the buffer can be assumed to be identical to
  2507.                    what is in the disk file.
  2508.  
  2509. MatchPairBackward  Same as MatchPairForward except if the cursor is
  2510.                    on a ' or ", searches backward for the matching
  2511.                    character.
  2512.  
  2513. MatchPairForward   If the cursor is on one of the characters (, ),
  2514.                    {, }, [, ], or on the first character of one of
  2515.                    the pairs /* or */, searches in the appropriate
  2516.                    direction for the closest instance of the
  2517.                    matching delimiter. If the cursor is on the
  2518.                    character ' or ", searches forward for the
  2519.                    matching character. If a match is found, places
  2520.                    the cursor there.
  2521.  
  2522. MoveBlock          Like CopyBlock, but also deletes the original
  2523.                    selected text.
  2524.  
  2525. MoveToBlockBegin   Moves cursor to the location marked as the
  2526.                    beginning of the selected text.
  2527.  
  2528. MoveToBlockEnd     Moves cursor to the location marked as the end
  2529.                    of the selected text.
  2530.  
  2531. MoveToMark         Moves the cursor to the location saved with
  2532.                    SetMark(n) command. Use the syntax
  2533.                    MoveToMark(n), where n is a one-digit number,
  2534.                    0-9.
  2535.  
  2536. MoveToPrevPos      Moves the cursor to the location specified by
  2537.                    the "previous position marker."
  2538.  
  2539. MoveToTempPos      Moves the cursor to the saved temporary marker.
  2540.  
  2541. OutdentBlock       Deletes a leading space, if any, from the
  2542.                    beginning of each line in the highlighted
  2543.                    (selected) text.
  2544.  
  2545. PageDown           Moves cursor down by number of lines in the
  2546.                    window.
  2547.  
  2548. PageScreenDown     Scrolls screen down by numer of lines in the
  2549.                    window, leaving cursor position unchanged.
  2550.  
  2551. PageScreenUp       Scrolls screen up by numer of lines in the
  2552.                    window, leaving cursor position unchanged.
  2553.  
  2554.  
  2555.  
  2556. Appendix A Page 51
  2557.  
  2558.  
  2559. Table 1.1: TEMC editor commands (continued)
  2560. -------------------------------------------------------------------
  2561. Command name       What the editor does
  2562. -------------------------------------------------------------------
  2563.  
  2564. PageUp             Moves cursor up by number of lines in the
  2565.                    window.
  2566.  
  2567. PaintScreen        Redraws the entire window, assuming that the
  2568.                    screen still correctly displays what the editor
  2569.                    last drew on it.
  2570.  
  2571. ReDo               Performs an Redo operation. Exactly what happens
  2572.                    depends on the option settings.
  2573.  
  2574. RightOfLine        Moves cursor to end of current line.
  2575.  
  2576. RightOfWord        Moves cursor to the next column that follows the
  2577.                    end of a word.
  2578.  
  2579. ScrollScreenDown   Scrolls screen down one line, leaving cursor
  2580.                    position unchanged.
  2581.  
  2582. ScrollScreenUp     Scrolls screen up one line, leaving cursor
  2583.                    position unchanged.
  2584.  
  2585. SetAutoIndent      Sets the Auto Indent option On.
  2586.  
  2587. SetAutoOutdent     Sets the Backspace Unindents option On.
  2588.  
  2589. SetBlockBeg        Sets the beginning of the selected text to be
  2590.                    the character at the current cursor location.
  2591.  
  2592. SetBlockEnd        Sets the end of the selected text to be the
  2593.                    character at the current cursor location.
  2594.  
  2595. SetCursorThroughTabMode
  2596.                    Sets the Cursor Through Tabs option On.
  2597.  
  2598. SetInsertMode      Sets Insert/Overwrite option to Insert.
  2599.  
  2600. SetMark            Sets a marker to point to the character at the
  2601.                    current cursor location, so a later
  2602.                    MoveToMark(n) comand can restore the cursor. Use
  2603.                    the syntax SetMark(n), where n is a one digit
  2604.                    number, 0-9.
  2605.  
  2606. SetOptimalFillMode Sets Optimal Fill option On.
  2607.  
  2608. SetPrevPos         Sets a marker (the previous position marker) to
  2609.                    point to the character at the current cursor
  2610.                    location. This marker location changes only by a
  2611.                    call to SetPrevPos or SwapPrevPos.
  2612.  
  2613. SetTabbingMode     Sets Use Tab Char option On.
  2614.  
  2615.  
  2616.  
  2617. Appendix A Page 52
  2618.  
  2619.  
  2620.  
  2621. Table 1.1: TEMC editor commands (continued)
  2622. -------------------------------------------------------------------
  2623. Command name       What the editor does
  2624. -------------------------------------------------------------------
  2625.  
  2626. SetTempPos         Saves the cursor location in a temporary marker
  2627.                    that can be used by some internal editor
  2628.                    commands. This is not a practical application in
  2629.                    user-defined macros. Use SetMark instead.
  2630.  
  2631. SmartRefreshScreen Redraws the window, skipping any portions that
  2632.                    the editor is sure are unmodified since the last
  2633.                    redraw.
  2634.  
  2635. SmartTab           Inserts space or tab characters in accordance
  2636.                    with the current settings of the Use Tab Char
  2637.                    option, Tab Width.
  2638.  
  2639. SwapPrevPos        Exchanges the values of the cursor and the
  2640.                    "previous position marker."
  2641.  
  2642. ToggleAutoIndent   Toggles the state of the Auto Indent option.
  2643.  
  2644. ToggleAutoOutdent  Toggles the state of the Backspace Unindents
  2645.                    option.
  2646.  
  2647. ToggleCursorThroughTabMode
  2648.                    Toggles the state of the Cursor Through Tabs
  2649.                    option.
  2650.  
  2651. ToggleHideBlock    Toggles the state of the highlight (selected)
  2652.                    text flag (see HighlightBlock).
  2653.  
  2654. ToggleInsert       Toggles state of Insert/Overwrite option.
  2655.  
  2656. ToggleOptimalFillMode
  2657.                    Toggles state of Optimal Fill option.
  2658.  
  2659. ToggleTabbingMode  Toggles state of Use Tab Char option.
  2660.  
  2661. TopOfScreen        Moves cursor to the top line currently displayed
  2662.                    in the window, leaving column unchanged.
  2663.  
  2664. UnDo               Performs an Undo operation. Exactly what happens
  2665.                    depends on the option settings.
  2666.  
  2667. WordLeft           Moves cursor to beginning of previous word, or
  2668.                    to end of previous line, whichever is first.
  2669.  
  2670. WordRight          Moves cursor to beginning of next word, or to
  2671.                    the end of a line, whichever is first.
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677. Appendix A Page 53
  2678.  
  2679.  
  2680. The following commands cause an exit from the editor, and so can
  2681. only appear as the last command of a macro:
  2682. ___________________________________________________________________
  2683.  
  2684. Exit           Exits editor, highlights top menu bar.
  2685.  
  2686. GetFindString  Opens a dialog box for the Search operation.
  2687.  
  2688. PrintBlock     Writes selected text to the printer.
  2689.  
  2690. ReadBlock      Opens dialog box requesting a file name to be read into
  2691.                the buffer at the cursor location and marked as
  2692.                selected text.
  2693.  
  2694. RepeatSearch   Searches again, using previous parameters.
  2695.  
  2696. Replace        Opens an dialog box for the Replace operation.
  2697.  
  2698. WordHelp       Opens a help window for word at cursor.
  2699.  
  2700. WriteBlock     Opens dialog box requesting a file name to which the
  2701.                selected text will be written.
  2702. ___________________________________________________________________
  2703.  
  2704. Each of the following commands correspond to the action performed
  2705. by one of the IDE hot keys. They also cause an exit from the
  2706. editor.
  2707. ___________________________________________________________________
  2708.  
  2709. AddWatch        Adds a watch item (Ctrl-F7).
  2710. ClipClear       Deletes selected text (Ctrl-Del).
  2711. ClipCopy        Copys selected text to Clipboard (Ctrl-Ins).
  2712. ClipCut         Cuts selected text to Clipboard (Shift-Del).
  2713. ClipPaste       Pastes Clipboard into buffer at cursor (Shift-Ins).
  2714. ClipShow        Shows Clipboard (no hot key defined).
  2715. CloseWindow     Closes editor window (Alt-F3).
  2716. CompileFile     Compiles current buffer (Alt-F9).
  2717. CompileMenu     Selects Compile menu (Alt-C).
  2718. DebugMenu       Selects Debug menu (Alt-D).
  2719. EditMenu        Selects Edit menu (Alt-E).
  2720. FileMenu        Selects File menu (Alt-F).
  2721. GotoWindow1     Selects window #1 (Alt-1).
  2722. GotoWindow2     Selects window #2 (Alt-2).
  2723. GotoWindow3     Selects window #3 (Alt-3).
  2724. GotoWindow4     Selects window #4 (Alt-4).
  2725. GotoWindow5     Selects window #5 (Alt-5).
  2726. GotoWindow6     Selects window #6 (Alt-6).
  2727. GotoWindow7     Selects window #7 (Alt-7).
  2728. GotoWindow8     Selects window #8 (Alt-8).
  2729. GotoWindow9     Selects window #9 (Alt-9).
  2730. Help            Context sensitive help (Ctrl-F1).
  2731.  
  2732.  
  2733.  
  2734. Appendix A Page 54
  2735.  
  2736.  
  2737. HelpMenu        Selects Help menu (Alt-H).
  2738. Inspect         Inspects item (Alt-F4).
  2739. LastHelp        Opens previous help window (Alt-F1).
  2740. MakeProject     Makes project (F9).
  2741. Menu            Highlights top menu bar.
  2742. Modify          Evaluates expression/modify variable (Ctrl-F4).
  2743. NextError       Moves to next item in message window (Alt-F8).
  2744. NextWindow      Selects next window in IDE (F6).
  2745. OpenFile        Opens dialog box for File Open (F3).
  2746. OptionsMenu     Selects Options menu (Alt-O).
  2747. PrevError       Moves to previous item in message window (Alt-F7).
  2748. Quit            Exits the IDE (Alt-X).
  2749. ResetProgram    Resets program being debugged (Ctrl-F2).
  2750. RunMenu         Selects Run menu (Alt-R).
  2751. RunProgram      Makes and runs current executable (Ctrl-F9).
  2752. RunToHere       Runs program until statement at cursor (F4).
  2753. SaveFile        Saves current editor buffer (F2).
  2754. SearchMenu      Selects Search menu (Alt-S).
  2755. Step            Step over (F8).
  2756. SystemMenu      Selects Sytem menu (Alt-Spacebar).
  2757. Trace           Trace into (F7).
  2758. ViewCallStack   Views Call Stack (Ctrl-F3).
  2759. ViewUserScreen  Displays User Screen (Alt-F5).
  2760. WindowList      Displays window list (Alt-0).
  2761. WindowMenu      Selects Window menu (Alt-W).
  2762. ZoomWindow      Zooms/unzoomd current window (F5).
  2763. _______________________________________________________________
  2764.  
  2765. Appendix A Page 55
  2766.  
  2767.  
  2768.  
  2769. INDEX
  2770. ___________________________________________________________________
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776. [ ] GREP operator 14                command line
  2777. /? THELP help option 38, 40           syntax
  2778. $ GREP operator 14                      CPP 8
  2779. * GREP operator 14                  configuration files
  2780. + GREP operator 14                    BCC file 8
  2781. . GREP operator 14                    CPP (preprocessor) and 8
  2782. \ GREP operator 14                  conversion
  2783. ^ GREP operator 14                    trigraphs 42
  2784. ? THELP option 38, 40               CPP (preprocessor) 8-9
  2785.                                       command-line options and
  2786.                                       syntax 8
  2787. A                                     directory 8
  2788. ATT6300                               example of use 9
  2789.   running THELP on 36                 files
  2790.                                         compiling 9
  2791.                                       -P option (source file names
  2792. B                                       and line numbers) 8
  2793. BGIOBJ (graphics converter) 2-8       wildcards and 8
  2794.   advanced features 5
  2795.   command-line syntax 2, 5
  2796.   components 5                      D
  2797.   example 3                         -d GREP option (directories) 11
  2798.   graphics.h and 6                  /D OBJXREF option (directory)
  2799.   options                             21
  2800.     destination file 5              debugging
  2801.     /F 5                              include files 8
  2802.     file name 5                       macros 8
  2803.     file name (/F) 4                directories
  2804.     public name 5                     CPP (preprocessor) 8
  2805.     segment class 6                   GREP option 11
  2806.     segment name 6                    .OBJ files 21
  2807.     source file 5
  2808.  
  2809.                                     E
  2810. C                                   editor macros 45
  2811. -c GREP option (count only) 11      errors
  2812. /C THELP option (select color)        linker
  2813.   38                                    graphics drivers and fonts
  2814. case sensitivity                        4
  2815.   GREP option 11                      OBJXREF (list) 32
  2816. characters                          examples
  2817.   trigraph                            OBJXREF 26-32
  2818.     converting 42
  2819.                                     F
  2820.                                     /F BGIOBJ option 5
  2821.  
  2822.  
  2823.  
  2824. Index                                                            56
  2825.  
  2826.  
  2827. /F BGIOBJ option (far routines)     GREP (file searcher) 9-19
  2828.   4                                   examples 15
  2829. /F OBJXREF option (include full       files to search 15
  2830.   library) 22                         help 10
  2831. /F THELP option 40                    literal character 14
  2832. /F THELP option (help file path       matches 14
  2833.   and name) 38                        operators 14
  2834. files                                 optimizing use of 13
  2835.   dates                               options
  2836.     changing 41                         case sensitivity (-i) 11
  2837.   destination                           count only (-c) 11
  2838.     BGIOBJ 5                            default 12, 13
  2839.   linker response, used by OBJXREF      discussion 11
  2840.     26, 31                              file names (printing) 13
  2841.   macros                                -i (case sensitivity) 11
  2842.     expanded 8                          line numbers (-n) 11
  2843.   matching                              lines, nonmatching (-v) 12
  2844.     GREP option 11                      list matching files (-l) 11
  2845.   names                                 -n (line numbers) 11
  2846.     printing (GREP) 13                  -o (UNIX output format) 11
  2847.   output, generated by OBJXREF          precedence 13
  2848.     22                                  regular expression search
  2849.   searching 9-19                        (-r) 12
  2850.   source                                UNIX format (-o) 11
  2851.     BGIOBJ 5                            updating (-u) 12
  2852. fonts                                   -v 13
  2853.   adding to graphics library 2          -v (nonmatching lines) 12
  2854.   files, converting to .OBJ             verbose 13
  2855.   files 2                               word search (-w) 12
  2856.   included with Borland C++ 3         search strings 13
  2857.   linker errors and 4                   white space in 15
  2858.   linking 2-8                         using 10
  2859.   registering 2, 6                    wildcards and 15
  2860.   stroked 2-8                       GREP.COM 13
  2861.     linking 2
  2862.  
  2863.                                     H
  2864. G                                   /H THELP option (help) 38, 40
  2865. graphics drivers                    header files
  2866.   adding to graphics library 2        graphics.h 6
  2867.   converting to .OBJ files 2,       help
  2868.   2-8                                 GREP (file searcher) 10
  2869.   included with Borland C++ 3         OBJXREF 21
  2870.   linker                              THELP 38, 40
  2871.     errors and 4                    hot keys
  2872.   linking 2                           scan codes 40
  2873.   registering 2, 6
  2874. graphics.h (header file)
  2875.   BGIOBJ and 6                      I
  2876. GRAPHICS.LIB                        -i GREP option (case
  2877.   adding to 2                         sensitivity) 11
  2878.  
  2879.  
  2880.  
  2881.  
  2882. Index Page 57
  2883.  
  2884.  
  2885. /I OBJXREF option (case             N
  2886.   sensitivity) 21                   -n command-line compiler option
  2887. include files                         CPP (preprocessor) and 8
  2888.   debugging 8                       -n GREP option (line numbers)
  2889.                                       11
  2890.                                     /N OBJXREF option (limit
  2891. K                                     reports) 24
  2892. /K THELP option (change hot
  2893.   key) 38, 40
  2894. keyboard                            O
  2895.   trigraph program 42               -o GREP option (UNIX format
  2896.                                       output) 11
  2897.                                     /O OBJXREF option (output file
  2898. L                                     for reports) 22
  2899. -l GREP option (list matching       .OBJ files
  2900.   files) 11                           converting font files into 2
  2901. /L OBJXREF command (linker            converting graphics drivers
  2902.   response file) 26                   files into 2
  2903. libraries                             defined 20
  2904.   files 20                            directories 21
  2905.     contents of 20                    names 20
  2906.   graphics                            response files and 25
  2907.     adding driver and font          object modules
  2908.     files to 2                        defined 20
  2909.   OBJXREF                             names 20
  2910.     including all 22                OBJXREF (object module cross-
  2911. lines                                 referencer) 19-33
  2912.   numbering                           directories 21
  2913.     printing (GREP) 11                error messages 32
  2914. linker                                examples of reports 27, 28,
  2915.   error: segment exceeds 64K 4        29, 30, 31
  2916.   response files                      help 21
  2917.     used by OBJXREF 26, 31            /L command (linker response
  2918. linking                               files) 26
  2919.   graphics drivers 2                  linker files
  2920.                                         as response files 26
  2921.                                       options 20
  2922. M                                       /N (limit information) 24
  2923. macros                                  /RV 24
  2924.   CPP (preprocessor) and 8              /RC 29
  2925.   debugging 8                           control 21
  2926.   editor 45
  2927.   expanded                              directories (/D) 21
  2928.     list of 8                           /F (include full library)
  2929.   preprocessing 8                       22
  2930.   preprocessor 8                        ignore case (/I) 21
  2931. MAKE (program manager)                  include full library (/F)
  2932.   modifying 41                          22
  2933.   project files and 34                  include zero-length segment
  2934.                                         definitions (/Z) 23
  2935.                                         list file names (/V) 23
  2936.                                         modified reports 24
  2937.                                         /O (output file) 22
  2938.  
  2939.  
  2940.  
  2941. Index                                                            58
  2942.  
  2943.  
  2944.     reports 23                      PRJCNVT (project file
  2945.       by class type (/RC) 23,         converter) 34
  2946.       29, 31                        project files
  2947.       by external reference (/        OBJXREF and 25
  2948.       RX) 24, 28                      used by OBJXREF 31
  2949.       by module (/RM) 23, 27        projects
  2950.       by public names (/RP) 23,       configuration 33
  2951.       27                              files
  2952.       by reference (/RR) 23,            converting from old
  2953.       28, 31                            versions 34
  2954.       default type 31                   converting to MAKE files 34
  2955.       examples 26-31                public names
  2956.       of all types (/RV) 24           defined 19
  2957.       of module sizes (/RS) 23,
  2958.       29
  2959.       of unreferenced symbol        R
  2960.       names (/RU) 24, 30            -r GREP option (regular
  2961.       output file (/O) 22             expression search) 12
  2962.       verbose (/RV) 24, 31, 32      /RC OBJXREF option (report) 29
  2963.     /V (verbose output) 23          /RC OBJXREF option (reports) 23
  2964.     verbose report (/RV) 31         registerbgidriver (function)
  2965.     /Z (include zero-length           BGIOBJ and 2, 6
  2966.     segment definitions) 23         registerbgifont (function)
  2967.   project files                       BGIOBJ and 2, 6
  2968.     as response files 25            registerfarbgidriver (function)
  2969.   project files (/P) 25               BGIOBJ and 4, 5, 6
  2970.   reports 21                        registerfarbgifont (function)
  2971.     examples 26-31                    BGIOBJ and 4, 5, 6
  2972.     modifying 24                    response files
  2973.     output file for (/O) 22           file-name extensions and 25
  2974.   response files 20, 24               formats 25
  2975.     example 31                        free-form 25
  2976.     linker 26                           example 31
  2977.   warnings 32                         linker files and 26
  2978.   wildcards and 21                    OBJXREF and 20, 24, 26
  2979. operators                               example 31
  2980.   GREP 14                             project files and 25
  2981. output file                           TLINK, OBJXREF and 31
  2982.   generated by OBJXREF 22           /RM OBJXREF option (reports) 23
  2983.                                     /RP OBJXREF option (reports) 23
  2984.                                     /RR OBJXREF option (reports) 23
  2985. P                                   /RS OBJXREF option (reports) 23
  2986. -P CPP (preprocessor) option        /RU OBJXREF option (reports) 24
  2987.   (source file names and line       /RV OBJXREF option (reports) 24
  2988.   numbers) 9                        /RX OBJXREF option (reports) 24
  2989. /P OBJXREF command (project
  2990.   files) 25
  2991. precedence                          S
  2992.   GREP options 13                   /S THELP option (snow checking)
  2993. PRJ2MAK (project file                 38, 41
  2994.   converter) 34                     scan codes 40
  2995. PRJCFF () 33                        screens, width, TLINK 38
  2996.  
  2997.  
  2998.  
  2999. Index Page 59
  3000.  
  3001.  
  3002. searches                              quitting 37
  3003.   text files 9-19                     removing from memory 38, 41
  3004. standalone utilities                  scan codes 40
  3005.   list 1                              using 36
  3006. strings                             TLINK (linker)
  3007.   searching for                       response files
  3008.     as expressions (GREP) 12            OBJXREF and 26
  3009.     in text files 9-19              TOUCH 41, 42
  3010. syntax                              trigraphs
  3011.   CPP 8                               translating 42
  3012.                                       undo option (-u) 43
  3013.                                     TURBOC.CFG 8
  3014. T                                   Turbo Editor Macro Language 45
  3015. text files
  3016.   searching 9-19                    U
  3017. THELP (Turbo Help utility)          -u GREP option (updating) 12
  3018.   36-41                             /U THELP option 41
  3019.   additional help on                /U THELP option (remove THELP)
  3020.   highlighted word 37                 38
  3021.   ATT6300 and 36                    UNIX
  3022.   cursor keys 37                      format (GREP) 11
  3023.   hot keys 37                       utilities
  3024.   index 37                            TOUCH 41
  3025.   invoking 36
  3026.   keywords 37
  3027.   loading 36                        V
  3028.   options 38-41                     -v GREP option (nonmatching
  3029.     colors (/C) 38                    lines) 12
  3030.     colors (/C)  38                 /V OBJXREF option (verbose
  3031.     help file path (/F) 38, 40        output) 23
  3032.     help on (/?
  3033.       /H
  3034.         ?) 38, 40                   W
  3035.     help screen colors (/C) 38      -w GREP option (word search) 12
  3036.     hot keys (/K) 38, 40            /W THELP option (save options)
  3037.     reassign hot keys (/K) 38,        38, 41
  3038.     40                              wildcards
  3039.     removing THELP (/U) 38, 41        CPP (preprocessor) and 8
  3040.     saving options (/W) 38            OBJXREF and 21
  3041.     screen colors (/C) 38             TOUCH and 42
  3042.     snow checking (/S) 38, 41
  3043.     /U (removing THELP) 38, 41
  3044.     /W (save options) 38, 41        Z
  3045.     write options to THELP and      -z GREP option (verbose) 13
  3046.     exit 38, 41                     /Z OBJXREF option (include
  3047.   paging through 37                   zero-length segment
  3048.   paste page 37                       definitions) 23
  3049.   previous screens 37
  3050.  
  3051. Index                                                            60
  3052.