Thanks Ingo

Another great answer from the rebol-list. I have just tested it. However
trying to understand more, I crash my windows with a probe. Here is my code.
The probe thing is in the guru-function.

Thanks again


Rebol []

guru-function: func [ s [string!] n [integer!] /local mc][
 mc: get to-word join s n
 ; print probe mc <-- freeze my windows 2000
 mc/data: true
 show mc
]

view center-face layout [
 banner "Test"

 c1: check
 c2: check
 c3: check
 c4: check

 button "Test" [guru-function "c" 3]
 button "that's all folks !" [unview]
]



----- Original Message -----
From: "Ingo Hohmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 20, 2001 7:43 PM
Subject: [REBOL] Re: view indirection


> Hi Patrick,
>
> Once upon a time Patrick Philipot spoketh thus:
> > set-check: func [n [integer!] /local code ][
> >  code: copy ""
> >  code: join join "set in c" n join " 'data true show c" n
> >  print ["generated code ; " code]
> >  do code
> > ]
> >
> > IT IS WORKING ! (the print is only for debugging purpose). However I am
not satisfied with this code. I'am looking for a more elegant way to do
that. Something like :
> >
> > myCheckBox: guru-function( "c" 5)
> > myCheckbox/data: true
>
> how about that one?
>
>   >> c1: make object! [data: none]
>   >> probe c1
>
>   make object! [
>     data: none
>   ]
>   >> guru-function: func [ s [string!] n [integer!]][
>   [       get to-word join s n
>   [    ]
>   >> mc: guru-function "c" 1
>   >> mc/data: "yup"
>   == "yup"
>   >> probe c1
>
>   make object! [
>     data: "yup"
>   ]
>
> And how 'guru-function works:
> 'join the string (s) and the integer (n)
> make a word out of it
> and get what you find under that word (without the 'get
> it would only return the name of the word 'c1, namely a
> word c1. With 'get, it returns the object!, c1 points too).
>
>
> I hope that helps
>
>
> Ingo
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to