Private Eye Library
Version 1.19 for PDAT/Advanced and Professional

Copyright (C) 2002-2006 Richard R. Sands dba Sands USA
All Rights Reserved

Table of Contents

1. Library Overview 5. Library Actions Reference
2. Library Actions Overview 6. Purchasing Information
3. Plugging In the Library 7. Support
4. Distribution 8. Warranty/License

Library Actions Reference by Action Name

pe.AskHardPswd pe.HardRegInit
pe.AskHardPswdEx (ver. 1.14 Pro) pe.HasPassword  (ver. 1.18)
pe.AskPswd pe.IsReg
pe.AskPswdEx (ver. 1.14 Pro) pe.IsScreen
pe.BeamProtected pe.MinOS
pe.ChangePIN (ver.1.07) pe.RegDialog
pe.ChangePswd pe.RegInit
pe.DayLimit pe.RunLimit
pe.DBLimit pe.ShellRegDialog
pe.Decrypt (ver.1.05) pe.ShellRegInit 
pe.DecryptEx (ver.1.15 Pro) pe.StartForm (ver. 1.04)
pe.Dyn16RegDialog  (ver. 1.11) pe.TestReg (ver. 1.04)
pe.Dyn16RegInit (ver.1.11)  pe.TestRegEx (ver. 1.15 Pro)
pe.Encrypt (ver.1.05) pe.TestNotReg (ver. 1.04)
pe.EncryptEx (ver.1.15 Pro) pe.UserPswd 
pe.HardRegDialog

Library Overview

The Private Eye Library (PE) is a share library for PDA Toolbox applications.  It provides security, encryption, and registration related functionality.  The Private Eye library is compatible with both PDAT/Advanced and PDA Toolbox 6.0 Professional.

Many of the actions of the Private Eye Library are based on the idea that buttons or menus in your application have multiple actions defined.  Usually, if an PE action fails, then the actions following the PE are ignored.  For instance, if you wanted to password protect a form, you might have the actions for the button defined as 

pe.AskHardPswd "123",PIN
GotoForm 1500

In this case, if the PIN is not entered, then the action fails and the $GotoForm will not take place.  If successful, then the user goes to form 1500.

Registration actions consist of three pieces: An initialization, registration dialog, a test actions.  For PDA Toolbox versions prior to 5.x there is no "Startup" actions in PDA Toolbox, it's recommended that you have some kind of "splash" screen that handles your registration initialization to force the user to perform it.  For instance, the [OK] or [Start] buttons on a splash screen would actually have something similar to:

pe.HardRegInit "BlueBell"
GotoForm 1100

This way, when the user taps the OK button, the above code is executed and the user proceeds to the "first" actual form.

For versions of PDA Toolbox 5.x and higher, the INIT actions are recommended to be placed in the Startup Script.

It is also used as a "Plug-In" to PDAT/Advanced to provide additional Actions to your PDA Toolbox programs.  PDAT 6.0 Pro requires the Windows "Plug-In" to support the Script Editor.

This manual assumes the reader has familiarity with the PDAT/Advanced application or the PDAT 6.0 Pro Script Editor.

The Private Eye Library is a Shareware Library for the Palm OS 3.1 and above.  This library requires approx. 23k of memory storage.  For more information click here.

Library Actions Overview

The Actions provided by this library are divided into four categories of functionality: Password Protection, Shareware Registration Models, Registration Test Methods, and Other Security Routines.

Password Protection

With these actions, you can create password protected applications.  You can protect the application, entry to a specific form, or a specific function.  As the developer, you can allow the user to change the password or have a "hard-wired" password set by you.  Passwords can be alpha-numeric and entered with a dialog or can be set as a PIN-Keypad style password.

Shareware Registration Models

There are four Shareware registration models included with this library.  There is a "Classic" ShellReg-compatible model is used for upgrades from a ShellMaker application.  ShellReg is used to generate the keys as normal.  You can also have "hard-wired" model.  This is used to have a single registration key sent to the user.  This key can be issued to the Seller to be issued to the User when a purchase is made.  With the hard-wired model, administration is easy, but security is rather low.  There is a general purpose registration method where the registration keys can be generated on the Windows Desktop.  There are several variations of this model which allow for unique registration keys to be generated.   Finally, another general purpose method has been added to support dynamic generation of keys at PalmGear, Handango, eSellerate, and other online stores.  This method uses the process defined at Handango on the developer's pages.  An annotated copy of the document is included called PEDyn16RegInfo.pdf which helps explain the details of how to use it.

