|
|
Section Intro: Relational Operators
Relational OperatorsSynopsis:
Relational operators in Meta-HTML return information about the
relationship between two items. There are three logical operators,
There are several other operators which compare numeric values; the section Arithmetic Operators cover those in detail. Commands:
Examples: <and> ==> true <and this that> ==> that <unset-var foo> <and <get-var foo> this> ==> <and this <get-var foo>> ==> <set-var foo=bar> <and this long list <get-var foo>> ==> bar <and> could have been defined in Meta-HTML as follows: <define-tag and &unevalled &rest expressions[] whitespace=delete>
<set-var result=true>
<foreach :expr expressions>
<set-var result = <get-var-eval :expr>>
<if <not <get-var-once result>>
<break>>
</foreach>
<get-var-once result>
</define-tag>
BODY is evaluated. If the result is the empty string, then the string "true" is returned, otherwise nothing is returned. BODY is simply the entire contents of the simple tag, with the word "not" in it. Thus, in typical usage one might write: <when <not <get-var foo>>> Hey! You didn't set the variable FOO. </when>
Examples: <or> ==> <or this that> ==> this <unset-var foo> <or <get-var foo> this> ==> this <or this <get-var foo>> ==> this <set-var foo=bar> <or <get-var foo> this> ==> bar <or> could have been defined in Meta-HTML as follows: <define-tag or &unevalled &rest expressions[] whitespace=delete>
<foreach :expr expressions>
<set-var result = <get-var-eval :expr>>
<if <get-var-once result>
<break>>
</foreach>
<get-var-once result>
</define-tag>
Edit Section
![]() The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox Found a bug? Send mail to bug-manual@metahtml.org |