[Next] [Previous] [Up] [Top] [Contents] [Index]
Lisp-based editing
Matching delimiters
When the cursor is placed next to an expression delimiter such as a double-quote or a parenthesis, Fred will blink the matching delimiter, showing you the extent of the expression.
- Place the cursor next to the closing double-quote of the string entered in the Fred window.
Notice that the matching double-quote blinks.
- Add the following code to the Fred window, below the string.
(get-string-from-user
"Please type in your name.")
Notice that when the cursor is at the closing parenthesis, the opening parenthesis blinks. If you move the cursor to the opening parenthesis, the closing one will blink.
You can navigate by expression using a number of different Fred commands. For example, pressing Control LeftArrow will move you to the left by one Lisp expression; pressing Control RightArrow will move you to the right by one Lisp expression.
- Place the cursor at the end of the buffer, and press Control LeftArrow twice.
The cursor should now be at the beginning of the buffer.
You can select an entire expression by double-clicking on one of the delimiters of the expression, or by pressing Control-Option Space when the cursor is next to one of the delimiters of an expression.
- Position the cursor over the closing parenthesis and double-click.
The entire expression is highlighted. If this were an expression within another expression, only the inner expression would be highlighted.
- Execute the selected expression by choosing "Execute Selection" or pressing Enter.
MCL executes the expression. The function get-string-from-user displays a dialog box with the specified prompt.
Figure 2-5 Executing an expression from a Fred window

- Type your name in the highlighted box and press Return.
MCL returns your name as a string in the Listener window. This string is the result of the call to get-string-from-user.
Gettmg Started with MCL - 19 OCT 1996
[Next] [Previous] [Up] [Top] [Contents] [Index]
Generated with Harlequin WebMaker