Using Forward

Bob Smith (wdesign@OZONLINE.COM.AU) writes:

> I notice that some people use the forward command directly after the
> handler and others put it just before the end statement. Does the
> positioning matter or is this just personal preference

Where you put it depends entirely on how you want things to work. When you forward a message, it is at that point in your script that any functionality cause by the forwarding occurs. For example, say I have the following in my book script:

    to handle leavePage
        sysLockScreen = TRUE
    end

    to handle enterPage
        sysLockScreen = FALSE
        get flushMessageQueue()
    end
I often use this to hide any changes I might be doing between pages (and to flush the message queue when you come into a new page). In a particular page script, you'd have something like this:

    to handle enterPage
        -- do things here that you don't want the user to see happenning
        forward
        -- do things here that you want the user to see
    end

    to handle leavePage
        -- do things here that you want the user to see
        forward
        -- do things here that you don't want the user to see happenning
    end
I hope this helps clarify things.

Tim.

 ---------------------------------------------------------------------------
Tim Barham
tbarham@vcrpmap.telecom.com.au
 ---------------------------------------------------------------------------
Brian Parkhurst
University of Washington
Box 357260
Seattle, WA 98195-7260
206/543-9175