Hi Kai,
Taking a guess at what you might be doing with this, an approach like this
might be better...
template: make object! [ count: 0 ]
objs: []
append objs reduce [ 'a make template [] ]
append objs reduce [ 'b make template [] ]
append objs reduce [ 'c make template [] ]
That creates a block of word/object pairs which can then be accessed like
this...
>> objs/a/count
== 0
>> objs/b/count
== 0
>> objs/b/count: 2
== 2
>> objs/b/count
== 2
>> objs/a/count
== 0
It sounds like you're creating some kind of database, and there's a limit to
the number of words that REBOL can handle when they reference a value. (Others
can rephrase that more correctly...) There's no limit to the number of words
that can be stored in a block though. And being in a block, you'd be able to
sort them by name as well, if required. ie...
>> foreach [word object] objs [print word]
a
b
c
>> sort/reverse/skip objs 2
== [c make object! [
count: 0
] b make object! [
count: 2
] a make object! [
count: 0
]]
>> foreach [word object] objs [print word]
c
b
a
Oh, and the reason your...
probe first find objs a
seemed to work is it was looking in objs for the object referenced by 'a and
not for the word 'a. ie, this would fail...
probe first find objs 'a
Hope that helps.
-- Carl Read.
On Thursday, 28-May-2009 at 18:22:48 Kai Peters wrote,
>Thanks guys - here's another question:
>
>template: make object! [ count: 0 ]
>
>a: make template []
>b: make template []
>c: make template []
>
>objs: []
>append objs a
>append objs b
>append objs c
>
>probe objs
>
>[make object! [
> count: 0
> ] make object! [
> count: 0
> ] make object! [
> count: 0
> ]]
>=3D=3D [make object! [
> count: 0
> ] make object! [
> count: 0
> ] make object! [
> count: 0
> ]]
>>>
>
>Now I want to cycle though the objects in the objs block and print their =
>names:
>
>foreach obj obs [ print ???? ]
>
>I cannot seem to get at it - but find has no problems finding them by 'na=
>me'
>
>as in=20
>
>probe first find objs a
>
>
>TIA
>Kai
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.