Getting content from objects in a block
[1/4] from: moeller_thorsten:gmx at: 31-Jul-2001 15:46
Hi,
i have a block containing lots of objects. What i want to do is getting the
text-value from each of this objects with a loop. One object can be accessed
like "print myblock/1/text". The "1" should be replaced by a counter.
How can i do that?
Thorsten
[2/4] from: chris:starforge:demon at: 31-Jul-2001 14:56
Thorsten Moeller wrote:
> text-value from each of this objects with a loop. One object can be accessed
> like "print myblock/1/text". The "1" should be replaced by a counter.
>
> How can i do that?
A naive way off the top of my head:
obj: pick myblock counter
print obj/text
probably some way to combine though lines though
Chris
--
.------{ http://www.starforge.co.uk }-----. .--------------------------.
=[ Explorer2260, Designer and Coder \=\ P: TexMaker, ROACH, site \
=[___You_will_obey_your_corporate_masters___]==[ Stack: EETmTmTRRSS------ ]
[3/4] from: dockimbel:free at: 31-Jul-2001 16:04
Hi Thorsten,
If i understand your question correctly, this is how to do it :
foreach obj myblock [print obj/text] ; no counter version
or
repeat i length? myblock [print myblock/:i/text] ; counter version
HTH,
DocKimbel.
Thorsten Moeller wrote:
[4/4] from: tim::johnsons-web::com at: 31-Jul-2001 9:51
Hi Thorsten:
You could try something like the 'get opertor example below until
a wiser head responds:
On Tue, Jul 31, 2001 at 03:46:40PM +0200, Thorsten Moeller wrote:
>
> Hi,
>
> i have a block containing lots of objects. What i want to do is getting the
> text-value from each of this objects with a loop. One object can be accessed
> like "print myblock/1/text". The "1" should be replaced by a counter.
>
> How can i do that?
>> test: [[10 20 30 40][50 60 70 80]]
== [[10 20 30 40] [50 60 70 80]]
>> g: 2
== 2
>> test/:g/1 ; note the use of the 'get operator
== 50
> Thorsten
>
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.johnsons-web.com