Palm Programming: The Developer's Guide by Neil Rhodes and Julie McKeehan Following are the changes made in the 3/99 reprint: (26) In the tip: (http://www.gnu.org/fsf) was changed to read: (http://www.fsf.org) {32}: 2nd paragraph: Satellite Forms, by SoftMagic, now reads: Satellite Forms, by Puma Technology [34]: First paragraph, At the time of this writing, the price tag for Satellite Forms was $595 (making this the most expensive environment). Now reads: As of early 1999, the price tag for Satellite Forms was $369 (plus license fees for the runtime engine). and, It only runs on Windows and applications you create require a runtime library on the Palm device (the runtime is free). After you hand over the initial money, there is no additional cost to deploying applications built with Satellite Forms. now reads: It only runs on Windows and applications you create require a runtime library on the Palm device. There is a charge to license the runtime library which can make it expensive to deploy applications built with Satellite Forms. and, http://www.softmagic.com now reads: http://www.pumatech.com {71} In the code for PilotMain, at the bottom of the page, Err err; now reads: Err err = 0; (73) Example 4-3. HelloWorldRsrc.h Created by Hand now reads: HelloWorldRsc.h Created by Hand {73} In the code for PilotMain, Err err; now reads: Err err = 0; {75} In figure 4-3, the "Main Event Loop" column, the function SysHandleEvent is listed at both the top and bottom of the loop. This doesn't match the code. The copy at the bottom of the loop has been removed. In the same figure, "FnnDispatchEvent" now reads: "FrmDispatchEvent". {76} Same changes as on page 75, in figure 4-4. [78] In the code for MyCallback at the bottom of the page, an #endif was missing. CALLBACK_EPILOGUE return myReturnResult; now reads: CALLBACK_EPILOGUE #endif return myReturnResult; (81) The first word of the last line of example 4-9 was missing an "e": "MyFormHandlEvent" now reads "MyFormHandleEvent". {83} Halfway down example 4-11, a comment in the right column read: "Tap on Beep Another Item" It now reads: "Tap on Beep More" {86} In the paragraph after first code block, the two occurrences of 15 are now 14. {89} In the first section, there are three definitions of launch codes which are wrong. They have been changed as follows: change sysAppLaunchFind to sysAppLaunchCmdFind change sysAppLaunchGoTo to sysAppLaunchCmdGoTo change sysAppLaunchNormal to sysAppLaunchCmdNormalLaunch {100} First warning: ... pass a string with one space init (" ") instead. now reads: ... pass an empty string ("") instead. And, FrmCustomAlert(MyAlertID, "string", " ", NULL) now reads: FrmCustomAlert(MyAlertID, "string", "", NULL) (109) In the first line on the page, FrmCopyLabel(FrmGetActiveForm(), MainMyLabel, "newText"); now reads: FrmCopyLabel(frm, MainMyLabel, "newText"); (115) In the definition of ListDrawFunc, delete: FormPtr frm = FrmGetActiveForm(); ListPtr list = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, MainMyList)); {128} The second code block, function CustomerHandleEvent(): add the following line: Boolean result = false; before the line beginning if (event-.eType == ctlSelectEvent && and, return true; // don't bail out if they cancel the delete dialog now reads, result = true; // don't bail out if they cancel the delete dialog and, return true; now reads: result = true; and, return false; now reads: result = false; <139> The third bullet, second sentence: "This attribute contains a 4-bit category: ..." The colon should be a comma. {139} The last bullet, replace the word "archived" with the word "dirty" [148] 7th line from the bottom, MemHandleUnlock(theOrderHandle) now reads: MemHandleUnlock(theRecordHandle) (150) The first line: sizeof(MyRecordStruct) now reads: sizeof(newRecord) and, DmWrite(gDB, s, 0, &theStructure, sizeof(theStructure)); now reads: DmWrite(s, 0, &theStructure, sizeof(theStructure)); {154} Third sentence. Instead, the archived bit of the record is set, and ... now reads: The deleted bit is set (although the memory chunk is maintained), and ... [157] The code example for "Initialize the field with the handle": There are several bugs here. First, recPtr is undefined. Then, the if (fld) should actually be if (oldTextHandle). Finally, the parameter for the StrLen() call in the last line of the example should be recPtr->textField. And don't forget to MemHandleUnlock(theRecordHandle), otherwise it maybe impossible to resize the handle during the editing. Change the entire code block that starts with: typedef struct { to: typedef struct { int field; // other fields char textField[1]; // may actually be longer, null-terminated } MyRecType; Handle theRecordHandle; Handle oldTextHandle = FldGetTextHandle(fld); UInt theTextLength; UInt textOffset = offsetof(MyRecType, textField); if (oldTextHandle) { // must dispose of the old handle, or we'll leak memory MemHandleFree(oldTextHandle); } theRecordHandle = DmGetRecord(gDB, recordNumber); theTextLength = (UInt) MemHandleSize(theRecordHandle) - textOffset; FldSetText(fld, theRecordHandle, textOffset, theTextLength); {182} Figure 7-5, the arrow saying "converted by PilotRez" now reads: "converted by PalmRez" {183}: Last and second-to-last paragraphs contain three references to "PalmRez". The 3 occurences to have been changed to read "Rez". {184}: The first word, "PalmRez," now reads, "Rez". (211) In example 8-1, near middle of page, the following line was deleted: TblSetItemInt(tableP, i, 5, i * 2); (212) In "column 2", second sentence: on for even row numbers and off for odd row numbers now reads: off for even row numbers and on for odd row numbers {214} The last code block, function StartApplication: Delete: #ifdef __GNUC__ CALLBACK_PROLOGUE #endif and delete: #ifdef __GNUC__ CALLBACK_EPILOGUE #endif and add two lines, changing: gHandles[i][j] = MemHandleNew(1); to: gHandles[i][j] = MemHandleNew(1); if (!gHandles[i][j]) return false (219) The word "Scrolling" has been added to the bullet list at the top. (237) In the first paragraph after first code block, finds the unique idea now reads: finds the unique ID and the second reference to unique idea also reads unique ID. {237} Middle of page, MemSet(&event, 0, sizeof(EventType)) now reads: MemSet(&event, sizeof(EventType), 0) [350] change underlines to hyphens: #define customerDBName "Customers_Sles" #define orderDBName "Orders_Sles" #define productDBName "Products_Sles" now reads: #define customerDBName "Customers-Sles" #define orderDBName "Orders-Sles" #define productDBName "Products-Sles" (366) In the table at the bottom of the page, on the second data line, the tag on the item in the right-hand column is missing a colon. It now reads "Address:" Index Changes: "Puma Technology's Satellite Forms" has been added to page 452. "SoftMagic's Satelline Forms" has been removed from page 454. "SyncReadNextModifiedRecInCatgegory()" has been combined with the entry right above it, on page 455. "sysAppLaunchFind()", "sysAppLaunchGoTo()", and "sysAppLaunchNormal()" have been changed to: "sysAppLaunchCmdFind()", sysAppLaunchCmdGoTo()", and "sysAppLaunchCmdNormalLaunch()" respectively, thus moving the page numbers from the old entries to existing entries a little bit above, on page 455. Because of these changes, page breaks changed on pages 452 through 455.