Skip to Main Content
Palm OS Programming, 2nd Edition
book

Palm OS Programming, 2nd Edition

by Julie McKeehan, Neil Rhodes
October 2001
Intermediate to advanced content levelIntermediate to advanced
704 pages
19h 33m
English
O'Reilly Media, Inc.
Content preview from Palm OS Programming, 2nd Edition

Palm OS Conventions

There are also a variety of Palm coding conventions that are useful to know. There are type conventions and standard naming practices for everything from functions to managers. It is worth getting a clearer idea of what these are before wading knee-deep into your first coding project. These are the ones you should learn.

Types

Here are the main types used by the Palm OS:

UInt32

An unsigned 32-bit integer.

Int32

A signed 32-bit integer.

UInt16

An unsigned 16-bit integer.

Int16

A signed 16-bit integer.

UInt8

An unsigned 8-bit integer.

Int8

A signed 8-bit integer.

Boolean

A 1-byte true or false value.

Char

A 1-byte character that will only work on systems with 1-byte encodings.

WChar

A 2-byte character suitable for all encodings (including for Japanese, Chinese, and so on).

Err

A 2-byte integer used for errors. The value errNone signifies no error.

Coord

A signed 2-byte integer used to represent a screen or window coordinate.

MemPtr

Specifies a (4-byte) pointer to an allocated chunk in memory.

MemHandle

A (4-byte) reference to a relocatable chunk of memory (see Chapter 6 for more details).

Function and Manager Naming Conventions

The Palm OS uses mixed-case for names, with an initial uppercase for functions and types. Constants and enumerations begin with lowercase letters. The following snippet of code shows the conventions in action (emphasis shows functions, types, and enumerations):

                  FormPtr form;
UInt32  romVersion;
FtrGet(sysFtrCreator, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Palm OS Network Programming

Palm OS Network Programming

Greg Winton
Palm Programming: The Developer's Guide

Palm Programming: The Developer's Guide

Neil Rhodes, Julie McKeehan

Publisher Resources

ISBN: 1565928563Errata Page