All the registration models, when a success registration is entered, will automatically turn off PDA Toolbox's 30-Demo Mode.  This allows you to optionally send out apps with the 30 day demo, but not have to send "Non-Demo" apps upon registration -- a real time saver!

Registration Test Methods

All the shareware registration methods are able to be tested with these actions.  Each of these test methods tests if the user has registered the app.  If so, then the actions following the test are executed as normal.  If not, then the actions following the test may be ignored.  You can show a "nag" alert and continue execution or you can show the "nag" and stop.  there are three tests available: Test for registration, test if a certain number of database records has been reached, and test if a certain number of runs has been reached.

Other Security Routines

With these actions, you can test a variety of additional situations:  Test if your application has been un-beam protected by the user, tests if your app is running on a minimum OS platform, and tests if the user's device is color or black&white.  If any of these fail, then a message is displayed and the following actions may be ignored.

Database Encryption

These actions will encrypt or decrypt the entire database.  Encryption is lightweight, however it is based on a 512 bit key generated randomly every time a database is encrypted.  Data integrity is maintained so if an app crashes while databases are unencrypted, when the application starts, it will not attempted to decode data that is already decoded.  Likewise, it will not try to encode data that is already encoded.
This encryption is somewhat stronger than the normal and must be used in combination with a user password action.  As the encryption is tied to the user's password, some of the vulnerabilities of the regular encryption actions are avoided.  This is only available with PDA Toolbox Professional.
Plugging In The Library

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.

  1. First, install the "PDATPELib.prc" file onto your development handheld.  This should also have a copy of PDAT/Advanced.
  2. At PDAT/Advanced's Open Screen, tap the menu and choose from the Advanced menu "Manage Libraries".
  3. Next, if the "Private Eye Library" is not shown in the list, tap the "Add" button.
  4. In the "Add Library" dialog, enter in the Library ID of "PEye" (without the quotes).
  5. Next, enter the license information you received when you registered.
  6. Lastly, tap the "Done" button.

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.

Using With PDA Toolbox 6.0 Pro Script Editor

To use this library with the Pro Script Editor, you need to download the PDA Toolbox Windows Plug-In for Private Eye.  This is available at www.SandsUSA.com/PDAT.  Follow the installation instructions contained within the archive.

The primary difference between using these actions with PDAT/Advanced and the Pro Script Editor is that the Script Editor does not require the leading "$" for each action.  In addition, in PDAT/Advanced, you can can wrap your action statements with carriage-returns and in the Script Editor, you must use the "_" line continuation character.

Distribution

The file "PDATPELib.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.


pe.AskHardPswd pswd, PIN|Alpha
pe.AskHardPswdEx pswd, PIN|Alpha [, Eq|Not [,Msg|NoMsg [, AppTitle|Default]]]
Description: Provides "hard-wired" password protection of the application, entry to forms, or functionality.  You provide a password and all users of your app will have to enter that password into the dialogs in order to access that functionality.  The AskHardPswdEx is not supported by PDAT/Advanced.
Parameters: pswd: The password you want everyone to use in double quotes (e.g. "test" or "54321").
  PIN|Alpha: Determines if your password should be entered as a alpha-numeric value by a text field dialog or a PIN-Keypad Style dialog.
  EQ|NOT: If EQ (the default if omitted), then this action will abort the script if the password fails.  If NOT, then the script is stopped if the password succeeds!
  Msg|NoMsg: If Msg (the default if omitted), then when a password fails, it will notify the user.  If NoMsg, then it will not notify the user.
  Default|AppTitle: A value of default will use the current "Enter PIN" type prompt.  A value of "AppTitle" will use your application Title on the password dialog.
Example: 

pe.AskHardPswd "BlueBell", Alpha   (results in a system password of "BlueBell" entered with a text field)
pe.AskHardPswd "54321", PIN     (results in a system password of "54321" entered with a PIN keypad)

