Load the file syntaxedit.bet.
![[4kb 448x142 PNG] [4kb 448x142 PNG]](images/image036.png)
![[4kb 444x137 PNG] [4kb 444x137 PNG]](images/image038.png)
In the example above, the selection becomes the entire pattern.
Another example: Mark from the middle of one pattern to the middle of the next.
![[4kb 460x176 PNG] [4kb 460x176 PNG]](images/image041.png)
![[4kb 456x172 PNG] [4kb 456x172 PNG]](images/image043.png)
The tool selects both patterns.
Try marking different chunks of code and observe what is being selected. For example, try marking the following:
UnregisteredVehicle: Vehicle ...; 
![[4kb 385x132 PNG] [4kb 385x132 PNG]](images/image045.png)
Person: ... until aPerson: @person
![[8kb 405x326 PNG] [8kb 405x326 PNG]](images/image047.png)
 Person.print mark 'living at'->puttext
![[4kb 379x239 PNG] [4kb 379x239 PNG]](images/image049.png)
 Person.print mark the entire do-part
![[7kb 392x433 PNG] [7kb 392x433 PNG]](images/image051.png)
Experiment with the use of Alt+Up (overview), Alt+Left (abstract recursively), Alt+Right (detail) and Alt+Down (detail recursively).
| Command | Keyboard shortcut | 
| cut copy paste undo redo | Ctrl+X Ctrl+C Ctrl+V Ctrl+Z Ctrl+Y | 
Now we want to move the Person pattern down to aPerson: @person:
![[9kb 414x444 PNG] [9kb 414x444 PNG]](images/image053.png)
![[9kb 414x444 PNG] [9kb 414x444 PNG]](images/image055.png)
![[9kb 414x444 PNG] [9kb 414x444 PNG]](images/image057.png)
![[9kb 414x444 PNG] [9kb 414x444 PNG]](images/image059.png)
![[9kb 414x444 PNG] [9kb 414x444 PNG]](images/image061.png)
Now try undoing it all using Ctrl+Z.
Notice that the Person pattern could have been thousands of lines of code, and it would still be very simple to move it around or copy it.
You can apply this to all sorts of other code fragments: imperatives, descriptors, do-parts, enter-parts, exit-parts, variabels, superpattern-prefixes. But it does take a little practice to be able to use it efficiently.
| Mjolner Tool Workshop | © 2001-2002 Mjølner Informatics | [Modified: Wednesday September 12th 2001 at 17:10]
 |