[REBOL] Re: view indirection
From: rebol665:ifrance at: 21-Nov-2001 13:45
Hi Sterling
This is clean and elegant. Thanks to the rebol-list, I have now many ways to
perform the required task with style !
Thanks again
Patrick
----- Original Message -----
From: <[sterling--rebol--com]>
To: <[rebol-list--rebol--com]>
Sent: Tuesday, November 20, 2001 7:13 PM
Subject: [REBOL] Re: view indirection
> Here's another option:
> Make a list of the checkboxes either directly:
> checks: reduce [c1 c2 c3 c4 ...]
> or iteratively:
> checks: copy []
> repeat x 16 [append checks to-word join "c" x]
> reduce checks
>
> Now when you need to access one:
> set-check: func [n [integer!]] [
> checks/:n/data: true
> show checks/:n
> ]
>
> Or to just improve on what you've got below:
> set in wrd: get to-word join "c" n 'data true
> show wrd
>
> The only thing you really need to build dynamically is the word to
> reference the checkbox. The rest of the REBOL code can stay as REBOL
> code.
>
> Sterling
>
> > Hi,
> >
> > I am stuck in a should-not-be-so-difficult problem with view. I have a
lot of checkboxes in a layout, named c1, c2, ... c16. At one time, given a
number X, I would like to do something on the cX checkbox.
> >
> > For now, I have this sort of code :
> >
> > 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 :