SatForms Power Tip: Datatypes in SF 4.1

----------------------------------------

 

Basic Information

There are 7 datatypes in Satellite Forms 4.1

  1. CHARACTER
  2. NUMERIC
  3. TRUE/FALSE
  4. DATE
  5. TIME
  6. BINARY
  7. TIMESTAMP (Use with Oracle Light Consolidator only)

 

If a form is linked to a table, controls may be linked to one or more fields with a matching datatype.

 

AppDesigner

Data can be entered into the AppDesigner for testing and distribution of data to the application.

 

App Designer follows the current locale setting. So the date or time format depends on how your machine is configured. For entering dates in App Designer, double-click twice on the cell to be edited. App Designer will display an easy to use Date entry window.

 

Note: If you are using SatForms Server 1.1, do not put initial data into tables that will be synchronized using App Designer. Synced tables will need to be populated only during synchronization with SatForms Server.

 

Sample data will have the following format in the AppDesigner

 

Controls

Controls are used to display data.  For example, edit and paragraph controls display data as strings, INK controls display data as connected dots.

 

Values in edit/paragraph controls are always strings. Edit controls can be used to show different data types.  These types must be converted into strings for display.  When the control values are "flushed"/"saved"/"extracted" into tables, variables, scripts, etc, they must be converted back to their native type.

EMPTY

Satellite Forms 4.1 introduced the concept of EMPTY.

 

The rules for EMPTY are as follows:

·        Fields in a new record are always initialized to EMPTY.

·        EMPTY is *not* equal "" (empty string).

·        EMPTY and ISEMPTY can be used with fields and variables. 

o       ISEMPTY(A) is identical to A=EMPTY

o       NOT ISEMPTY(A) is identical to A<>EMPTY

·        EMPTY and ISEMPTY *cannot* be used with controls (!).  Note that incorrect syntax will compile in the AppDesigner, but this will be corrected in future revisions so it will not compile.

·        Empty edit/paragraph controls always contain "".

·        If edit/paragraph controls are bound to fields, flushing BLANK (or empty or no display) controls would cause "" to be converted to the appropriate value according to  the following rules:

o       CHARACTER field <--> ""    

o       NUMERIC field   <--> EMPTY

o       LOGICAL field   <--> F

o       DATE field      <--> EMPTY

o       TIME field      <--> EMPTY

o       BINARY field    <--> EMPTY

o       TIMESTAMP field <--> EMPTY

·        In particular, note the following scenario:

o       Field is EMPTY and linked to a control

o       Control loads field for display on screen

o       Form is closed or moved to next/previous record

o       Control value will be saved into table as "".

·        Assigning "" to non-CHAR fields would cause the fields to contain EMPTY.

 

Ok, so what does this mean to existing applications?

 

Scripts that test edit/paragraph controls to "" do not need to be updated.

 

Scripts that test CHARACTER fields with "" may need to also test against EMPTY, unless new records are always initialized with "".

 

Scripts that test non-CHAR fields with "" will need to be updated to test against EMPTY or ISEMPTY.

 

Scripts that assign "" to non-CHAR fields will need to be reevaluated. Most likely these scripts will need to assign EMPTY instead.

Data Storage and Edit Controls

Edit controls always contain strings, as noted above.  There are four elements to consider:

 

The following table demonstrates some of these differences.  It is critical to note that after flushing the value stored in the first example changes from EMPTY to "".  For all other datatypes, flushing the edit field stores the value as EMPTY.

 

 

Datatype

Entered in AppDesigner

Contained in Edit control

Displayed on Palm

Stored in Field

CHARACTER

BLANK

""

BLANK

EMPTY 

CHARACTER

 

""

BLANK

""  (after flushing)

CHARACTER

abc

abc

abc

abc

NUMERIC

BLANK

""

BLANK

EMPTY

NUMERIC

123

123

123

123

DATE

BLANK

""

BLANK

EMPTY

DATE

11/25/2001

(Follow Win OS settings)

11/25/01

(Follow Palm OS settings)

11/25/01

(Follow Palm OS settings)

2001/11/25

(YYYY/MM/DD

always)

TIME

BLANK

""

BLANK

EMPTY

TIME

11:25 am

(Follow Win OS settings)

11:25 AM

(Follow Palm OS settings)

11:25 AM

(Follow Palm OS settings)

11:25:00

(HH:MM:SS           24 hr time always)

 

 

 

 

 

Jon Blackman, MD, MS

www.pocketinformatics.com

 

Revised 2001-10-15