Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!dg!dg-rtp.dg.com!bkahn From: bkahn@dg-rtp.dg.com (Bruce Kahn) Newsgroups: comp.sys.apple2 Subject: Re: SFPutfile2 help request Message-ID: <852@dg.dg.com> Date: 27 Aug 90 21:08:26 GMT References: <4134@crash.cts.com> Sender: root@dg.dg.com Reply-To: bkahn@dg-rtp.dg.com (Bruce Kahn) Organization: Data General Corporation, Research Triangle Park, NC Lines: 33 In article <4134@crash.cts.com>, joshuat@pro-sol.cts.com (Joshua M. Thompson) writes: |> In-Reply-To: message from kgreen@pro-angmar.UUCP |> |> Are you giving Standard File the signal to allocate handles for you? If so, |> when the handles are returned to you in your reply rec, the first two bytes |> are the buffer length, followed by the actual class_1 string. So move the |> whole thing down two bytes in memory (starting at the +2 byte in the handle) |> and you'll have a normal class_1 string that can be passed to GS/OS. Dont forget to save the first 2 bytes first and then after you shift down the string 2 bytes, stuff a NULL into the location calculated by Start_of_String + value_from_1st_2_bytes This effectively converts a Pascal string to a C string... If you dont put the NULL in there, you MAY just walk past the end of the string you want right off into memory somewhere (or over something that comes after the end of the string in memory). Remember, C string functions mostly use the terminating NULL to signify End_of_String... -- Bruce (bkahn@archive.rtp.dg.com or kahn@adam.dg.com) Standard disclaimers apply, except where prohibited by law...