The Revolution will be programmed, Part III

16.10.2009

on mouseUp answer "Go where?" with "Backward" or "Forward" if it is "Backward" then go back else go next end mouseUp

Revolution has some interesting language features of which "chunking" is one of the most powerful. Chunking provides an easily specified and understandable way of breaking text into sections. Revolution's chunking lets you extract or edit a character, word, line, item or tokens.

The first three chunk types are obvious. Items are defined by being delimited by any character you specify, while token chunks are delimited by any of a range of punctuation marks (these are useful for parsing things like scripts and URLs). Here's an example of extracting a word chunk consisting of the first three words from a user interface text field:

put word 1 to 3 of field "text" into myVariable

Revolution also has some features that make designing user interfaces remarkably easy. One of these is the geometry manager, which specifies how objects should be scaled and positioned when a user resizes a window. This is a really clever feature because it provides a practical methodology for maintaining the user experience at varying screen resolutions.