| Tom Leylan 2007-05-04, 6:55 pm |
| Hi Albert uhh, Franz :-)
Codeblocks are also known as "anonymous methods" which my definition means
they have no name. So the answer is "no". As Steve Quinn points out
however you can simply agree on what the identifer will be and so long as
everybody abides by the rules that's it's "name." Again as Steve's example
demonstrates you can pass the name along as a parameter.
The other side of the argument is "why would you want to know the name?".
The whole point behind codeblocks is that the code is passed to a routine
that needs to execute it. It shouldn't really be trying to decide what to
do but rather should simply EVAL the codeblock it was handed.
I don't have a direct link but if you drop by: http://www.leylan.com/ and
select the Clipper link and then the "They're Code Blocks" link it will
bring you to an article I wrote in an earlier century on the subject.
Perhaps it can help.
Tom
"albert" <alberto.pecchioni@inwind.it> wrote...
> It's possible to know a name of a codeblock ?
>
> Example:
>
> Codeblock1 : = {|| ..........}
> Codeblock2 := {||................................}
>
> Test(codeblock1)
>
> Test(codeblock2)
>
>
> Function test (cblock)
>
> If cblock = "codeblock1" ?????? <-------- How to know the name ?????
> .........
> Endif
>
> Franz
|