[REBOL] Re: Troube Calling Function within Object
From: jelinem1:nationwide at: 28-Nov-2000 14:14
I followed your thought right up until:
table: "player"
Now, a whole bunch of scope-related questions pop up, and I don't see how
to give an answer without looking at the full script. Probably all you have
to do is convert the string "player" to a word, then bind it to the context
which you've defined 'player as the object.
Michael Jelinek
work: [jelinem1--nationwide--com]
home: [michael1356--home--com]
everquest: [matsumurak--home--com]
Jamey Cribbs <[cribbsj--oakwood--org]>@rebol.com on 11/28/2000 01:02:49 PM
From: Jamey Cribbs <[cribbsj--oakwood--org]>@rebol.com on 11/28/2000 01:02 PM
Please respond to [rebol-list--rebol--com]
Sent by: [rebol-bounce--rebol--com]
To: "Rebol List" <[rebol-list--rebol--com]>
cc:
Subject: [REBOL] Troube Calling Function within Object
I hope someone can help me with this one 'cause I have been wrestling with
it
for two days and I'm about to tear out what little hair I have left!
Let's say I have an object called player. Within that object I have
created
a function called find-records. find-records expects a block to be passed
to
it as an argument.
My problem is this: I want to call this function using the value of a
variable called table and return the value to a higher calling function.
So far, I have gotten this to work:
return player/find-records next request
(request is the block I want to pass, excluding the first value).
Now, let's say I do this:
table: "player"
How do I call the function now? I have tried about a million different
variations of:
return to-word to-path reduce [table 'find-records] next request
(I use return here because I am calling this line from a higher level
function and I want to return the value).
But nothing seems to work! Sometimes, it appears I was able to actually
call
the function within the object, but then the argument won't get passed.
Sometimes, I think I got the function to be called WITH the arguments, but
I
can't get the return value from the function to be returned by this line.
I have read and re-read the parts in the manual dealing with words,
functions, evalution, etc. and I just can't find what I am doing wrong.
I can email my script to anyone who needs to see it. I appreciate any help
that can be given.
Jamey Cribbs