Path: utzoo!attcan!uunet!samsung!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!jb10320 From: jb10320@uxa.cso.uiuc.edu (Desdinova) Newsgroups: comp.sys.apple2 Subject: Re: Q: Orca/C and p2cstr() Keywords: C, Orca/C Message-ID: <1990Oct5.154015.3147@ux1.cso.uiuc.edu> Date: 5 Oct 90 15:40:15 GMT References: <1020@dg.dg.com> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 38 In article <1020@dg.dg.com> bkahn@archive.webo.dg.com (Bruce Kahn) writes: > > Ive been trying to finalize some changes to a desktop program Im creating and >have found an oddity w/Orca/C (or so I think). After returning from a call >to SFGetFile(), I check replyPtr->good and if its TRUE, I attempt to open >the file in replyPtr->filename. Since Im writing in C and replyPtr->filename >is a Pascal string, I tried to use the following (w/SFReplyPtr replyPtr;): > > 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. > fp = fopen(p2cstr(&replyPtr->filename,"wb")); >but that also failed. > In my frustration, I dumped the output of p2cstr(replyPtr->filename) and >p2cstr(&replyPtr->filename) to a log file and got basically garbage or random >junk. I hacked my own p2cstr() for doing an in-place conversion and things >work just fine. Can anyone tell me why p2cstr didnt work for me or is there >a known bug w/p2cstr?? There's lots of known bugs in Orca/C, but I don't think this is one of them. I'll check my manual when I get home and make sure. > Bruce (bkahn@archive.webo.dg.com or > kahn@adam.dg.com) > Standard disclaimers apply, except where prohibited by law... -- 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!