next up previous contents
Next: Interpage dependencies Up: The InitChange, ShowPage and PageEnd Previous: Use of the Init function

Use of the PageEnd function

  As described above, the page PageEnd function is used to force some kind of constraint on a page, which can not be made in the Change function. Here's an example:

  proc AutoModes {} {
    # Errors
    Desc "This is a demo of error handling."
    Entry rexp -text "rexp" \
       -help "regular expression, which start a specific mode"
    Entry mode -text "Mode" -help "mode to start"
    ExtEntry autoModes -entries rexp mode -text "auto-mode-alist" \
    -help "Here you can specify a mode to start, if its filename matches"\
    "the given regular expression"

    PageEnd {
      set line 0
      forevery autoModes {
        incr line
        if {$rexp == "" && $mode == ""} continue
        if {$rexp == "" || $mode == ""} {
          error "Either the rexp or the mode was blank in line $line"
        }
      }
    }
  }

In this example both or neiter of the elment rexp and mode shall contain data.



Jesper Kjær Pedersen <blackie@imada.ou.dk>
Wed Oct 2 13:29:53 MET DST 1996