Home
dBworxPE Online Help Prev Page Prev Page
dBworxPE Help File
Overview
Features
Register
Paging
Design
Basics
Field Types
Special Field Types
External Fields
Graphics Fields
Formula Fields
Lookup Fields
Relational Fields
Examples
Operation
Navigation
Add/Edit/Delete Records
Webforms
Smart Forms
Searching
Sorting
Filtering
Action Menu
Saving
Backup/Restore
Keyboard Reference
Text/HTML Editor
Listings, Reports and Labels
Listings
Labels
Reports/Documents
Print/View Document
Print/View Report
Pie Charts
Import
Export
XML import/export
PDA import/export
Macros
Programming
Create web page
Connect to Database
Viewer
Templates
Entry Templates
Application Templates
Tools
Network/Multi-user
FAQ
Other Plworx products
License
Contact
MACROS:


 dBworxPE includes the ability to process
 "macro" files, to help automate certain 
 tasks (a macro is just a plain text file
 containing one or more commands which
 tell dBworxPE to perform certain actions). 

Macro files are simple in structure and can be created and edited
using any text editor (just be sure to save your macro file with a 
".dws" extension).

An example macro file code:

   005 
   Start sample macro - open the Sales file
   001
   c:\dbworx\examples\sales.dwh
   005 
   Now sort the Sales file by Product No. (field 3)
   120
   3
   005
   Save the sorted file as Sales1
   800
   c:\dbworx\examples\sales1.dwh
   005
   End of macro file


Listed below are the commands currently supported:

   001 - Open a dBworxPE database file
   005 - Display a message
   120 - Sort the current file in ascending order
   130 - Sort the current file in descending order
   150 - Set a filter
   160 - Remove a filter
   320 - Store a key field and a value field (for each
             record in the current file) in working 
             storage
   330 - Update a given field (for all records in the 
             current file) with data in working storage
   510 - Delete all records in the current file
   610 - Import a delimited file
   800 - Save the current dBworxPE file
   810 - Save the current file with a different name

  Note: Commands 320 and 330 are designed to work together to 
           allow you to update a master file with the transaction data
           in a different dBworxPE file.  The "macro2" example included
           with dBworxPE stores the "Stock No." (key field) and 
           "Quantity In/Out" (value field) data in working storage for
           all records in the "stocktrn" (transaction) file.  Then the
           macro opens the "stockmf" (master) file and finds a 
           matching "Stock No." record in the master file for each 
           "Stock No. - Quantity In/Out" transaction in working 
           storage.  Once a matching Stock No. is found, the 
           amount in the "Quantity In/Out" field is added to the 
           "Quantity on Hand" field in the master file.  The macro
           also deletes all records in the transaction file once the 
           data has been transferred to working storage, so that the
           transaction file is cleared for a new set of entries. 

Most commands require one or more addtional parameters, such as
a file name or column number.  For example, the command to open
a dBworxPE file (001) requires one additional parameter (the name of 
the file to open).  When creating the macro file the command would
be on a line by itself, with the file name on the next line:

   001 
   c:\myfiles\mydata.dwh

The parameters needed by each macro command are listed below:

001     [Open a dBworx file]
  Additional parameters:  file name to open (requires full path to file)
  Example:  001
                 d:\dbworx\examples\contax.dwh

005     [Display a message]
  Additional parameters:  the message to display
  Example:   005
                   File has been imported

120      [Sort dBworxPE file in ascending order]
  Addtional parameters:  column number(s) of fields to sort by
                                    (up to 3 fields separated by commas)
  Example:    120
                    2,1,5

130       [Sort dBworxPE file in descending order]
  Additional parameters:  (same as for 120 above)

150       [Filter the current file]  
  Addtional parameters:  filter text and column number of field
                                    to check for filter text
  Example:  150               [Gets all records containing the date
                  12/15/2003    12/15/2003 in column 3]
                  3
  Note: Currently, the filter command only checks for the contents
           of a field being equal to the filter text -- other options will 
           be added in the next version.

160       [Remove a filter]
  Additional parameters:  None

320       [Save data in working storage]
  Additional parameters: name of key field, name of value field
  Example:  320
                  Stock No.
                  Quantity In/Out

330       [Update records with working storage data]
  Additional parameters:  name of key field, name of update field
  Example:  330
                  Stock No.
                  Quantity on Hand

510       [Delete all records in the current file]
  Additional parameters:  None

800       [Save the current dBworxPE file]
  Addtional parameters:  None

810       [Save the current file with a different name]
  Addtional parameters:  file name of the new file
  Example:  810
                  c:\dbworx\myfiles\sales03.dwh

A sample macro file (macro1.dws) is included with this release.
You can view it using any text editor in order to see the coding --
to try it out, click on the "Macros/Scripts" menu and select "Run
macro".

CAUTION: 
 Mistakes in a new macro file can often cause unexpected 
 problems -- you should always back up your dBworxPE file 
 before running a macro for the first time.

Browser Based Help. Published by chm2web software.