To use, insert this action before the feature you want to protect.  If the password fails or is canceled, the actions following the password action will not be executed.  If the password is correct, then the following actions will take place.  The protected actions will always have to have a password entered before the actions will execute.

Hard-wired passwords appear the same as a user-password that can't be changed.  However, a hard-wired password can be changed with each compilation of your application and the value stored in your app will be used each time.  With a user-password, once the initial password is given, it is up to the user to maintain it - even if you re-issue your application. 

Alpha-numeric passwords are limited to 20 characters and PINs are limited to 12.  All passwords are case-sensitive.

Alpha-Numeric Password Dialog

Any kind of password may be used since passwords are entered by Grafitti.

Examples: "Test", "test", "123test", and "5000".

PIN-Keypad Style Password Dialog

Only numbers, dash, and a dot may be used as PINs.  Note, the user can also Grafitti in the PIN at the top of the dialog. Corrections can also be done there.  As the user taps buttons, the PIN appears at the top of the dialog.

Examples: "123", "123.54.1232", "123-45-678"

PDA Toolbox 6.0 Professional SP5 and higher supports a wakeup event that is executed whenever your application is running and the device is turned on.  You can use the password actions to prevent unauthorized access.

Example of Wakeup Protection (PDAT 6.0 Script):

Action eventWakeup
pe.AskHardPswdEx "123", PIN, NOT, NOMSG
ExitApp
EndAction

The NOT tells the action to stop processing the script if the password succeeds.  This way, if it fails, the ExitApp action occurs.  The NOMSG parameter suppresses the failed password message since there may be sensitive info on the screen.


pe.AskPswd pswd, PIN|Alpha
pe.AskPswdEx pswd, PIN|Alpha, [Un]Checked  [, Eq|Not [,Msg|NoMsg [, AppTitle|Default]]] 
Description: Provides "user" password protection of the application, entry to forms, or functionality.  You provide an initial password, or "", for the user to start with.  They may then change the password at will.  The AskHardPswdEx is not supported by PDAT/Advanced.
Parameters: pswd: The initial password you want everyone to start with in double quotes (e.g. "test" or "54321", or "").
  PIN|Alpha: Determines if your password should be entered as a alpha-numeric value by a text field dialog or a PIN-Keypad Style dialog.
  [Un]Checked: The word "Checked" sets the "Don't ask for a password" checkbox in the Change Password dialog.  Use "Checked" if you want to suppress any password prompt from showing initially.  Use "Unchecked" if you want the password to prompt even if it's blank.
  EQ|NOT: If EQ (the default if omitted), then this action will abort the script if the password fails.  If NOT, then the script is stopped if the password succeeds!
  Msg|NoMsg: If Msg (the default if omitted), then when a password fails, it will notify the user.  If NoMsg, then it will not notify the user.
  Default|AppTitle: A value of default will use the current "Enter PIN" type prompt.  A value of "AppTitle" will use your application Title on the password dialog.
Example: 

pe.AskPswd "BlueBell", Alpha, Unchecked      (results in the initial password of "BlueBell" entered with a text field)
pe.AskPswd "", PIN, Unchecked     (results in no initial password entered with a PIN keypad but still prompts)
pe.AskPswd "", PIN, Checked     (results in no initial password entered with a PIN keypad and skips prompting for it)

To use, insert this action before the feature you want to protect.  If the password fails or is canceled, the actions following the password action will not be executed.  If the password is correct, then the following actions will take place.  The protected actions will always have to have a password entered before the actions will execute.

Passwords set with this action can be changed by the user with the pe.ChangePswd action.  Passwords cannot be recovered - the user must delete the application and re-enter the password, so make sure you emphasize the need for them to remember it.

Alpha-numeric passwords are limited to 20 characters and PINs are limited to 12.  All passwords are case-sensitive.

Alpha-Numeric Password Dialog

Any kind of password may be used since passwords are entered by Grafitti.

Examples: "Test", "test", "123test", and "5000".

PIN-Keypad Style Password Dialog

Only numbers, dash, and a dot may be used as PINs.  Note, the user can also Grafitti in the PIN at the top of the dialog. Corrections can also be done there.  As the user taps buttons, the PIN appears at the top of the dialog.

Examples: "123", "123.54.1232", "123-45-678"

