home *** CD-ROM | disk | FTP | other *** search
- SNIPIT32 Code Viewer Documentation
- --------------------------------
-
- Contents
- --------
- I. List of shipped files
- II. Prerequisites
- III. Using SNIPIT32 Code Viewer
-
-
- I. List of shipped files
- ------------------------
-
- aliases.c Displays the aliases available in the current configuration
- file.
- batmove.c Shows how to use the DbiBatchMove function
- blobio.c Shows how to use BLOBs
- blobsmpl.c A simple example of using BLOBs
- block.c How to use blockmove to speed up table access
- bookmark.c Saving the current record position using bookmarks
- callback.c Registering a function to be automatically called by BDE.
- config.c Dsplaying the information in the configuration file
- cr8dbtbl.c How to create a dBASE table
- cr8pxtbl.c How to create a Paradox table
- cr8txtbl.c How to create a Text table
- dbio.c How to manipulate databases
- drvcaps.c Determining the capabilities of the available drivers
- errval.c Getting the error value and displaying error information
- fieldmap.c Changing the fields which are used in a table
- filter.c Limiting the records accessable from a table using filters
- format.c Getting the date and time format from the configuration file
- idxdbase.c Using dBASE indexes
- idxexpr.c Using dBASE expression indexes
- idxpdox.c Using Paradox indexes
- initeng.c How to initialize BDE
- inmemtbl.c How to create an in-memory table
- lnkcrsr.c How to limit the records of one table depending on the current
- record in another table
- lsql.c A simple SQL example on a local table
- lsqljoin.c An SQL join of a dBASE and a Paradox table
- lsqllive.c Showing the use of a live answer table
- navigate.c How to use navigation with BDE
- optparam.c Using optional paramaters when creating a table
- password.c Using Passwords with Paradox tables
- prdxsort.c Sorting Paradox tables
- qbe.c A simple Query by Example (QBE) example
- qbe2.c A join of a dBASE and a Paradox table using QBE
- range.c Limiting the records returned from a table to within an upper
- and lower range
- rdolock.c Creating a read-only directory (Paradox only)
- reclock.c Locking Records
- recupdat.c Inserting and modifying records
- refinteg.c Creating Referential Integrity Links
- search.c How to search tables
- secdesc.c Using Auxilliary Passords, also called security descriptors.
- (Paradox Only)
- session.c Using multiple sessions with BDE
- softdel.c How to set properties and use soft delete (dBASE only)
- sqlbind.c Parameter binding in SQL statements
- sysinfo.c Getting information about the BDE system
- tblinfo.c Getting information about a table
- tbllist.c Getting a list of the available tables
- tbllock.c Using table locking
- tblopen.c How to open a table
- tbrstrct.c Restructuring a table
- test.c Basic framework to use for testing or creating new examples
- textexp.c Exporting data from a Paradox table to a Text table
- textimp.c Importing data from a Text table to a dBASE table
- transact.c Using transactions and SQL on remote tables
- upsize.c Copying local tables to a server.
- valcheck.c Shows how to use validity checks (Paradox only)
-
- input.c Used by SNIPIT32 for keeping track of the examples
- snipdata.c Contains the global data used by SNIPIT32
- snipmain.c The main portion of the SNIPIT32 Code Viewer
- sniptool.c Helper functions used by the examples
- snipit.h Contains prototypes for functions used by the SNIPIT32 Code
- Viewer
- id_defs.h File contains #defines used in the SNIPIT32 Code Viewer
-
- makefile Makefile for Borland C++ v4.0 and later
- snipit.ide Project file for BC 4.x
- snipit.def Module Definition file
- snipit.rc Resource file
-
- II. Prerequisites
- -----------------
-
- The following software must be installed to run SNIPIT32 Code Viewer:
- -BDE32 Software Development Kit (SDK)
- -Microsoft Windows NT v3.51 or Windows 95
-
- The following software must be installed to run SNIPIT32 Code Viewer from
- a debugger:
- -Borland C++ Version 5.x
- -Borland C++ Integrated Debugger or Borland External 32-Bit Debugger
-
- III. Using SNIPIT32 Code Viewer
- -----------------------------
-
- Overview
- --------
- SNIPIT32 Code Viewer is part of the BDE32 SDK; it is an online utility
- for viewing and running pre-compiled and linked C code samples that
- demonstrate BDE function calls. You can select a code sample from a
- list, display it on screen, and cut and paste selections into your own
- source code. You can run the code sample, and watch as its output
- messages are displayed on screen. You can also run SNIPIT32 Code Viewer
- with an online debugger, stepping through each line of code as it
- executes.
-
- Starting SNIPIT32 Code Viewer
- ---------------------------
- Start the SNIPIT32 Code Viewer by double-clicking the SNIPIT32 Code Viewer
- icon in the BDE SDK program group. The SNIPIT32 Code Viewer window is
- displayed full screen. You can adjust the window size, or reduce it to
- an icon.
-
- Finding the Appropriate Code Sample
- -----------------------------------
- 1. Find the Code Sample by scrolling through the Sample Code list box.
- Each code sample is named for the type of BDE functionality it
- demonstrates. For example, 'Table: Create Paradox' shows how to create
- and delete a simple Paradox table.
-
- 2. Click once to select the code sample. When a code sample is selected,
- the Description list box describes briefly what it does, for example:
-
- Create a Paradox table, insert 10 records, then delete the table.
-
- The name of the file where the code sample resides is displayed below
- the Description list box, for example:
-
- cr8pxtbl.c
-
- All SNIPIT32 sample code is installed in the SNIPIT directory.
-
-
- Viewing Sample Code
- -------------------
- 1. Double-click the selected code sample or choose the View button (or
- choose View from the File pull-down menu). The selected code sample is
- displayed in the Sample Code Viewer window.
-
- 2. Use the scroll bar in the Sample Code Viewer window to scroll through
- the source code.
-
- Each code sample is stand-alone, so there is a fair amount of redundant
- code used to perform routine operations such as initializing the engine
- and closing the database. For simplicity's sake, SNIPIT32 Code Viewer
- does not display all of this redundant code. You see only the names of
- the internal support functions that perform these routine operations:
- - ChkRslt
- Outputs the supplied string if the actual result does
- not equal the expected result.
- - CloseDbAndExit
- Closes the specified database and exits BDE.
- - CreateAndFillTable
- Creates a table and fills it with random data. This function
- uses the internal support function FillTable () to generate
- the data. Examples for all BDE field types are included in
- this function.
- - DisplayInMemoryTable
- Dumps a specified number of records to the screen from the
- specified in-memory table (i.e., virtual table).
- - DisplayTable
- Dumps a specified number of records to the screen from the
- specified table.
- - FillTable
- Fills the specified table with random data. This routine can
- generate data for any BDE field type.
- - InitAndConnect
- Initializes BDE and connects to a standard database
- (i.e., one used by dBASE and Paradox).
- - InitAndConnect2
- Initializes BDE and connects to an SQL database. This
- function displays available databases and allows the user
- to select which database is used.
- - MakeFullPath
- Returns the fully qualified path to the BDE working
- directory.
- - Screen
- Outputs a supplied string to the edit control.
- - WinMsg
- Pops up a Windows message box. This function is similar to,
- but easier to use than the Windows function MessageBox().
-
-
- Cutting and Pasting Sample Code
- -------------------------------
- 1. Select the code you want to copy from the Sample Code Viewer window,
- and choose the Copy button to copy it to the clipboard (or choose Copy
- text from the Edit Menu). Note that all text in the output edit control
- will be copied if no text is selected.
-
- 2. Paste the code from the clipboard into your program's source code.
-
-
- Running Sample Code
- -------------------
- 1. Choose the Run button to execute the selected code sample . Note that
- the Sample Code Viewer window has now become the Sample Code Output
- window; it displays the code sample's output as the code executes. If
- you are running SNIPIT32 Code Viewer without a debugger, these output
- messages are all you see.
-
- 2. To step through the each line of source code as the application
- executes, run SNIPIT32 Code Viewer from an online debugger, as follows:
-
- a. Start the online debugger, and run snipit32.exe. There is no need
- to set a breakpoint; a breakpoint has been pre-set at the
- beginning of each code sample.
-
- Note: The preferred application for running the samples is under the
- Borland C++ Version 5.0 Integrated Development Environment
- (IDE). The suplied BDE32.TOK file can be used in the IDE to
- do syntax highlighting of the BDE functions and types. This
- makes it much easier to see the BDE-specific parts of the
- code. You can also link the BDE.HLP file into the OpenHelp
- system for context sensitive help to BDE functions.
-
- Note: If you cannot run SNIPIT32 Code Viewer with your debugger, you may
- need to recompile SNIPIT32 Code Viewer. (It is shipped pre-compiled
- with Borland C++ Version 5.0).
-
- b. When the SNIPIT32 Code Viewer window is displayed, select the code
- sample you wish to run, and choose the Run button.
-
- c. The online debugger stops execution at the breakpoint at the
- beginning of the selected code sample. You can now step through
- each line of code as it executes, using the appropriate options of
- your debugger.
-