home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / 32SNIPIT.PAK / SNIPIT.TXT < prev    next >
Encoding:
Text File  |  1997-05-06  |  10.2 KB  |  233 lines

  1.                        SNIPIT32 Code Viewer Documentation
  2.                        --------------------------------
  3.  
  4. Contents
  5. --------
  6. I.     List of shipped files
  7. II.    Prerequisites
  8. III.   Using SNIPIT32 Code Viewer
  9.  
  10.  
  11. I. List of shipped files
  12. ------------------------
  13.  
  14. aliases.c   Displays the aliases available in the current configuration
  15.             file.
  16. batmove.c   Shows how to use the DbiBatchMove function
  17. blobio.c    Shows how to use BLOBs
  18. blobsmpl.c  A simple example of using BLOBs
  19. block.c     How to use blockmove to speed up table access
  20. bookmark.c  Saving the current record position using bookmarks
  21. callback.c  Registering a function to be automatically called by BDE.
  22. config.c    Dsplaying the information in the configuration file
  23. cr8dbtbl.c  How to create a dBASE table
  24. cr8pxtbl.c  How to create a Paradox table
  25. cr8txtbl.c  How to create a Text table
  26. dbio.c      How to manipulate databases
  27. drvcaps.c   Determining the capabilities of the available drivers
  28. errval.c    Getting the error value and displaying error information
  29. fieldmap.c  Changing the fields which are used in a table
  30. filter.c    Limiting the records accessable from a table using filters
  31. format.c    Getting the date and time format from the configuration file
  32. idxdbase.c  Using dBASE indexes
  33. idxexpr.c   Using dBASE expression indexes
  34. idxpdox.c   Using Paradox indexes
  35. initeng.c   How to initialize BDE
  36. inmemtbl.c  How to create an in-memory table
  37. lnkcrsr.c   How to limit the records of one table depending on the current
  38.             record in another table
  39. lsql.c      A simple SQL example on a local table
  40. lsqljoin.c  An SQL join of a dBASE and a Paradox table
  41. lsqllive.c  Showing the use of a live answer table
  42. navigate.c  How to use navigation with BDE
  43. optparam.c  Using optional paramaters when creating a table
  44. password.c  Using Passwords with Paradox tables
  45. prdxsort.c  Sorting Paradox tables
  46. qbe.c       A simple Query by Example (QBE) example
  47. qbe2.c      A join of a dBASE and a Paradox table using QBE
  48. range.c     Limiting the records returned from a table to within an upper
  49.             and lower range
  50. rdolock.c   Creating a read-only directory (Paradox only)
  51. reclock.c   Locking Records
  52. recupdat.c  Inserting and modifying records
  53. refinteg.c  Creating Referential Integrity Links
  54. search.c    How to search tables
  55. secdesc.c   Using Auxilliary Passords, also called security descriptors.
  56.             (Paradox Only)
  57. session.c   Using multiple sessions with BDE
  58. softdel.c   How to set properties and use soft delete (dBASE only)
  59. sqlbind.c   Parameter binding in SQL statements
  60. sysinfo.c   Getting information about the BDE system
  61. tblinfo.c   Getting information about a table
  62. tbllist.c   Getting a list of the available tables
  63. tbllock.c   Using table locking
  64. tblopen.c   How to open a table
  65. tbrstrct.c  Restructuring a table
  66. test.c      Basic framework to use for testing or creating new examples
  67. textexp.c   Exporting data from a Paradox table to a Text table
  68. textimp.c   Importing data from a Text table to a dBASE table
  69. transact.c  Using transactions and SQL on remote tables
  70. upsize.c    Copying local tables to a server.
  71. valcheck.c  Shows how to use validity checks (Paradox only)
  72.  
  73. input.c     Used by SNIPIT32 for keeping track of the examples
  74. snipdata.c  Contains the global data used by SNIPIT32
  75. snipmain.c  The main portion of the SNIPIT32 Code Viewer
  76. sniptool.c  Helper functions used by the examples
  77. snipit.h    Contains prototypes for functions used by the SNIPIT32 Code
  78.             Viewer
  79. id_defs.h   File contains #defines used in the SNIPIT32 Code Viewer
  80.  
  81. makefile    Makefile for Borland C++ v4.0 and later
  82. snipit.ide  Project file for BC 4.x
  83. snipit.def  Module Definition file
  84. snipit.rc   Resource file
  85.  
  86. II. Prerequisites
  87. -----------------
  88.  
  89.    The following software must be installed to run SNIPIT32 Code Viewer:
  90.       -BDE32 Software Development Kit (SDK)
  91.       -Microsoft Windows NT v3.51 or Windows 95
  92.  
  93.    The following software must be installed to run SNIPIT32 Code Viewer from
  94.    a debugger:
  95.       -Borland C++ Version 5.x
  96.       -Borland C++ Integrated Debugger or Borland External 32-Bit Debugger
  97.  
  98. III. Using SNIPIT32 Code Viewer
  99. -----------------------------
  100.  
  101. Overview
  102. --------
  103.    SNIPIT32 Code Viewer is part of the BDE32 SDK; it is an online utility
  104.    for viewing and running pre-compiled and linked C code samples that
  105.    demonstrate BDE function calls. You can select a code sample from a
  106.    list, display it on screen, and cut and paste selections into your own
  107.    source code. You can run the code sample, and watch as its output
  108.    messages are displayed on screen. You can also run SNIPIT32 Code Viewer
  109.    with an online debugger, stepping through each line of code as it
  110.    executes.
  111.  
  112. Starting SNIPIT32 Code Viewer
  113. ---------------------------
  114.    Start the SNIPIT32 Code Viewer by double-clicking the SNIPIT32 Code Viewer
  115.    icon in the BDE SDK program group. The SNIPIT32 Code Viewer window is
  116.    displayed full screen. You can adjust the window size, or reduce it to
  117.    an icon.
  118.  
  119. Finding the Appropriate Code Sample
  120. -----------------------------------
  121. 1. Find the Code Sample by scrolling through the Sample Code list box.
  122.    Each code sample is named for the type of BDE functionality it
  123.    demonstrates. For example, 'Table: Create Paradox' shows how to create
  124.    and delete a simple Paradox table.
  125.  
  126. 2. Click once to select the code sample. When a code sample is selected,
  127.    the Description list box describes briefly what it does, for example:
  128.  
  129.       Create a Paradox table, insert 10 records, then delete the table.
  130.  
  131.    The name of the file where the code sample resides is displayed below
  132.    the Description list box, for example:
  133.  
  134.       cr8pxtbl.c
  135.  
  136.    All SNIPIT32 sample code is installed in the SNIPIT directory.
  137.  
  138.  
  139. Viewing Sample Code
  140. -------------------
  141. 1. Double-click the selected code sample or choose the View button (or
  142.    choose View from the File pull-down menu). The selected code sample is
  143.    displayed in the Sample Code Viewer window.
  144.  
  145. 2. Use the scroll bar in the Sample Code Viewer window to scroll through
  146.    the source code.
  147.  
  148.    Each code sample is stand-alone, so there is a fair amount of redundant
  149.    code used to perform routine operations such as initializing the engine
  150.    and closing the database. For simplicity's sake, SNIPIT32 Code Viewer
  151.    does not display all of this redundant code. You see only the names of
  152.    the internal support functions that perform these routine operations:
  153.       - ChkRslt
  154.             Outputs the supplied string if the actual result does
  155.             not equal the expected result.
  156.       - CloseDbAndExit
  157.             Closes the specified database and exits BDE.
  158.       - CreateAndFillTable
  159.             Creates a table and fills it with random data. This function
  160.             uses the internal support function FillTable () to generate
  161.             the data. Examples for all BDE field types are included in
  162.             this function.
  163.       - DisplayInMemoryTable
  164.             Dumps a specified number of records to the screen from the
  165.             specified in-memory table (i.e., virtual table).
  166.       - DisplayTable
  167.             Dumps a specified number of records to the screen from the
  168.             specified table.
  169.       - FillTable
  170.             Fills the specified table with random data. This routine can
  171.             generate data for any BDE field type.
  172.       - InitAndConnect
  173.             Initializes BDE and connects to a standard database
  174.             (i.e., one used by dBASE and Paradox).
  175.       - InitAndConnect2
  176.             Initializes BDE and connects to an SQL database. This
  177.             function displays available databases and allows the user
  178.             to select which database is used.
  179.       - MakeFullPath
  180.             Returns the fully qualified path to the BDE working
  181.             directory.
  182.       - Screen
  183.             Outputs a supplied string to the edit control.
  184.       - WinMsg
  185.             Pops up a Windows message box. This function is similar to,
  186.             but easier to use than the Windows function MessageBox().
  187.  
  188.  
  189. Cutting and Pasting Sample Code
  190. -------------------------------
  191. 1. Select the code you want to copy from the Sample Code Viewer window,
  192.    and choose the Copy button to copy it to the clipboard (or choose Copy
  193.    text from the Edit Menu). Note that all text in the output edit control
  194.    will be copied if no text is selected.
  195.  
  196. 2. Paste the code from the clipboard into your program's source code.
  197.  
  198.  
  199. Running Sample Code
  200. -------------------
  201. 1. Choose the Run button to execute the selected code sample . Note that
  202.    the Sample Code Viewer window has now become the Sample Code Output
  203.    window; it displays the code sample's output as the code executes. If
  204.    you are running SNIPIT32 Code Viewer without a debugger, these output
  205.    messages are all you see.
  206.  
  207. 2. To step through the each line of source code as the application
  208.    executes, run SNIPIT32 Code Viewer from an online debugger, as follows:
  209.  
  210.      a. Start the online debugger, and run snipit32.exe. There is no need
  211.         to set a breakpoint; a breakpoint has been pre-set at the
  212.         beginning of each code sample.
  213.  
  214.      Note: The preferred application for running the samples is under the
  215.            Borland C++ Version 5.0 Integrated Development Environment
  216.            (IDE). The suplied BDE32.TOK file can be used in the IDE to
  217.            do syntax highlighting of the BDE functions and types. This
  218.            makes it much easier to see the BDE-specific parts of the
  219.            code. You can also link the BDE.HLP file into the OpenHelp
  220.            system for context sensitive help to BDE functions.
  221.  
  222.      Note: If you cannot run SNIPIT32 Code Viewer with your debugger, you may
  223.            need to recompile SNIPIT32 Code Viewer. (It is shipped pre-compiled
  224.            with Borland C++ Version 5.0).
  225.  
  226.      b. When the SNIPIT32 Code Viewer window is displayed, select the code
  227.         sample you wish to run, and choose the Run button.
  228.  
  229.      c. The online debugger stops execution at the breakpoint at the
  230.         beginning of the selected code sample. You can now step through
  231.         each line of code as it executes, using the appropriate options of
  232.         your debugger.
  233.