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

[REBOL] Re: How to send big string to library and back?

From: petr:krenzelok:trz:cz at: 16-Apr-2001 11:13

----- Original Message ----- From: "Andrew Martin" <[Al--Bri--xtra--co--nz]> To: <[rebol-list--rebol--com]> Sent: Monday, April 16, 2001 10:29 AM Subject: [REBOL] Re: How to send big string to library and back?
> > Is string sent to library interface being automatically ended once "0" > char appears in it? (and vice versa - the same for string returning from > library interface to Rebol?) > > Don't know for sure. I believe so, based on earlier information on Ally > list. Example, was passing rebol strings to Windows message box, IIRC. The > example script had no special problem with zero terminators, 'cause Rebol > automatically put them in. > > > how should I put Rebol string datatype into array of unsigned values? > > I don't know where Rebol, the camera port and the C program fit in all
> Is it like: > > Camera -> Serial Port -> Rebol Script -> C program/library
Camera -> Embedded Ethernet (TCP/IP) -> REBOL Script -> C library I know exact size of image of course, so I also know certain size of string. Maybe I just can't express myself correctly, so I will try once again: I expect Rebol to put zero terminator at the end of the string, but let me show a small example: 1) image-data: "abcdefg" rebol-2-library: "abcdefg0" ;OK 2) image-data: "abc0defg" ; note "0" char as valid pixel value! a) rebol-2-library: "abc0defg0" ;OK b) rebol-2-library: "abc0" ; wrong - Rebol found 0 char inside fo script and cuts the rest of image data ... So, what will Rebol do? a) or b) ? Excuse my lame questions, I am no C coder :-) Thanks, -pekr-