Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!uunet!dg!dg-rtp.dg.com!bkahn From: bkahn@archive.webo.dg.com (Bruce Kahn) Newsgroups: comp.sys.apple2 Subject: Re: Q: Orca/C and p2cstr() Keywords: C, Orca/C Message-ID: <1032@dg.dg.com> Date: 8 Oct 90 14:36:31 GMT References: <1020@dg.dg.com> <1990Oct5.154015.3147@ux1.cso.uiuc.edu> Sender: root@dg.dg.com Reply-To: bkahn@archive.webo.dg.com (Bruce Kahn) Organization: Data General Corporation, Westboro, MA Lines: 50 In article <1990Oct5.154015.3147@ux1.cso.uiuc.edu>, jb10320@uxa.cso.uiuc.edu (Desdinova) writes: |> In article <1020@dg.dg.com> bkahn@archive.webo.dg.com (Bruce Kahn) writes: |> > fp = fopen(p2cstr(replyPtr->filename,"wb")); |> >but that didnt work. I then tried: |> |> No doubt. I don't believe the Orca "p2cstr" works with Class 1 GS/OS |> strings. I imagine it works only with 1-byte length Pascal-type strings. The routine I used to do my in-place conversion was: int nameLen; nameLen = replyPtr->filename[0]; for (loop = 0; loop < nameLen; loop++) replyPtr->filename[loop] = replyPtr->filename[loop+1]; replyPtr->filename[nameLen] = 0; Since characters are 1 byte, my routine also assumes a 1-byte length Pascal-type string. Since Pascal type strings can be a max of 255 characters long, they should only be prefixed by a 1 byte length value. Of course, things may have changed since I took Pascal in college 3 years ago... :) For my gratification (I dont have my manuals here), what are the various classes of GS/OS strings? Or better still, which manual should I check out to see the actual Apple definitions? |> -- |> Jawaid Bazyar | Blondes in big black cars look better wearing |> Senior/Computer Engineering | their dark sunglasses at night. (unk. wierdo) |> jb10320@uxa.cso.uiuc.edu | The gin, the gin, glows in the Dark! |> | (B O'Cult) |> Apple II Users Unite! Storm the New Product Announcement and Demand Justice! -- Bruce (bkahn@archive.webo.dg.com or kahn@adam.dg.com) Standard disclaimers apply, except where prohibited by law...