PDA Toolbox 6.0 Professional SP5 and higher supports a wakeup event that is executed whenever your application is running and the device is turned on.  You can use the password actions to prevent unauthorized access.

Example of Wakeup Protection (PDAT 6.0 Script):

Action eventWakeup
pe.AskPswdEx "123", PIN, checked, NOT, NOMSG, APPTITLE
ExitApp
EndAction

The NOT tells the action to stop processing the script if the password succeeds.  This way, if it fails, the ExitApp action occurs.  The NOMSG parameter suppresses the failed password message since there may be sensitive info on the screen.  The APPTITLE parameter forces the password dialog to display the app name.


pe.BeamProtected
Description: This action will test if your application has been un-beam protected by the user.  If so, then the actions following the test are ignored.
Example: 

pe.BeamProtected

A pretty easy action, this should be on a splash screen or upon entry to an important segment of your application.


pe.ChangePswd
pe.ChangePIN
Description: Used to change the password a user uses with pe.AskPswd
Example: 

pe.ChangePswd

It is recommended that you change normal passwords using the pe.ChangePswd action, and change PINs using the pe.ChangePIN.  Although both will change passwords for the other, the .ChangePIN prevents a user from entering letters and locking themselves out of their application.

Alpha-numeric passwords are limited to 20 characters and PINs are limited to 10.  All passwords are case-sensitive.

Change Password and PIN Dialog

The user must know their existing password before it will change the password to the new password.

The user may also choose to turn off password prompting entirely by checking the "Don't ask for a password" checkbox.


pe.DayLimit days, Talt, Stop, Always
Description: If the application is unregistered, this action will limit times the application can be run.
Parameters: days: The number of days you want the user limited to while the application is unregistered.  Typical values are 30, 14, and 7.
  Talt: This is the ID a special alert that you need to create in your application to display the number of runs the user has made and the maximum allowed.  This parameter is used by the Stop and Always parameters.
  Stop: The word "Stop" will make this action ignore the actions following it when the user hits their limit.  In effect, after the user's allowable limit, you won't allow them to create a new record until registered.  If you want to just nag them, you can set this value to "Continue" or "Cont".
  Alway: The word "Always" will make this action always display the Talt specified.  If set to "Limit", then the Talt won't be displayed until the user creates their allowable record count.
Example: 

pe.DayLimit 15, 1000, Stop, Always     (the limit is 15 days where it will stop actions and will always show the nag while unregistered)
pe.DayLimit 30, 1010, Cont, Limit     (the limit is 30 days  where it will stop actions and only show the nag when the limit is reached)

This is a good replacement for PDA Toolbox's built-in "30 Day Demo Mode."  The primary advantage is that when the number of days is reached, the user still has the opportunity to enter a registration code.  With the standard demo mode, you have to send out a new, "release" PRC in order for them to continue.

The message text of the Talt may have two parameters filled in for you to indicate the remaining and total.  This should be similar to "You have ^1 days remaining of ^2."  The ^1 will be filled in with the "remaining days" value, and the ^2 is filled in from the "total days allowed" value.

The Talt that you are required to make can be added to your application's PFA file on the handheld.  When PDAT/Advanced compiles an application, it copies all of the non-pSTR resources into your application.   


pe.DBLimit CRID, Type, recs, Talt, Stop, Always
Description: If the application is unregistered, this action will limit the number of records a user can create in a specific database. 
Parameters: CRID: The Creator ID of the database you want to limit.  The creator ID is generally the same creator ID of your application.  You can double-check this value by using Quartus RsrcEdit utility to examine the database header. 
  Type: The Type ID of the database you want to limit.  The type ID is defaults to "DATA" but is frequently changed by the developer. You can double-check this value by using Quartus RsrcEdit utility to examine the database header.
  recs: The maximum number of records you want to allow the user to create while the application is unregistered.
  Talt: This is the ID a special alert that you need to create in your application to display the number of records created and the maximum allowed.  This parameter is used by the Stop and Always parameters.
  Stop: The word "Stop" will make this action ignore the actions following it when the user hits their limit.  In effect, after the user's allowable limit, you won't allow them to create a new record until registered.  If you want to just nag them, you can set this value to "Continue" or "Cont".
  Alway: The word "Always" will make this action always display the Talt specified.  If set to "Limit", then the Talt won't be displayed until the user creates their allowable record count.
