Next
Previous
Table of Contents
4.2 Hello_doc.html
Below you see what the generated html-document for "Hello" would look like:
Hello
Hello is nothing but a fancly little hello-world program!
Globals
- int flag = 0;
used for testing some properties
- Int lform;
keep track of where user came from
- FieldPtr theField = 0;
another good reason to make it global here
- VoidHand myRecord;
point to the record
- UInt index = 0;
where do we start?
- Ptr RecPointer;
pointer to record, many functions need this
- char *theRecord;
the entry into the database
- char nullstring = 0;
must be global because...
- DmOpenRef myDB;
reference to teh database, needed for read and write
- char myDBName[] = "HelloWorldDB";
name of the database
Enums
SymbolKind
sessionSym
documentSym
variableSym
fieldSym
globalSym
localSym
[All Enums] [Next Enum]
foo
intK
charK
boolK
[Previous Enum] [All Enums] [Next Enum]
only
this
is
a
test
[Previous Enum] [All Enums]
Structs
SYMBOL
a short description of this struct here
this struct is here only to show how structs are handled
char *name;
SymbolKind kind;
union {
struct { int args; struct SymbolTable *dsym;} documentS;
enum{selectF,textF,radioF,resultF} fieldS;
int variableS;
TYPE globalS;
TYPE localS;
} val;
struct SYMBOL *next;
[All Structs]
GLOBAL
another bogus struct
NAME *names;
TYPE type;
struct INIT *init;
struct GLOBAL *next;
[All Structs]
EXP
a more complicated struct
to show how nested structs and enums/uniosn
would look like
int lineno;
TYPE type;
enum{intconstK,trueK,falseK,stringK,identifierK,equalityK,
greaterK,andK,orK,notK,plusK,minusK,timesK,concatK,
divK,modK,rangeK,lengthK,randomK,systemK} kind;
union{
int intconstE;
char *stringE;
struct { char *name; SYMBOL *idsym;} identifierE;
struct { struct EXP *left,*right;} equalityE;
struct { struct EXP *left,*right;} greaterE;
struct { struct EXP *left,*right;} andE;
struct { struct EXP *left,*right;} orE;
struct EXP *notE;
struct { struct EXP *left,*right;} plusE;
struct { struct EXP *left,*right;} minusE;
struct { struct EXP *left,*right;} timesE;
struct { struct EXP *left,*right;} divE;
struct { struct EXP *left,*right;} modE;
struct { struct EXP *left,*right;} concatE;
struct { struct EXP *string,*from,*to;} rangeE;
struct EXP *lengthE;
struct EXP *randomE;
struct EXP *systemE;
} val;
Functions
 
ReadData
Prototype
static void ReadData(void);
Purpose
Reads the data from the database
Result
returns nothing
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
for example: see WriteData
[All Functions] [Next Function]
 
WriteData
Prototype
static void WriteData(void);
Purpose
Writes the data to the database
Result
returns nothing
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
for example: see ReadData
[Previous Function] [All Functions] [Next Function]
 
StartApplication
Prototype
static Err StartApplication(void);
Purpose
Initializes everything necessary to start the application
Result
returns an Err if initialization fails
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
for example: see StopApplication
[Previous Function] [All Functions] [Next Function]
 
StopApplication
Prototype
static Err StopApplication(void);
Purpose
makes sure everything is fine when we leave the application
Result
returns an Err if stopping failed
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
for example: see StartApplication
[Previous Function] [All Functions] [Next Function]
 
TextFormHandleEvent
Prototype
static Boolean TextFormHandleEvent(EventPtr event);
Purpose
handles all events for the form "TextForm"
Result
returns true if all's swell, false otherwise
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
[Previous Function] [All Functions] [Next Function]
 
SelectFormHandleEvent
Prototype
static Boolean SelectFormHandleEvent(EventPtr event);
Purpose
handles all events for the form "Selectform"
Result
returns true if all's swell, false otherwise
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
[Previous Function] [All Functions] [Next Function]
 
HelloFormHandleEvent
Prototype
static Boolean HelloFormHandleEvent(EventPtr event);
Purpose
handles all events for the form "Helloform"
Result
returns nothing
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
[Previous Function] [All Functions] [Next Function]
 
ApplicationHandleEvent
Prototype
static Boolean ApplicationHandleEvent(EventPtr event);
Purpose
handles ALL events, calls other functions
Result
returns true if all's swell, false otherwise
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
for example:
see
[Previous Function] [All Functions] [Next Function]
 
EventLoop
Prototype
static void EventLoop(void);
Purpose
the loop that handles all events
Result
returns nothing
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
[Previous Function] [All Functions] [Next Function]
 
