[REBOL] Re: explanation, gurus? :-) (image memory representation)
From: petr:krenzelok:trz:cz at: 21-Aug-2001 18:36
----- Original Message -----
From: "Frank Sievertsen" <[fsievert--uos--de]>
To: <[rebol-list--rebol--com]>
Sent: Tuesday, August 21, 2001 5:59 PM
Subject: [REBOL] Re: explanation, gurus? :-) (image memory representation)
> > > It would be great if more Rebol types were supported by the
> > > /library interface. (Image! should be my first choice!).
>
> I had this problem before and have a sollution. You can create an string!
> out of the image! which uses the same memory-area.
>
> Example:
>
> >> im: make image! 10x10
> == make image! [10x10 #{
> 000000000000000000000000000000000000000000000000000000000000
> 000000000000000000000000000000000000000000000...
> >> parse im [str:]
heh, hey, cool, how did you found out? :-) Much simpler than:
->> str: find mold image "#"
== "#{000000}]"
->> remove back tail str
== ""
->> str: to-string load str
== "^@^@^@"
OK, thanks for the advice ...
-pekr-
> == false
> >> str
> >
{^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
@^@^@^@^@^@^@^@^@^@
> ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^...
> >> change str "hello"
> >
{^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
@^@^@^@^@^@^@^@^@^@