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

Name

STRINGTABLE (tSTL)

Synopsis

                     
STRINGTABLE ID <StringTableResourceId.n> <PrefixString.ss> ... <String.ss>

Notes

  • Using the tSTL resource in a LIST:

    [source.rcp]
    STRINGTABLE stringTableMetric 
      "" "Litres" "Meters" "Celsius" "Newtons" "Kilograms"
    
    [source.c]
    MemHandle memHandle, memStringList;
    MemPtr    ptrTable;
    UInt16    count;
    
    memHandle = DmGetResource('tSTL', stringTableMetric);
    ptrTable  = (MemPtr)MemHandleLock(memHandle);
    
    // get the string count <-- "messy"
    count     = 
      (*((UInt8 *)(ptrTable + StrLen((Char *)ptrTable) + 1)) << 8) |
       *((UInt8 *)(ptrTable + StrLen((Char *)ptrTable) + 2));
    
    // get the handle to an array of strings
    memStringList = 
      SysFormPointerArrayToStrings(ptrTable+StrLen((Char *)ptrTable) + 3, count);
    
    // Note: the "prefix" is ignored here
    ...
    
    MemHandleUnlock(memHandle);
    DmReleaseResource(memHandle);

Using the tSTL resource to get a single string:

[source.rcp]
STRINGTABLE stringTableTypes "Units are:" "Metric" "Imperial"

[source.c]
Char string[32];
SysStringByIndex(stringTableTypes, 0, string, 32);

Notes

  • A limitation of 384 strings applies.

Example

STRINGTABLE ID 100 "" "One" "Two" "Three" "Four" 
STRINGTABLE ID 100 "-" "One" "Two" "Three" "Four"
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