Search PalmPower's 487 Palm-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
PROGRAMMING POWER
Hello World!
By Alan Jay Weiner

Note on program listings
PalmPower is still a growing journal. And as such, it occasionally has growing pains. In this case, the growing pains relate to how it displays program code in your Web browser. PalmPower is created using a powerful and complex Journal Production System that performs all of the HTML code generation (including creating back issue lists, tables of contents, and even paginating articles). Unfortunately, raw C code apparently confuses the current version of the Journal Production System. Rather than leaving you without Alan's excellent code examples, we will simply be including links to individual, separate HTML pages containing the code. It's not as pretty as we would normally like, but it will get the job done until we can get the production software trained on the intricacies of C code. -- DG

In The C Programming Language by Brian Kernighan and Dennis Ritchie, their first example of a C program is the now-traditional "hello, world" program. This four-line program simply prints the words "hello, world" and exits. K&R wrote it like this (see http://www.component-net.com/pp-extras/helloworld1.html).

Alas, life is not so simple any more - the classic "hello, world" program is quite a bit more complex when we code it for the PalmPilot.

PalmPilot applications generally don't start and run to completion without yielding control to the Palm OS operating system. Applications that fail to yield control prevent other things from working. For example, the user can't switch to other applications, power down, or do a "find." Most applications will start, display a screen, and then yield until they're told to do something. Usually the user will press a button, select a menu option, or some outside event will cause the program to do something. Such programs are "event driven". They do a little work each time some particular event occurs.

For example, when the built-in Address Book starts, it does some initialization, reads the first few data records, and displays a screen. It then pauses, handing control back to Palm OS until the user does something - perhaps pressing the "new" button. The button press is an event. The program then scurries off to do a bit of work before returning to the OS to wait for the next event.

This month, we'll look at an appallingly complex "hello, world" application for the PalmPilot. Step by step, we'll examine how this "simple" application works, walking through application start, exit, and the various events it receives and processes during operation.


1  ·  2  ·  3  ·  4  ·  5  ·  6  ·  Next »
Other articles you might like
Home > Phones and PDAs > Palm and Treo > Programming (24 articles)
   How PDA software is born
   Program with Simplicity
   Kinectivity 2.0 brings enterprise application developers new tools
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Other PalmPower Articles
Palm gets up to date with new Tungsten family of handhelds
Create handwritten email with riteMail
Presenter-to-Go puts PowerPoint presentations on your Palm OS handheld
Looking for the cutting edge
Gain remote access to databases and PLCs
PalmSource Open House showcases what's new in the Palm community
Analysis: handheld market share
More from the ZATZ journals
Computing Unplugged: Introducing the Jones family and their full-family backup challenges
David Gewirtz Online: CNN commentary and analysis
DominoPower: Lotus must open source Notes and Domino
OutlookPower: Hands on debugging a broken Outlook forwarding rule
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login