Hi Raimund

You are close.  The problem is the items in my-serie are words, not the
values (objects, in this case) to which the words refer.

Try

this-book: get first my-serie
print this-book/info

The GET will dereference the word 'book1, returning the object itself.

If you want the serie to contain the actual objects, you can do this

my-serie: reduce [book1 book2]

then your original access code works

this-book: first my-serie
print this-book/info

HTH

-Larry

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 13, 2000 2:58 PM
Subject: [REBOL] problems with series of objects


>
>
> Hi,
>
> I try to have a series of self defined objects and pick one of the objects
to
> access it.
>
> Here is the code I use:
>
> REBOL []
>
> book: make object! [
> author:
>     title:
>     info: none
> ]
>
> book1: make book []
> book1/author: "Fritz the Cat"
> book1/title: "That is the title of book1"
> book1/info: "That is info of book1"
>
> book2: make book []
> book2/author: "Fritz the Cat"
> book2/title: "That is the title of book2"
> book2/info: "That is info of book2"
>
> my-serie: [book1 book2]
> this-book: make book []
>
> this-book: first my-serie
>
>
> print this-book/info
>
>
>
>
> And here comes the output:
>
> raimund@linux:~/Development/rebol/Tests > rebol
> REBOL/View 0.9.9.4.2 1-Jun-2000
> Copyright 2000 REBOL Technologies.  All rights reserved.
> Type DEMO to run demo if it is disabled
> >> do %test_objects.r
> ** Script Error: Cannot use path on word! value.
> ** Where: print this-book/info
> >>
>
>
>
> How can I access the info from this-book? I can make an assignment like
> this-book/info: "This book info" but I can not print it??
>
> Can anyone help me on that??
>
> Thanx
>
> Raimund
>  --
> <--------------------------------------------->
> 42 war schon immer einge gute Antwort;-))

Reply via email to