Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!kth.se!draken!d88-jwa From: d88-jwa@nada.kth.se (Jon Watte) Newsgroups: comp.sys.mac.programmer Subject: Re: List Manager Strangeness Message-ID: <3039@draken.nada.kth.se> Date: 28 Feb 90 11:01:04 GMT References: <20392@bellcore.bellcore.com> <10841@bsu-cs.bsu.edu> Reply-To: d88-jwa@nada.kth.se (Jon W{tte) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 34 In article <10841@bsu-cs.bsu.edu> mithomas@bsu-cs.UUCP (Michael Thomas Niehaus) writes: >The following code is extracted from one of my programs. Basically, it Did it work ( the program ) ? > strcpy(&theText,"Helvitica"); > LGetCell(&listText,&dataLen,theCell,localList); > listText[dataLen] = 0; > if ( strcmp(&theText,&listText) == 0) listText is declared as char *, right ? So when you do LGetCell, you get a char pointer, and you dereference it with offset dataLen. The problem is, why do you send the address of this pointer to strcmp ? And, if theText is a pointer as well, you're not doing the right thing (in fact, you cannot take the address of an array in C...) or am i riding alone in never-never land again ? >Be careful that either both strings are C strings, or both are Pascal strings. >If they are C strings, make sure they are null-terminated. And if they are pascal strings, of course you cannot use strcmp() Best thing to do is using EqualString (you'll have to convert C strings to pascal things, of course) with diacritical sensitivity to TRUE and case sensitivity to FALSE (Note: In sweden, the A and O with dots over them come at the end of the alphabet, so the SFGetFile that places OE right after O is very disturbing. Apple; take note !) h+ -- --- Stay alert ! - Trust no one ! - Keep your laser handy ! --- h+@nada.kth.se == h+@proxxi.se == Jon Watte longer .sig available on request