Article View: aus.stats.s
Article #16129Re: How do you use call_S with character data
From: Gary Houston
Date: Thu, 16 Jan 1992 20:59
Date: Thu, 16 Jan 1992 20:59
19 lines
1346 bytes
1346 bytes
Thanks to todd%statsci@uunet.UU.NET (Todd Cromwell) for a solution
to my call_S problem. The answer was to use the following:
static char *myarg[] = {"testing", "nexttest"};
arguments[0] = /*"testing"*/(char *)myarg;
modes[0] = "character";
lengths[0] = (sizeof(myarg)/sizeof(myarg[0]));
call_S(func,1L,arguments,modes,lengths,0,1L,junk);
i.e., arguments must be a "pointer to character array"
rather than "pointer to character string", although both
are **char.
This is a nice feature; I can use the fscanf function in C to
read a weird dataset, then assign it to an S object within
the call to S using assign(). This looks to be more flexible
and efficient than using the list returns from .C
Technical Details
Message-ID:
<9201161958.AA00546@wright.stats.govt.nz>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!manuel!sserve!usage!metro!dmssyd.syd.dms.CSIRO.AU!newsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa931,6220107d9bfb9e4b X-Google-Attributes: gidfa931,public X-Google-ArrivalTime: 1992-01-16 17:06:02 PST Newsgroups: aus.stats.s Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!manuel!sserve!usage!metro!dmssyd.syd.dms.CSIRO.AU!news From: Gary Houston <ghouston@stats.govt.nz> Subject: Re: How do you use call_S with character data Message-ID: <9201161958.AA00546@wright.stats.govt.nz> X-Gateway: dmssyd.syd.dms.CSIRO.AU Lines: 22 Sender: daemon@syd.dms.CSIRO.AU Organization: CSIRO Div. Maths & Stats, CSIRO Div. Applied Physics Date: Thu, 16 Jan 1992 20:59:41 GMT