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.