Hi Francois, you wrote:
> FormType: type
> if FormType = TEXT [print "TEXT"]
> if FormType = TEXTAREA [print "TextArea"]
>TEXT
>** Script Error: TEXTAREA has no value.
>** Where: if FormType = TEXTAREA [print "TextArea"]
REBOL is complaining that TEXTAREA is not a reference to some value. I.e.
there was never an assignment performed such that TEXTAREA is referencing
some value.
Either FormType references the literal word 'TEXT (or 'TEXTAREA), or
FormType references something, which is also being referenced by 'TEXT:
Case 1: FormType: 'TEXT (or FormType: 'TEXTAREA)
Case 2: FormType: 'some-type TEXT: 'some-type
If what you are doing is similar to case 1, use:
If FormType = 'TEXT (or if FormType = 'TEXTAREA). ==> Note the tick mark
that tells REBOL not to try to dereference TEXTAREA, i.e. not to look up
which value is referenced by TEXTAREA but instead to use it as literal value.
You could also do the following:
TEXT: 'TEXT
TEXTAREA: 'TEXTAREA
Now you can use TEXT and TEXTAREA as you do. REBOL will consider TEXTAREA a
word (as it does when it reports the error) and dereference it, returning
the literal word 'TEXTAREA against which FormType will be compared.
If you are doing something similar to case 2 make sure that TEXTAREA has
been assigned as a reference to whichever value it is supposed to represent.
Elan