Example: 

pe.DBLimit "ABCD", "DATA", 10, 1000, Stop, Limit   (the limit is 10 recs where it will stop actions and only show the nag when the limit is reached)
pe.DBLimit "ABCD", "DATA", 20, 1000, Cont, Always   (the limit is 20 recs where it will continue actions when it hits the limit, and always show the nag)

Intended to be on an application's primary database, this action will test if the record count is greater than what the developer specifies.  When the user registers, they may then continue to add records to the database.  This can be a good technique to give full functionality but limit the capacity until registered.

The message text of the Talt may have two parameters filled in for you to indicate the remaining and total.  This should be similar to "You have ^1 records remaining out of ^2 records available."  The ^1 will be filled in with the "remaining records" value, and the ^2 is filled in from the "total records allowed" value.

The Talt that you are required to make can be added to your application's PFA file on the handheld.  When PDAT/Advanced compiles an application, it copies all of the non-pSTR resources into your application.


pe.Decrypt CRID, TypeID
pe.Encrypt CRID, TypeID
Description: Encypts or unencrypts (decrypts) an entire database.
Parameters: CRID: The Creator ID of the database you want to En(de)crypt.
  Type: The Type ID of the database you want to En(de)crypt.
Example: 

pe.Encrypt ABCD, DATA
pe.Encrypt ABCD, CATA

These actions will encrypt or decrypt the entire database.  Encryption is lightweight, however it is based on a 512 bit key generated randomly every time a database is encrypted.  Data integrity is maintained so if an app crashes while databases are unencrypted, when the application starts, it will not attempted to decode data that is already decoded.  Likewise, it will not try to encode data that is already encoded.

Recommended usage: In the startup script, after any Memory Storage Library calls, place your DECRYPT actions for each database.  In the termination script, before any Memory Storage Library calls, place your ENCRYPT actions.


pe.DecryptEx filename1 [, filename2]...
pe.EncryptEx filename1 [, filename2]...
Description: Encypts or unencrypts (decrypts) an entire database.
Parameters: Filename Filename of the PDB file you want to encrypt.
Example: 

pe.EncryptEx "MyApp-Data", "MyApp-Cats"
pe.DecryptEx "MyApp-Data", "MyApp-Cats"

These actions will encrypt or decrypt the entire database.  This encryption must be used in combination with one of the User Password actions or the databases will not be encrypted.  Pro Branching is required.

Recommended usage: In the startup script, after any Memory Storage Library calls, place your DECRYPT actions for each database.  In the termination script, before any Memory Storage Library calls, place your ENCRYPT actions.

pe.DecryptEx returns the following based on if the passwords could unlock all encrypted databases:

For example:

Action eventStartup
pe.AskPswdEx "123", PIN, Unchecked
Goto +2
Goto +3
pe.DecryptEx "MyApp-Data"
Goto +2 'Success
ExitApp
EndAction


pe.Dyn16RegInit rpn-expression, User|HotSyncID
Description: Initializes the Dynamic 16-bit registration method.
Parameters: rpn-expression: An expression, in reverse-polish-notation that is used to create a registration code from a hotSync ID.
  User|HotSyncID: The word "User" if you want to use arbitrary names for key generation.  Use "HotSyncID" if you want the key to be tested against the device's HotSync ID.
Example: 

pe.Dyn16RegIni "key c i * +", HotSyncID

This will create dynamic keys based on a name.  The exact rpn-expression controls what values your registration code will have.  All registration codes result in a 5 digit number (may have leading zeros).  This is the model used by Handango but, with a minor amount of work, is easily used on PalmGear, eSellerate, and other retail sites that support dynamic code generation.

In Visual Basic, the following routine will generate a code based on a name.  This code can be translated to a variety of languages.

Private Function GenCode(ByVal UserName As String) As String
Dim I As Integer
Dim C As Integer
Dim Key As Long
Key = 0
'If the name is longer than 10, then take first and last 5 characters. If Len(UserName) > 10 Then UserName = Left(UserName, 5) & Right(UserName, 5) End If 'The loop is always zero based. For I = 0 To Len(UserName) - 1 'C is always the ascii value of the character (A = 65) C = Asc(Mid(UserName, I + 1, 1)) 'Your formula in algebraic format. Example's RPN = "k c i * +" Key = Key + (C * I) Next 'Take the lower 16 bits and pad out with leading "0" GenCode = Right("00000" & (Key And &HFFFF), 5) End Function

