Page 1 of 1

PostPosted: Fri Feb 18, 2005 5:43 pm
by Mikael
This really is a strange thing. I was trying to compile with a .h file which contains two constants named 'Lines' and 'Field'. I kept getting an 'undeclared indentifier' message every time and the info kept pointing to the Array() function - which I'm using in my program. The strange thing is, when I instead included the same constants in the code, the program compiled fine. I guessed that there must be something in the PToolbox.h file causing a clash and had a look. Array() was present, but then I noticed the Lines() and Field() functions and worked out what was wrong. I removed these two and everything compiled fine. My question is, will the removal of these two lines from the PToolbox.h adversely affect the way PToolbox works at some point - even if I never use those particular functions? I know I should really change the names of these two constants to something else, but they are mentioned in quite a few places in the code and quite a few resources are dependent on them.

Thanks in advance,


PostPosted: Fri Feb 18, 2005 5:59 pm
by Mikael
Hmm. I've just tested it on the Simulator and received a 'banzai' alert. I tried putting the full version of PToolbox.h back and including those two constants in the code and got a 'free handle' alert; so I suppose that answers my question. Well I'll just have to change those two constant names after all.

Mikael :)

PostPosted: Sat Feb 19, 2005 8:10 pm
by jstadolnik
You can rename functions in the PToolboxLib.lib file but you can't remove or comment out functions, else you'll get crashes... doing so alters the name-to-function mapping between PocketC and the library. Basically you'll end up calling the wrong function and the wrong number of function parameters will end up getting popped... generally resulting in bad behavior.


The PToolboxLib guy.

PostPosted: Sun Feb 20, 2005 9:07 am
by Mikael
Thanks for the info Joe, I'll try doing what you suggested and see what happens.