PilotMain
Prototype
DWord PilotMain(Word launchCode, Ptr cmdPBP, Word launchFlags);
Purpose
Main function
Result
returns nothing
Comments
if you want to explain something, do it here
See also
enter a reference to other documents/functions here
[Previous Function] [All Functions]
Forms
FORM ID HelloWorldForm AT (0 0 160 160)
MENUID 1000
BEGIN
TITLE "Hello World"
BUTTON "Hello" ID HelloWorldButtonHello AT (CENTER CENTER AUTO AUTO) LEFTANCHOR FRAME FONT 0
BUTTON "Show" ID HelloWorldButtonShow AT (PrevRight+5 PrevTop AUTO AUTO)
BUTTON "Hide" ID HelloWorldButtonHide AT (PrevLeft-73 CENTER AUTO AUTO)
BUTTON "Go Next" ID HelloWorldButtonGoNext AT (CENTER PrevTop-17 AUTO AUTO)
BUTTON "Do Next" ID HelloWorldButtonDoNext AT (CENTER PrevTop+35 AUTO AUTO)
END
FORM ID SelectForm AT (2 2 156 156)
USABLE
MODAL
MENUID 1004
BEGIN
TITLE "Foo"
LABEL "I came here:" AUTOID AT (8 16)
CHECKBOX "Using Menu" ID SelectFormCheckMenu AT (PrevRight-10 PrevBottom+3 AUTO AUTO) GROUP 1
CHECKBOX "Using Top Button" ID SelectFormCheckTop AT (PrevLeft PrevBottom+3 AUTO AUTO) GROUP
1
CHECKBOX "Using Bottom Button" ID SelectFormCheckBottom AT (PrevLeft PrevBottom+3 AUTO AUTO) GROUP 1
BUTTON "True?" ID SelectFormButtonTrue AT (7 140 AUTO AUTO)
BUTTON "Back" ID SelectFormButtonBack AT (PrevRight+5 PrevTop AUTO AUTO)
BUTTON "Home" ID SelectFormButtonHome AT (PrevRight+5 PrevTop AUTO AUTO)
END
FORM ID TextForm AT (0 0 160 160)
MENUID 3001
BEGIN
TITLE "Hello World"
LABEL "Enter Text:" AUTOID AT (10 20) FONT 1
FIELD ID TextFormFieldMain AT (PrevRight+5 PrevTop 140 20) LEFTALIGN FONT 0 UNDERLINED MULTIPLELINES DYNAMICSIZE MAXCHARS 80
LABEL "Display Text from:" AUTOID AT (10 PrevBottom+10) FONT 1
BUTTON "Last Session" ID TextFormButtonLastSession AT (10 PrevBottom+5 AUTO
AUTO)
BUTTON "This Session" ID TextFormButtonThisSession AT (PrevRight+10 PrevTop AUTO AUTO)
END
MENU ID HelloWorldMenuBar
BEGIN
PULLDOWN "Main"
BEGIN
MENUITEM "One" ID One
MENUITEM "Two" ID Two
MENUITEM "Three" ID Three
END
END
MENU ID SelectMenuBar
BEGIN
PULLDOWN "Main"
BEGIN
MENUITEM "One" ID SOne
MENUITEM "Two" ID STwo
MENUITEM "Three" ID SThree
END
END
END
ALERT ID HelloWorldAlert
INFORMATION
BEGIN
TITLE "Fancy: An alert"
MESSAGE "...WORLD!"
BUTTONS "OK"
END
ALERT ID SelectFormWrongAlert
ERROR
BEGIN
TITLE "Wrong!"
MESSAGE "You appear to be a liar!"
BUTTONS "OK"
END
ALERT ID SelectFormTrueAlert
INFORMATION
BEGIN
TITLE "True!"
MESSAGE "You speak the truth!"
BUTTONS "OK"
END
END
ALERT ID HelloWorldAlertSure
CONFIRMATION
BEGIN
TITLE "Please confirm"
MESSAGE "Are you sure you want to \"^1\"?"
BUTTONS "Yes" "No"
END
END
ALERT ID TextFormAlertShowSaved
INFORMATION
BEGIN
TITLE "Your Text"
MESSAGE "The last time you typed: ^1"
BUTTONS "OK"
END
ALERT ID TextFormAlertShowCur
INFORMATION
BEGIN
TITLE "Your Text"
MESSAGE "You just typed: ^1"
BUTTONS "OK"
END
MENU ID TextFormMenu
BEGIN
PULLDOWN "Main"
BEGIN
MENUITEM "One" ID TOne
MENUITEM "Two" ID TTwo
MENUITEM "Three" ID TThree
END
END
VERSION ID 1000 "0.1"
This document was created with palmdoc.
End of exampel code.
Next
Previous
Table of Contents