[comp.sys.mac.programmer] Think C SetItem problem

rolf@sparc1 (Rolf Wilson) (09/14/90)

   I have a strange problem with Think C 4.02. I have been toggling the
text of some menu items with statements like this --
  SetItem(theMenu,4,"\pstate1");
and toggling it back with
  SetItem(theMenu,4,"\pstate2");

The 3rd parameter to SetItem is supposed to be a Str255, but this
has always worked just fine. However, now when I toggle one PARTICULAR
item several times, I get something like this in the menu text
   toggle once:  state2
   toggle again: state1
   toggle again: state2 b
   toggle again: state1 state2 bad rotated bitm  

In other words, even though I was giving an exact string, the menu item
is adding extra bytes from the next string in the program. The string
"bad rotated bitmap" is the next string in the program, but it is in
an entirely different routine. I tried remaking my entire project, and
also using the "separate strs" option, but neither helped. I tried
using a Str255, and putting the string in it first, but that did not 
help.
   I am quite puzzled. Can anyone help?

--

Rolf Wilson   Illinois State Geological Survey   rolf@sparc1.isgs.uiuc.edu