Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Accesing struct! after routine! exec

From: jvargas:whywire at: 3-Jun-2003 10:37

On Monday, June 2, 2003, at 09:54 PM, Volker Nitsch wrote:
> Trying to remember c, > the rebol-definition means > > struct utsname { > char * sysname; > /* Name of this OS. */ > char * nodename; > /* Name of this network node. */ > char * release; > /* Release level. */ > char * version; > /* Version level. */ > char * machine; > /* Hardware type. */ > }; > > which means a struct with pointers. > while the c-defenition is a struct with char-arrays. > > if i am right, eventually this works: > > string: insert/dup "" " " 5 * SYS_NMLN ; make a filled string > sysname: string > nodename: skip string SYS_NMLN > release: skip nodename SYS_NMLN > ... > and pass the string as argument. > > sysname: copy/part sysname find sysname #"^(null)" > to get it back. > > -Volker
Thanks Volker, It worked like a charm. Is there any other way to do it using struct! ? I like it because the code is more compact and explicit. However, I will use your trick in the meantime. Cheers, Jaime