Path: utzoo!utdoe!generic!pnet91!ericmcg From: ericmcg@pnet91.cts.com (Eric Mcgillicuddy) Newsgroups: comp.sys.apple2 Subject: Re: GS/OS Strings in Orca/C? How? Message-ID: <379@generic.UUCP> Date: 13 Jan 91 21:50:05 GMT Sender: root@generic.UUCP Organization: People-Net [pnet91], Etobicoke, ON Lines: 28 >Can anyone tell me how to properly put GS/OS class 1 strings into Orca/C >programs? I have the GS/OS Ref, which says next to nothing about using C >with GS/OS, and the Orca/C manual says something to the effect that since >C provides file access functions using the stdio.h library, it shouldn't be >necessary to use GS/OS. Hah. Well I want to anyways. > Jerry Penner alberta!bode!jpenne Edmonton, Alberta, Canada Create a structure called GSstring and put the length word in the length. struct GSstring { int length; char string[255]; /* or whatever buffer size you need */ }; Use Orca/C's strpos( string, "/0") to return the length and plunk that into the length element and use strcpy (string1, string2) to copy the string into the structure. (This is off the top of my head,so I do not have the correct syntax to copy to a structure with strcpy. I leave this as an excersize for the class to complete at home. :) Orca/C has a function called c2pstr that converts a C string to a Pascal string, but the length is only 1 byte long, GSOS requires 2 bytes. Perhaps when you have it working you could post it here under the name "c2GSstr". UUCP: bkj386!pnet91!ericmcg INET: ericmcg@pnet91.cts.com