NOTE: If you change the rpn-expression, your registration key generation will change and you will have to re-issue your registration code to your users.


pe.HardRegDialog, pe.RegDialog, pe.ShellRegDialog, pe.Dyn16RegDialog
Description: Displays a dialog and gets the licensing information from the user.
Example: 

pe.HardRegDialog
pe.RegDialog
pe.ShellRegDialog
pe.Dyn16RegDialog

Each of these actions should have a corresponding RegInit action of the correct type (e.g. pe.HardRegDialog goes with pe.HardRegInit).  You can only have one registration method per application as they all are tested with the same actions.

Before you can use this routine, the corresponding INIT action must be called first. 

It's recommended that these actions should be attached to a menu item, button, or a button on an About screen. 


pe.HardRegI nit key
Description: Initializes the "Hard-Wired" registration method.
Parameters: key: The registration key that applies to all users who register your application.
Example: 

pe.HardRegInit "BlueBell" 

This is used to have a single registration key for all users.  This key can be issued to the Seller (e.g. PalmGear or Handango) to be issued to the User when a purchase is made.  With the hard-wired model, administration is easy, but security is rather low.


pe.HasPassword
Description: Checks if the user has a password and performs a branch.
Parameters: none  
Example: 

pe.HasPassword

This tests the app if the user has a password.

To support the branching ability in PDA Toolbox 6.0 Professional Service Pack 6 (SP6), the pe.HasPassword will test and branch based on the following conditions:

For example:

Action TestPassword
pe.HassPassword
Goto @Yes
Goto @No
@Yes:
au.Alert "Password Defined."
Goto @Continue
@No:
au.Alert "Password NOT Defined."
Goto @Continue:
@Continue:
EndAction


pe.IsReg Talt, Stop
Description: A general routine to check if the application is registered and halt action processing if not.
Parameters: Talt: This is the ID a special alert that you need to create in your application to display the number of records created and the maximum allowed.
  Stop: The word "Stop" will make this action ignore the actions following it when the user is not registered.  In effect, the user cannot perform a certain action if not registered.  If you want to just nag them, you can set this value to "Continue" or "Cont".  In either case, the alert specified by the Talt is displayed.
Example: 

pe.IsReg 1000, Stop
pe.IsReg 1010, Continue

This action is used anywhere you want to either nag or prevent a user from functionality in your program.

The Talt that you are required to make can be added to your application's PFA file on the handheld.  When PDAT/Advanced compiles an application, it copies all of the non-pSTR resources into your application.


pe.IsScreen bw|color, gray, Talt, Stop
Description: Tests if your application is running on a color or black&white device.
Parameters: bw|color: The string "BW" or "Color".  Determines which mode you desire.
  gray: If the device is not color, do you want to allow gray-scale?  "Gray" and "Color" are the valid values.  Think of this value as being "Or'd" with the first parameter.
  Talt: This is the ID a special alert that you need to create in your application to display the failed error message.
  Stop: The word "Stop" will make this action ignore the actions following it when the user hits their limit.  In effect, if the OS is below the value you specify, you won't allow them to draw a DINK.  If you want to just warn them, you can set this value to "Continue" or "Cont".
Example: 

pe.IsScreen BW, Gray, 1000, Stop     (if not BW or Gray-Scale,  it will stop actions and will show the error)
pe.IsScreen Color, Gray, 1010, Cont   (if not color or Gray-Scale, it will continue the actions and show the warning)
pe.IsScreen Color, Color, 1010, Cont   (if not color, it will continue the actions and show the warning)

This is useful if you distribute both a B&W and a Color version, you can alert the user that the version they are running is the wrong one if they are running a B&W version on a color device.  Set second parameter to "Gray" if you want to allow gray-scales.

The message text of the Talt does not take any parameters.  You may have whatever you want it in.

The Talt that you are required to make can be added to your application's PFA file on the handheld.  When PDAT/Advanced compiles an application, it copies all of the non-pSTR resources into your application.   


