> I am working with the Code Warrior Palm OS SDK 4.0.
probably best not to mention it like that, you normally have a release
of codewarrior (r5,6,7,8 or 9) and, the SDK release. the SDK release
can be used in any codewarrior version by default. the codewarrior
compiler version is probably more important than the SDK version :)
> 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);
yes, thats standard C rules. you are not allowed to create a new
declaration for a variable once you have started writing statements
that operate on declarations.
its also horrible programming practice to do it the way you have.
its best to declare all the variables you need at the top, and,
give them values below. in rare cases, you may be tempted to use
a code block for counter variables etc, or variables more specific
to a branch of the code, ie:
x += 13;
{
MemHandle y;
y = ...;
}
you can check this up in more detail by looking at the 1990 ISO C
standard, which specifically tells you:
"... all variables be declared at the start of a scope block."
> I've been teaching myself with a book and I just keep missing this part.
> Huge thanks for any help.
start of here:
http://www.lysator.liu.se/c/bwk-tutor.html
never hurts to go over your C again :) and Kernighan is always a
good start when it comes to catching up on your C :P
---
Aaron Ardiri [EMAIL PROTECTED]
CEO - CTO +46 70 656 1143
Mobile Wizardry http://www.mobilewizardry.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/