Blackwell Chris A Maj CENTAF-PSAB/C3 TCT Attack Coordinator <[EMAIL PROTECTED]> wrote:
> 
> Hate to ask this "stupid" question but my sanity has overcome my ego...
> 
> I am working with the Code Warrior Palm OS SDK 4.0.
> 
> I've stuck mostly with the loaded template and started to add on a few
> proceedures. I'm trying to use a local variable and its causing an
> "Expression Syntax Error" on the next variable declaration. Ie:
> 
> void DBManualEntry() 
> {
>        Err er;
>        UInt16 position=13;
>        //position+=11;
>        
>        MemHandle vh=MemHandleNew(3);
>        MemPtr npos = MemHandleLock(vh);
>        
>        ListBoxStrType *payments = MemPtrNew(sizeof(ListBoxStrType));
>        <snip>
> 
> }
> 
> If I let "position+=11;" compile, I will get an Expression Syntax Error on
> the next line "MemHandle vh..."
> 
> I've been teaching myself with a book and I just keep missing this part.
> Huge thanks for any help.
> 

First comment: get a better book to teach yourself C.

In C any executable statements (like your position += 11) have to follow
the local variable declarations in your function (here DBManualEntry).
You are confused by the fact that declaration statements can have 
initialization clauses.
In fact all the statements you quote are declarations (local variables:
er, vh, position, npos, payments).
So the 'position+=11;' statement should be just before (or after) the
<snip>.

Good luck with teaching yourself C.
PalmOS programming is yet an other kettle of fish ...

Ton van Overbeek

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to