THE META-HTML LANGUAGE REFERENCE MANUAL

[TOC]

Manual Page Viewer

Name: VAR-CASE

Section: Flow Control


Synopsis:

    <var-case &optional [NAME=VALUE] [CONSEQUENT...] [DEFAULT] [DEFAULT-CONSEQUENT]

Description:

    For each NAME=VALUE pair, the value of NAME is string-wise compared with VALUE. If they are identical, then the corresponding CONSEQUENT code is performed, and its value is the return value of the <var-case> form.

    If none of the clauses match, and there is a default clause, then the DEFAULT-CONSEQUENT is evaluated, and its return value is the return value of the <var-case> form.

    var-case is especially useful as a `traffic switch' to select one of several actions based on a user button press.

    For example:

    <var-case
       action="Save Files"      <save-files <get-var posted::files[]>>
       action="Delete Files"    <delete-files <get-var posted::files[]>>
       action="Rename Files"    <redirect
                                     rename-files.mhtml?<cgi-encode files>>>

Edit Pointer
Function Index
Variable Index
Variable Editor


The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox
Found a bug? Send mail to bug-manual@metahtml.org