Path: utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!allegra!princeton!phoenix!pucc!MJSCHMEL From: MJSCHMEL@pucc.UUCP Newsgroups: comp.sys.mac.programmer Subject: strings Message-ID: <4632@pucc.Princeton.EDU> Date: 3 Mar 88 07:55:28 GMT Reply-To: MJSCHMEL@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 47 Posted: Thu Mar 3 02:55:28 1988 Disclaimer: Author bears full responsibility for contents of this article Okay. Now we're getting into some real use of strings. You can't do an app without menus, and I'm stuck, MPW wise. (LSC, all I had to do was "\pFile", "\pQuit/Q" and so on.) Here's what don't work... Initialize() { char buffer[255]; register MenuHandle m; /* The apple and File menu don't work either * * */ strcpy (buffer, "Edit"); c2pstr(buffer); DebugStr(buffer); /* works: debugger says EDIT */ m = NewMenu(EditID, buffer); strcpy (buffer, "Undo/Z"); c2pstr(buffer); DebugStr(buffer); /* works: debugger says UNDO/Z */ AppendMenu(m, buffer); strcpy (buffer, "(-"); /* * and so on.. */ I get nonsensical strings in the menu bar reminiscent of some bad experiences I've had with strings in my early C career. (I'm not _still_ writing bad C, am I???) Of course, it's then just a matter of clicking somewhere to drop into the debugger _involuntarily_. Any insights here would be appreciated. I guess my question could be most succinctly put like this: How do you do menus from code in MPW C? (As opposed to getting menus from a resource.) Has there been a MacTutor article on the diffs between LSC and MPW C, covering the difficulties in porting one to the other? (It sure turned out harder than I expected.) THANK GOD FOR COMP.SYS.MAC.PROGRAMMER! (I'll stop snivelling now.) ============================================================================== comes around Mike Schmelzer MJSCHMEL@PUCC.Princeton.Edu what goes around ==============================================================================