home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14678 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.5 KB  |  37 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
  3. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  4. Subject: Re: Comparing strings 'n stuff...
  5. In-Reply-To: chuck@gte.com's message of 28 Aug 92 16:42:01 GMT
  6. Message-ID: <D88-JWA.92Aug28200534@dront.nada.kth.se>
  7. Followup-To: comp.sys.mac.programmer
  8. Originator: d88-jwa@dront.nada.kth.se
  9. Sender: usenet@kth.se (Usenet)
  10. Nntp-Posting-Host: dront.nada.kth.se
  11. Organization: Royal Institute of Technology, Stockholm, Sweden
  12. References: <1992Aug28.134804.9876@sun1x.actc.res.utc.com>
  13.     <chuck-280892124136@choffman.gte.com>
  14. Date: Fri, 28 Aug 1992 19:05:34 GMT
  15. Lines: 20
  16.  
  17. > chuck@gte.com (Chuck Hoffman) writes:
  18.  
  19.    > I am trying to compare a Str255 with a String which exists
  20.    > in my resource file.  I have loaded it in, but I am at a loss
  21.    > as to what to do to compare these two strings to see if they
  22.  
  23.    If you are using THINK C, there are two routines for converting between
  24.    strings of Pascal format (with length byte at the beginning) and C format
  25.    (with null character at the end).  They are "PtoCstr" and "CtoPstr".  If
  26.    you get both strings into C format, then you can use the C library routine
  27.    "strncmp" to compare them, even if they are of dissimilar length.
  28.  
  29. And of course lose any credibility outside of the U.S.
  30.  
  31. Use IUEqualString, IUCompString and IUMagIDString
  32.  
  33. -- 
  34. Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069
  35. White, Literate, Employed, Higher-educated, Male and Not Poor.
  36. Can I be a good guy nevertheless?
  37.