Path: utzoo!attcan!uunet!seismo!ukma!rex!samsung!zaphod.mps.ohio-state.edu!uwm.edu!srcsip!jhereg!orbit!marilyn!shawn From: shawn@marilyn.UUCP (Shawn P. Stanley) Newsgroups: comp.sys.apple2 Subject: Re: GSOS Strings vs. Pascal Strings: Help! Message-ID: <42@marilyn.UUCP> Date: 6 Jun 90 23:18:41 GMT References: <57874@bu.edu.bu.edu> Reply-To: shawn@marilyn.marilyn.mn.org (Shawn P. Stanley) Distribution: comp.sys.apple2 Organization: Litfal Lines: 17 In article <57874@bu.edu.bu.edu> ghost@bucsf.UUCP (Jay Adelson) writes: >I know the difference of the two strings (that is, what makes them >incompatible..) and I'm looking for some way to convert from one to the >other... No problem. Since GS/OS strings start with a length word, and Pascal strings start with a length byte, to convert from one to the other, all you have to do is skip the second byte in the length. (As long as the string is 255 characters or less!) If you want to use the same string buffer for the conversion, either move the first byte of the length into the second byte's location and then reference the string starting from the second byte for Pascal usage, or copy the string characters byte-by-byte backward one character. -- Shawn P. Stanley shawn@marilyn.marilyn.mn.org bungia!marilyn!shawn {rosevax,crash}!orbit!marilyn!shawn