pe.MinOS major, minor, Talt, Stop
Description: Tests if your application is running on a minimum OS platform.
Parameters: major: The desired minimum OS major version number.  For OS 3.5, the "3" is the major version.
  minor: The desired minimum OS minor version number.  For OS 3.5, the "5" is the minor version.
  Talt: This is the ID a special alert that you need to create in your application to display the failed error message.
  Stop: The word "Stop" will make this action ignore the actions following it when the user hits their limit.  In effect, if the OS is below the value you specify, you won't allow them to draw a DINK.  If you want to just warn them, you can set this value to "Continue" or "Cont".
Example: 

pe.MinOS 3, 5, 1000, Stop     (if under OS 3.5,  it will stop actions and will show the error)
pe.MinOS 4, 0, 1010, Cont     (if under OS 4.0, it will continue the actions and show the warning)

The message text of the Talt does not take any parameters.  You may have whatever you want it in.

The Talt that you are required to make can be added to your application's PFA file on the handheld.  When PDAT/Advanced compiles an application, it copies all of the non-pSTR resources into your application.   


pe.RegInit prefix, key, method, User|HotSyncID
Description: Initializes the general registration method.
Parameters: prefix: Your desired registration code prefix.  This is limited to five characters.
  key: A random key number between 1000 and 100000. 
  method: A number between 1 and 10.  This is the internal method used to generate the keys.
  User|HotSyncID: The word "User" if you want to use arbitrary names for key generation.  Use "HotSyncID" or "PalmID" if you want the key to be tested against the device's HotSync ID.
Example: 

pe.RegInit "PE-", 12345, 3, HotSyncID    (results in reg codes like "PE-123123123" that match to the HotSyncID of the device)
pe.RegInit "MA*", 12345, 5, User    (results in reg codes like "MA*123123123" that match to the name requested by the user)

This is a general purpose Name/Key registration model.  Keys can be generated on the Windows Desktop.  You can key the codes to the device HotSyncID or an arbitrary name.  The advantage of the HotSyncID is that the key will only work with devices with the HotSyncID name so it's harder to copy to other devices.  The advantage of the arbitrary name is that you'll have less support problems if a user gives you the wrong HotSyncID or with the wrong case (e.g. "Bob" is not the same as "BOB"). 

NOTE: If you change the prefix, key, or method, your registration key generation will change and you will have to re-issue your registration code to your users.


pe.RunLimit runs, Talt, Stop, Always
Description: If the application is unregistered, this action will limit times the application can be run.
Parameters: runs: The number of runs you want the user limited to while the application is unregistered.
  Talt: This is the ID a special alert that you need to create in your application to display the number of runs the user has made and the maximum allowed.  This parameter is used by the Stop and Always parameters.
  Stop: The word "Stop" will make this action ignore the actions following it when the user hits their limit.  In effect, after the user's allowable limit, you won't allow them to create a new record until registered.  If you want to just nag them, you can set this value to "Continue" or "Cont".
  Alway: The word "Always" will make this action always display the Talt specified.  If set to "Limit", then the Talt won't be displayed until the user creates their allowable record count.
Example: 

pe.RunLimit 5, 1000, Stop, Always     (the limit is 5 runs where it will stop actions and will always show the nag while unregistered)
pe.RunLimit 8, 1010, Cont, Limit     (the limit is 8 runs where it will stop actions and only show the nag when the limit is reached)

To be more accurate, this limits the number of times the action pe.RunLimit executes.  If programmed correctly, then this value will tend to follow the number of times the application is executed.

The message text of the Talt may have two parameters filled in for you to indicate the remaining and total.  This should be similar to "You have ^1 runs remaining out of ^2 runs available."  The ^1 will be filled in with the "remaining runs" value, and the ^2 is filled in from the "total runs allowed" value.

The Talt that you are required to make can be added to your application's PFA file on the handheld.  When PDAT/Advanced compiles an application, it copies all of the non-pSTR resources into your application.   


pe.ShellRegInit key
Description: Initializes a ShellReg compatible registration model.
Parameters: key: The key that you generated with the ShellReg utility.
Example: 

pe.ShellRegInit "123456789"

If you are upgrading your application from using the ShellMaker model to using the new PDA Toolbox and PDAT/Advanced models, then you should at least start with this model of registration in order to stay compatible with your existing users.

