Now you can see clearly what is wrong.
Your code is asking if a block is none.
A block is never none.
You could make it better by removing the enclosing brackets:
if not none? select grp tc [ ...
As Carl has pointed out below, that simplifies further.
You can think of the square brackets as "protecting"
their contents. The value of a block is just a block...
You must do something with the block before you will
get a value out of it. Either reduce it or do it or
pick a value out of it. You can put totally buggy code
into a block, and it won't cause a error until you try
to reduce that block or that bit of buggy code.
eg. This is a valid block:
[aaksjdfhkjdfhalkdhfweioraweriuwer]
Now I read your original post I think you want this:
if find grp tc [
print rejoin [ tc "-" first grp ]
]
Anton.
> Simply, change:
>
> if not none? [ select grp tc ] [
> print rejoin [ tc "-" first grp ]
> ]
>
> To:
>
> if select grp tc [
> print rejoin [ tc "-" first grp ]
> ]
>
> -Carl
>
> At 4/18/02 10:56 PM +0200, you wrote:
> >I want the first element to be printed only if the value if tc
> is found in the block, therefore if tc = 05 it should print
> tcgrp01, if 06 prints tcgrp01, if 02 prints tcgrp02.
> >
> >If not found nothing should print.
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.