Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!rex!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.sys.mac.programmer Subject: Re: Danger Will Robinson, traps for young player. Summary: pstrcpy() Message-ID: <1867@mountn.dec.com> Date: 21 Aug 90 14:25:22 GMT References: <11591@wehi.dn.mu.oz> <1990Aug20.033702.5883@cs.uow.edu.au> <1268.26d02745@waikato.ac.nz> <435@sun13.scri.fsu.edu> Reply-To: minow@bolt.enet.dec.com (Martin Minow) Organization: Digital Equipment Corporation Lines: 15 Here's a simple Pascal string copy: #define pstrcpy(dst, src) \ BlockMove((src), (dst), ((unsigned char *)(src))[0] + 1) Note that "src" may not have side-effects: "pstrcpy(dst, *foo++)" will fail. Writing a concatenator is a bit more difficult as you have to make sure you don't overflow the 255 byte limit. You'll find source for useful Pascal string functions in the Think C libraries (look in the Class library if you don't find anything in the normal library). Martin Minow minow@bolt.enet.dec.com