| PDAT/Advanced Utility Library Version 1.21 for PDAT/Advanced |
Copyright (C) 2002-2006 Richard R. Sands dba Sands USA |
Table of Contents |
|
| 1. Library Overview | 5. Library Actions Reference |
| 2. Library Actions Overview | 6. Purchasing Information |
| 3. Plugging In the Library | 7. Support and Version History |
| 4. Distribution | 8. Warranty/License |
Library Actions Reference by Action Name |
|
| au.Alert | au.HotSyncID |
| au.Alert.Custom | au.PlayWave (ver. 1.16) |
| au.Alert.CustomEx (ver. 1.20 Pro Only) | au.Purge.ByDate |
| au.Beam | au.Purge.Selected |
| au.BeamMemo (ver. 1.13) | au.Required |
| au.Clip | au.Ren.DB (ver. 1.09) |
| au.DeleteDB (ver. 1.12) | au.Ren.Field (ver. 1.09) |
| au.Exists (ver. 1.11) | au.Run |
| au.ExistsEx (ver. 1.20 Pro Only) | au.SetDirty |
| au.Export.Doc | au.SetText |
| au.Export.Memo | au.SetTextRsrc (ver. 1.21) |
| au.FormAnchor (ver.1.12) | au.SoftKey |
| au.FormBack (ver.1.12) | au.Sort |
| au.FormReset (ver.1.12) | |
| Library Overview |
The PDAT/Advanced Utility Library (AU) is a shared library for PDA Toolbox applications. It provides a set of miscellaneous routines that may not require a separate library.
It is also used as a "Plug-In" to PDAT/Advanced to provide additional Actions to your PDA Toolbox programs.
This manual assumes the reader has familiarity with the PDAT/Advanced application.
The PDAT/Advanced Utility Library is a Freeware Library for the Palm OS™ 3.1 and up. It requires approx. 18k of hand-held memory.
| Library Actions Overview |
The Actions provided by this library are divided into several categories of functionality:
|
Alerts/Messages Actions
|
Sort/Export Actions |
|
Database Purge Actions |
Form Stack Actions
|
| Database Conversion Actions |
Miscellaneous Actions |
| Beaming Actions |
| Plugging In The Library |
For PDA Toolbox 6.0 Professional
For PDAT/Advanced Only
Before you can use the actions contained in this library, you must first "plug" it into PDAT/Advanced. Once plugged in and registered, you will be able to use and distribute this library freely.
After successful registration, when you are editing actions, you'll have a second button named "Lib" which pops up a list of all the commands available to you.
| Distribution |
The file "PDATAdvUtilsLib.prc" must be distributed with any application that uses this library. Since you are distributing multiple PRC files that must be installed on the hand-held device, you may want to check out Ecamm's NutShell for the Palm OS at http://www.ecamm.com/palm/nutshell. Nutshell is a unique installer solution, which allows users distribute multiple Palm files and data as a single self-expanding PRC file. With this tool, the user installs a single file onto their hand-held and the first time your app is run, all the libraries, databases, and sub-programs are automatically unpacked and your app runs. A very good solution to a sticky problem.
| Library Actions Reference |
Each Action in the library will be described here.
Many of the parameters in this lib are "smart" and perform more than meets the eye. The following table details the parameter types and the values they may have:
| Parameter Type |
Possible Values |
| text |
All of these items may be embedded in one string: "Zen Master Says \q[QUOT]\q" |
| number |
|
| date |
|
| TaltID |
|
| au.Alert text | ||
| Description: | Displays a generic alert with text. | |
| Parameters: | text: | Text. The text that will replace the "^1" embedded in the alert. |
| Example: |
au.Alert "The Product ID is [STOR].[PROD]" |
|
Shows an information alert. If a record is available you can use the [FLDX] syntax as in the Built-In Library (see Text above). You may pass "" if you do not require text to be inserted into the alert.
| au.Alert.Custom taltID, text au.Alert.CustomEx taltID, text (PDAT Pro 6.0 SP6 or higher) |
||
| Description: | Displays an alert embedded in your application (custom) with text. | |
| Parameters: | taltID: | The resource ID of the Talt resource embedded in your application. This must be an ID. |
| text: | Text. The text that will replace the "^1" embedded in the alert. | |
| Example: |
au.AlertCustom 1110, "Delete [NAME]?" |
|
Shows an information alert using an Alert Resource from your application. If
a record is available you can use the [FLDX] syntax as in the Built-In Library.
For au.Alert.Custom, this will handle one or two buttons. If the first button is tapped, then the
action continues with the script. If the second button is tapped, then the
script is aborted. When using au.Alert.CustomEx, when it returns,
it will branch to the nth line after the au.Alert.CustomEX: The first
button tapped goes to the following line, the second button tapped goes to the 2nd
line following, the third goes to the third line, etc. The following
example displays a custom alert with three buttons:
Action btnTest |
To properly create the alert so that it accepts the text passed to it, you must
include in the text the placeholder "^1" as in "Do you want to ^1" where the ^1
is replaced with the text in the au.AlertCustom action.
You may pass "" if you do not require text to be inserted into the alert.
| au.Beam filename, description | ||
| Description: | Beams a database to another device through the IR port. | |
| Parameters: | filename: | This should be the name of the database. |
| description: | This is text describing the file you are beaming. | |
| Example: |
au.Beam "MyApp Data", "This is the
database" |
|
Beams an application or a database to another device. You must specify the database without the ".prc" or ".pdb" as they do not actually exist on the device. Embedded text codes in both the filename and description are allowed and if a record is available you can use the [FLDX] syntax.
| au.BeamMemo Memo, description | ||
| Description: | Beams a database record directly to another devices MemoPad via the IR port. | |
| Parameters: | Memo: | Any string data |
| description: | This is text describing the record you are beaming. | |
| Example: |
au.BeamMemo "A Record\nLast: [LNAM]\nFirst: [FNAM]", "Sample Name" |
|
This action beams the contents of a record formatted for MemoPad via the IR port. This is useful if you want to be able to send data without sending the application or doing a multi-step Export to MemoPad, switch to MemoPad and beam. You can send the record using the string formatting typically used in this library. E.g. "Name: [NAME]" where [NAME] is a field from the record.
| au.Clip text | ||
| Description: | Copies text to the clipboard | |
| Parameters: | text: | Text. The text that will go into the clipboard. |
| Example: |
au.Clip "[FNAM] [LNAM]" |
|
Copies text to the clipboard. If the clipboard current has something, it is replaced with the text.
| au.DeleteDB filename1[, filename...] | ||
| Description: | Deletes all databases in the list without confirmation. | |
| Parameters: | Filename...: | One or more filenames of the files you want to delete. |
| Example: |
au.DeleteDB myfile1, myfile2, "\a DATA" |
|
Deletes all databases in the list without confirmation. Embedded text codes in the filename are allowed and if a record is available you can use the [FLDX] syntax. No error is returned by this action so execution continues at the next statement.
| au.Exists
filename1[, filename...], TaltID, Quit|Continue au.ExistsEx filename1[, filename...] (PDAT Pro 6.0 SP6 or higher) |
||
| Description: | Verifies that the listed files exist on the handheld and (optionally) displays a message and/or quits the app if not. | |
| Parameters: | Filename...: | One or more filenames of the files you want to verify. |
| TaltID: | ID or command for type of status display. (See Talt parameter above). | |
| Example: |
au.Exists MyRezFile, MyRezFile0S35, default, Quit |
|
For au.Exists, this action verifies that the listed files exist on the handheld and (optionally) displays a message if not. In addition, you can tell it you want it to QUIT or CONTINUE after a file has been determined to be missing. The app will terminate if you choose QUIT. Regardless of what the Quit/Continue state is, if there are missing files, the script lines following are not executed.
Custom Alerts (Talt) must have a message with one parameter in it:
^1 - The name of the field that failed validation.
E.g. "^1 is required but missing."
For au.ExistsEx, this action will perform the same duties as au.Exists, however, it supports branching rather than the Talt/Quit type parameters. If all the files exists, then it goes to the next action. If any of the files do not exist, then it skips the next action and proceeds to the second following the au.ExistsEx action:
Action btnTest |
| au.FormAnchor au.FormBack au.FormReset |
|
| Description: | These actions support a form "stack," which allows you to easily create common forms that are called from different forms in your application. |
| Example: |
au.FormReset (form startup script) au.FormAnchor
(form anchors and goes to another form) au.FormBack (form returns to
"calling" form) |
These actions support a form "stack," which allows you to easily create common forms that are called from different forms in your application. The au.FormReset action clears the current form stack to no entries. I recommend that this action go into your startup script. It can also be used to clear the stack and jump to a know location.
The au.FormAnchor and au.FormBack actions work together and allow you to "save" the current form and call one or more other forms, and then navigate back through the path the user followed. To save the current form "location", you invoke the au.FormAnchor action and then either $GotoForm or $GotoFormNew to the target form. The form that you went to can call au.FormAnchor again and go to another form, or it can call au.FormBack to return.
The stack is set to 8 forms. If you go over that, additional entries will be silently ignored. If you try to au.FormBack more times than you have called au.FormAnchor, then the action will be ignored and the script will exit.
In the case where an alarm triggers a form to be open directly instead of being opened through the normal sequence, the form stack may be empty and a au.FormBack would just sit there and "flash" at you (do nothing). To gracefully handle this, if you have a form with alarm fields on it, you should supply a "default form id" that will direct the user to the best page. This would look something like: "au.FormBack 1100" where form 1100 is used instead of the "form stack" IF the form stack is empty.
NOTE: You don't want to have a au.FormAnchor and then jump to the same form. This will fill the stack and the au.FormReset will have to be called.
See the "FormRtn" sample available at www.SandsUSA.com/PDATAdv to look at the code "behind" the buttons.
| au.PlayWave waveID | ||
| Description: | Plays a wave file from a resoure | |
| Parameters: | waveID: | Resource ID of a 'wave' resource |
| Example: |
au.PlayWave 1000 |
|
Plays a 'wave' resource within your application. This is useful for short sound-bites. Maximum wave file that can be use is 64k in size but this would be a stretch.
Currently, only WAVE data is recognized; in this case, the wave resource must start with the “RIFF” ID (byte 0 in a simple .wav file).
Supported WAVE Format
Uncompressed (PCM) or IMA 4-bit adaptive differential (IMA ADPCM). The ADPCM type is also known as DVI ADPCM; in a WAVE file, it’s known as format 0x11.
One or two-channels
All normal sampling rates (8k, 11k, 22.05k, 44.1k, 48, 96k).
You can’t interrupt or abort a resource playback once it’s been initiated. The resource always play to the end of the data.
Creating a Wave File.
With PDA Toolbox 6.0, you can merely rename a wave file (*.wav) to a filename that consists of the word "wave" followed by a four digit hex value representing the ID with a file type (extension) of ".bin". If this file is placed into your codeset\bin folder, then it will be included into your application when it's compiled. For example, a "testing.wav" could be merged into a 'wave' resource of 1000 by renaming it to "wave03e8.bin" where the 03e8 is hex for 1000 decimal. Your script would then play it by au.PlayWave 1000.
This is only available on devices that have the "Sound Stream Feature Set" present. Basically, this means OS 5.0 devices.
| au.Run progname | ||
| Description: | Launches and runs an external application. | |
| Parameters: | progname: | Application name as a string literal. |
| Example: |
au.Run "Address Book" |
|
Transfers execution to another application (ie. runs a program and returns to the launcher). Don't look for a au.CALL command as it won't work with PDAT/Advanced Libraries. This is the only command that will be available.
If the program you want to run has spaces, you must include double-quotes around the name.
NOTE: It is best to test this command outside of the PDAT/Advanced environment.
| au.Sort CID, TID, TaltID, [FLD, TYPE]... | ||
| Description: | Sorts a specified database on up to four sort keys. | |
| Parameters: | CID: | The Creator ID of the database to sort. (e.g. "ABCD") |
| TID: | The Type ID of the database to sort (e.g. DATA) | |
| TaltID: | ID or command for type of status display. (See Talt parameter above). | |
| FLD1: | Field to Sort | |
| TYPE1: | Direction/Type to Sort | |
| [FLD2]: | Field to Sort, optional - does not need to be included | |
| [TYPE2]: | Direction/Type to Sort, optional - does not need to be included unless Fld2 is included. | |
| [FLD3]: | Field to Sort, optional - does not need to be included | |
| [TYPE3]: | Direction/Type to Sort, optional - does not need to be included unless Fld3 is included. | |
| [FLD4]: | Field to Sort, optional - does not need to be included | |
| [TYPE4]: | Direction/Type to Sort, optional - does not need to be included unless Fld4 is included. | |
| Example: |
au.Sort CRID, DATA, "default", "NAME", "A", "AGEX", "9", "BDAY", "0" (Sorts database (CRID/DATA) on Name (A-Z), Age (9-0), and Birthday (0-9)) |
|
This command sorts the database by the keys specified. Up to four key pairs are allowed. Each pair must consist of a Field ID and a Sort Direction.
The sort directions are defined as follows:
| "A" |
Sort text "A-Z" as in ascending order. |
| "Z" |
Sort text "Z-A" as in descending order. |
| "0" |
Sort numbers, dates, and checkboxes in "0-9" as in ascending order. |
| "9" |
Sort numbers, dates, and checkboxes in "9-0" as in descending order. |
| "C" | Sort checkboxes in "checked-unchecked" order |
| "U" | Sort checkboxes in "unchecked-checked" order |
| "R" or "S" | Shuffle sort. This will randomly sort the database. |
Custom Alerts (Talt) must have a message with two parameters in it:
^1 - Filename of the database being sorted
^2 - Status
E.g. "The ^1 sort ^2."
| au.Export.Memo
CID, TID, cr, He, Talt, Fld... au.Export.Doc CID, TID, cr, He, Talt, Fld... |
||
| Description: | Exports an entire database to the built-in application Memo Pad or the industry standard "DOC" format. | |
| Parameters: | CID: | The Creator ID of the database to export. (e.g. "ABCD") |
| TID: | The Type ID of the database to export (e.g. DATA) | |
| cr: | Carriage Return character. May be a number (e.g. 10) or a character (e.g. "~") | |
| He: | A Y or N value to include headers. | |
| TaltID: | ID or command for type of status display. (See Talt parameter above). | |
| Fld: | Field list to sort. | |
| Example: |
au.Export.memo TEST, DATA, 10, Y, "quiet", NAME, AGEX, ADDR, NOTE |
|
Exports specific fields to the Memo Pad or DOC reader application. For memos, if your database size is larger than 4k (4096) characters, then the export function will slop over into multiple memos. Multiple memos are created at the first record, then the second record, third, etc. There is no title or other indication that the memo has continued into the next memo record. For DOC format, the filename will automatically be created by prepending "doc_" to the name of the database. You may not export multiple tables at this time.
NOTE: If the Memo Pad application has never been used, the first export may fail. Following exports will be successful.
The Memo Pad export is memory intensive in order to support creating multiple memos when exporting a lot of data. The export is always broken into a new memo on an even record boundary. So when the action starts, it attempts to allocate an internal memory buffer of 4096 characters to hold a single record. If this fails, it tries 2048 characters, then 1024, then 512 characters to hold a single record. If it cannot create a buffer of at least 512 characters then the action fails with an error message.
Custom Alerts (Talt) must have a message with two parameters in it:
^1 - Filename of the database being sorted
^2 - Status
E.g. "The ^1 exported ^2."
These export routines will ignore all "deleted" or "archived" records.
| au.Purge.ByDate CID, TID, FieldID, Days, TaltID | ||
| Description: | Deletes (purges) all records that are OLDER than (Today-Days). | |
| Parameters: | CID: | The Creator ID of the database to purge. (e.g. "ABCD") |
| TID: | The Type ID of the database to purge (e.g. DATA) | |
| FieldID: | DATE field in the record to check against. | |
| Days: | Number of days to age the file (0=Today, 1=Yesterday, 7=A week, etc) | |
| TaltID: | ID or command for type of status display. (See Talt parameter above). | |
| Example: |
au.Purge.ByDate Test, Data, "DATE", 14, "default" (purge all records older than 14 days and show the default message) |
|
Deletes (purges) all records that are OLDER than (Today-Days). The Days parameter must be a literal value (e.g. 7 or 30) and may not be a field id.
Custom Alerts (Talt) must have a message with two parameters in it:
^1 - Number of records removed or the word "No"
^2 - Database name
E.g. "^1 record(s) removed from ^2."
| au.Purge.Selected CID, TID, FieldID, TaltID | ||
| Description: | Deletes (purges) all records that are selected. | |
| Parameters: | CID: | The Creator ID of the database to purge. (e.g. "ABCD") |
| TID: | The Type ID of the database to purge (e.g. DATA) | |
| FieldID: | CHECKBOX field in the record to check against. | |
| TaltID: | ID or command for type of status display. (See Talt parameter above). | |
| Example: |
au.Purge.Selected Test, Data, "MARK", 1110 (purge all records that have the MARK field checked and show a custom alert) |
|
Deletes (purges) all records that are selected. Selection is done by having a field in your database that is a type Checkbox that has a checked value.
Custom Alerts (Talt) must have a message with two parameters in it:
^1 - Number of records removed or the word "No"
^2 - Database name
E.g. "^1 record(s) removed from ^2."
| au.Ren.DB CID, TID, newCID, newTID, newFilename | ||
| Description: | Renames a database | |
| Parameters: | CID: | The Creator ID of the database to rename. (e.g. "ABCD") |
| TID: | The Type ID of the database to rename (e.g. DATA) | |
| newCID: | The new Creator ID (or the same if you don't want to change it) | |
| newTID: | The new Type ID (or the same if you don't want to change it) | |
| newFilename: | The new Filename (or the same if you don't want to change it) | |
| Example: |
au.RenDB "TDBX", "DATA", "TdbX", "Data", "My Database" |
|
This will change the Creator ID, Type ID, or Filename of the database specified with CID/TID. This action is primarily intended for converting an old database to a new format (ie. an upgrade utility). Embedded text codes in the filename are allowed and if a record is available you can use the [FLDX] syntax.
No error is returned by this action as you may want to change several. Use another method to determine if the database(s) has been successfully processed.
| au.Ren.Field CID, TID, oldField, newField, ... | ||
| Description: | Renames one or more fields to a new field ID | |
| Parameters: | CID: | The Creator ID of the database to process. (e.g. "ABCD") |
| TID: | The Type ID of the database to process (e.g. DATA) | |
| oldField: | The field ID you want to rename (4 characters) | |
| newField: | The new field ID you want to rename oldField as. | |
| Example: |
au.Ren.Field "TDBX", "DATA",
"TEXT", "Text" |
|
This will rename one or more field IDs. Always include pairs of (oldField, newField). This action is primarily intended for converting an old database to a new format (ie. an upgrade utility).
No error is returned by this action as you may want to call this several times.
| au.SetDirty CID, TID, ... | ||
| Description: | Marks one or more databases as being "dirty." | |
| Parameters: | CID: | The Creator ID of the database to make dirty. (e.g. "ABCD") |
| TID: | The Type ID of the database to make dirty (e.g. DATA) | |
| Example: |
au.SetDirty "TDBX", "DATA" |
|
This action takes a list of CreatorIDs and TypeIDs and attempts to mark databases as "dirty" so they will be backed up. Normally this is not needed, but if you have a situation of multiple desktop applications, it may be desirable to do this.
This command opens up each database if possible, reads a record, and marks the record as having been edited.
| au.SetText fldID,
Text au.SetTextRsrc fldID, strID |
||
| Description: | This will assign a text field the contents of Text or from a string resource | |
| Parameters: | fldID: | Text. The field to be assigned (e.g. NAME) |
| Text: | Text. Template to assign. | |
| strID: | (SetTextRsrc) Numeric. ID of the str resource to read and assign to the field ID. | |
| Example: |
au.SetText FULL, "[LNAM], [FNAM]" (assign first and last name to the FULL field) |
|
SetText will assign a text field the contents of Text. Text may be in the same form as the Alerts (e.g. "[LNAM], [FNAM]" is valid. This, in effect, can perform field concatenation.
Like SetText, SetTextRsrc will assign text to a field. However, the text to be assigned is read from the application's resources - specifically a tSTR (string) resource specified by the strID value. After the text is read, it is processed identically to SetText, that is, any field references are expanded from the current record (e.g. "[LNAM], [FNAM]").| au.Required Talt, [fld, name]... | ||
| Description: | Validates required fields. | |
| Parameters: | TaltID: | ID or command for type of status display. (See Talt parameter above). |
| fld: | The field ID to verify that it has a value (e.g. "NAME") | |
| name: | The name of the field to display to the user if there is an error. (e.g. "Full Name") | |
| Example: |
au.Required 1100, LNAM, "Last Name", FNAM, "First Name", BDAY, "Birthday" |
|
This will validate required fields. The first field that does not exist, or if text, is empty, will display the talt and quit executing the current actions. Validation continues through the list of fld/name pairs until one fails or they all pass.
If the current record does not exist or is empty or the field is missing or blank, then the field is considered to be missing and the alert will display.
Custom Alerts (Talt) must have a message with one parameter in it:
^1 - The name of the field that failed validation.
E.g. "^1 is required."
| au.HotSyncID fld | ||
| Description: | Assigns the HotSyncID to a fld | |
| Parameters: | fld: | Field ID of the field to assign the HotSyncID |
| Example: |
au.HotSyncID HSID |
|
Assigns the HotSyncID to a fld. This is useful if you have an application where records are beamed or merged with other databases and you want to keep tracked of where the original record came from.
| au.SoftKey value | ||
| Description: | Sends a soft or hard key value to the system. | |
| Parameters: | value: | A string or number as noted below. |
| Example: |
au.SoftKey find |
|
Sends a soft or hard key value to the system based on a numeric value. Most of the common keys are the same across devices and OS's, but some of the special buttons found on different devices may be unique (e.g. Sony Jog Buttons).
The value parameter above may be one of these values:
| home | Quit the app and return to the launcher's home. |
| menu | Invoke the current form's menu. This will popup the menu and allow the user to tap an item or dismiss it. |
| calc | Invoke the calculator. This is the same as au.Run "Calculator" |
| find | Invoke the find dialog. |
| clock | Invoke the clock for the slight delay it's set for. |
| nnn | A numeric value as display by the SeeKey program. For example, 5634 displays the contrast dialog on the Visor (probably IIIc, too). A value of 12 is the hard down button. |
| Purchasing Information and Support |
This library is freeware. As freeware, I may not always be able to support this product in timely manner. Your best bet for support is at the PDAT Nuts & Bolts user forum. However, you can always contact me at:
email: Rick@SandsUSA.com or at my site http://www.SandsUSA.com.
| Warranty and User License Agreement |
"The Software" is "PDAT/Advanced Utility Library" aka "PDATAdvUtilsLib.prc" by Richard R. Sands dba Sands USA.
DISCLAIMER #1 - MUST READ
This product is an "After-Market" utility for PDA Toolbox(tm) and as such, is subject to obsolescence by changes in PDA Toolbox or the Palm OS(tm) itself. This cannot be prevented. I may choose to stop or limit development and support of this product if such situation occurs.
USER LICENSE AGREEMENT
This Agreement sets forth your licensed rights to use "The Software" and is
granted to you upon condition that you accept the terms of this license. Your electronic
indication of agreement, or your use of the program constitute acceptance of all of the
terms of this license.
The program copy and documentation are furnished to make "The Software"
available for your use and remain the property of Sands USA.
IF YOU DO NOT AGREE WITH ANY PART OF THIS LICENSE, DO NOT USE THIS SOFTWARE. Delete
"The Software" and all associated files from all media on which it has been
copied.
LICENSE TERMS AND CONDITIONS
THE LICENSED PRODUCT
"The Software" comprises copyrighted computer programs and utilities for
enhancing the applications created with PDA Toolbox(tm) Application Generator.
This is a Freeware product, however, use of this product implicitly becomes a
"licensed product" and is in it's entirety protected by US and foreign
copyright.
YOUR USE OF THE LICENSED PRODUCT
General Use. You have the right to use "The Software" with PDAT/Advanced
and to distribute the library file "PDATAdvUtilsLib.prc".
LIMITATIONS ON USE
General Use Limitations. You have no right to reproduce, transfer, publish or otherwise distribute either
the "The Software" software, or any components or documentation provided.
ALL RIGHTS NOT SPECIFICALLY GRANTED BY THIS LICENSE ARE RESERVED BY SANDS USA.
WARRANTIES, WARNING, DISCLAIMER
Warning and Disclaimer of All Warranties. THE PROGRAM IS FURNISHED "AS IS"
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, IN ALL JURISDICTIONS WHERE ALL
WARRANTIES MAY BE DISCLAIMED IN THE LICENSING OF INTELLECTUAL PROPERTY.