Keys are generated only with the ShellReg utility.


pe.StartForm UnRegID, RegID
Description: Sets the startup form based on registered status.
Parameters: UnRegID: The form ID to use if the app is not registered.
  RegID: The form ID to use if the app is registered.
Example: 

pe.StartForm 1000, 1100

This will set the startup form for your application so you can bypass splash or nag screens after registration, or if a registered version is beamed.  This routine must be called after one of the INIT routines.

PDAT STANDARD NOTE: If a registered version is beamed, the user may get in "as registered" the first time, but after this action has been executed, it will be set back to the unregistered mode.  This does not affect the PDAT Professional version.

 


PE.TestReg
PE.TestNotReg
PE.TestRegEx
Description: Silently tests if the app is (un)registered and halts script execution if it fails.
Example: 

pe.TestReg
$Alert 1200

pe.TestNotReg
$Alert 1200

This tests the app if it is registered (.TestReg) or unregistered (.TestNotReg) and halts execution if the test fails.

In the examples, if the app is registered then pe.TestReg will succeed and display the alert.  If the app is registered then the pe.TestNotReg will fail and the alert will not display.  

If the app is not registered then pe.TestReg will fail and not display the alert.  If the app is not registered then the pe.TestNotReg will succeed and display the alert.

To support the branching ability in PDA Toolbox 6.0 Professional Service Pack 6 (SP6), the pe.TestRegEx will test and branch based on the following conditions:

For example:

Action TestRegDemo
pe.TestRegEx
Goto +2
Goto +3
au.Alert "It is registered."
Goto +2
au.Alert "It is not registered."
EndAction


pe.UserPswd on|off
Description: Forces the password prompt checkbox to be checked or unchecked (on or off)
Parameters: on|off: The actual words "On" or "Off"
Example: 

pe.UserPswd On     (force the user to be prompted for a password)

Although the user normally controls whether they want a password prompt or not, this command can be useful under certain situations. 

Purchasing Information

This program is not Freeware.  It is Demoware.  This means that you can, and should, try the demo out before buying.  Shortly after you register via PayPal, PalmGear, or Handango, you will receive an unlock key that will enable developing with this library.

 The cost of this package is US$20.00.  Registered users receive the following:

Support 

The Official Support Site for the Private Eye Library is at www.PDATNutsAndBolts.com.

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 "Private Eye Library" aka "PDATPELib.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 the reporting of Palm OS(tm) application databases (PRC) created by the PDA Toolbox(tm) Application Generator. The Licensed Product in its entirety is protected by US and foreign copyright.  YOU MAY NOT DISTRIBUTE THE LICENSE CODE provided to you.

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 "PDATPELib.prc" but not documentation, license codes, or other information about this library.  For those purposes, you have the right to install the "The Software" and any associated files on one (1) computer. Use of "The Software" on a network or any other arrangement by which its functions are accessible to more than one user at a time is not permitted. 

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.


PDAT/Advanced, ShellReg, ShellMaker, DeskReg, and MyName is Copyrighed by Richard R. Sands dba Sands USA
PDAT Toolbox is Copyrighted by PDAToolbox.com
Nutshell executable and documentation are Copyright ©2002 by Ecamm Network. All rights reserved.
RsrcEdit is apparently not copyrighted by Quartus, but they are the caretakers of RsrcEdit.
Windows is a Trademark of Microsoft Corporation
Documentation Copyright (C) 2002-2006 Richard R. Sands dba Sands USA
All Rights Reserved
And Finally, ...
Palm, PalmSource, Palm1One, Palm OS, Palm Computing, HandFAX, HandSTAMP, HandWEB, Graffiti, HotSync, iMessager, MultiMail, Palm.Net, PalmPak, PalmConnect, PalmGlove, PalmModem, PalmPoint, PalmPrint, and PalmSource are registered trademarks of Palm, Inc.  Palm, the Palm logo, MyPalm, PalmGear, PalmPix, PalmPower, AnyDay, EventClub, HandMAIL, the HotSync logo, PalmGlove, Palm Powered, the Palm trade dress, Smartcode, Simply Palm, WeSync, and Wireless Refresh are trademarks of Palm, Inc.