: Just recently started with MW, and don't yet know much about
: Mac programming either. I had some code around though and tried
: to compile it. Problems though. After much pfaffing about I get
: it down to this:
: void main(void)
: char *s = GetItem();
: which expects a `,' at the closing parenthesis. So what's special
: about GetItem? (getitem is the same but Getitem, getITem are ok).
: Rather amusing getting a syntax error because of spelling. Who
: can enlighten me?
GetItem() is a Toolbox function (subroutine actually) that gets the
textname of a specified menu item. Its full prototype is:
pascal void GetItem(MenuHandle menu, short itemNum, Str255 *itemString);
Its definition is predefined in MacHeaders, a file which is by
default pre-included in your project. Your function's name is
colliding with the Toolbox one. Go to Preferences and take out
MacHeaders or rename your function.
getitem() is the C equivalent of GetItem() which was a leftover
from MPW (Macintosh Programmers Workshop) where Pascal strings
were converted automatically into C strings when the lowercase
version of the function was called. As you already have learned,
C identifiers are case sensitive.
Hawksbill Capital Management - Santa Rosa, CA / (707) 575-7077
"Parang lumalakad ako sa loob ng panaginip" / Teatro ng Tanan / Windsurfing