Difference between revisions of "Reference 1"

From PowerMops
Jump to: navigation, search
 
m (header wikifications)
Line 13: Line 13:
 
{| summary="Menu items" cellpadding="6"
 
{| summary="Menu items" cellpadding="6"
 
| colspan="2" |
 
| colspan="2" |
[#AppleMenu The Apple Menu]
+
=== The Apple Menu ===
 
|-
 
|-
 
| About Mops…
 
| About Mops…
Line 19: Line 19:
 
|-
 
|-
 
| colspan="2" |
 
| colspan="2" |
[#FileMenu The File Menu]
+
=== The File Menu ===
 
|-
 
|-
 
| Load…
 
| Load…
Line 34: Line 34:
 
|-
 
|-
 
| colspan="2" |
 
| colspan="2" |
[#EditMenu The Edit Menu]
+
=== The Edit Menu ===
 
|-
 
|-
 
| Cut, Copy, Paste, Clear and Select All
 
| Cut, Copy, Paste, Clear and Select All
Line 40: Line 40:
 
|-
 
|-
 
| colspan="2" |
 
| colspan="2" |
[#ListMenu The List Menu]
+
=== The List Menu ===
 
|-
 
|-
 
| Words
 
| Words
Line 52: Line 52:
 
|-
 
|-
 
| colspan="2" |
 
| colspan="2" |
[#ShowMenu The Show Menu]
+
=== The Show Menu ===
 
|-
 
|-
 
| HFS Paths
 
| HFS Paths
Line 70: Line 70:
 
|-
 
|-
 
| colspan="2" |
 
| colspan="2" |
[#UtilitiesMenu The Utilities Menu]
+
=== The Utilities Menu ===
 
|-
 
|-
 
| Echo During Load
 
| Echo During Load
Line 88: Line 88:
 
|}
 
|}
  
[#Communication Communication with QuickEdit]
+
== Communication with QuickEdit ==
  
 
Mops and QuickEdit send [http://developer.apple.com/documentation/mac/IAC/IAC-94.html Apple Events] to each other, with a number of benefits. Of course, to use these features, both Mops and QE must be running. If this isn't so, or if you're running an earlier system which doesn't support Apple events, these commands will be ignored.
 
Mops and QuickEdit send [http://developer.apple.com/documentation/mac/IAC/IAC-94.html Apple Events] to each other, with a number of benefits. Of course, to use these features, both Mops and QE must be running. If this isn't so, or if you're running an earlier system which doesn't support Apple events, these commands will be ignored.

Revision as of 02:18, 16 January 2006


Mops and QuickEdit

The Mops Menu Bar

Mops has a simple set of menus, yet the features built into them make writing code, compiling, and debugging rather easy. When you start Mops.dic, a specially designed Mops ˜front end' brings in the basic Mops menus”Apple, File, Edit, Utilities, and Mops.

To help you understand the functions of each menu selection, we'll describe the action of each menu item. We'll also explain the built-in utilities, which can make you more productive in program creation and debugging. Also see Part II, Chapter 2 for more details on the operation of an Editor.

The Apple Menu

About Mops… Displays the Mops version number and the date that version was released.

The File Menu

Load… Allows you to load text source files on top of the Mops dictionary currently in memory (the same as issuing the ˜// filename' command from the Mops prompt). The standard file dialog box appears, from which you can select the file to load. As the source file loads, it is compiled by Mops. If your program requires the loading of several text files, the files must be loaded in the proper order (so that dependent words and classes are loaded after the words or classes they depend on). The word NEED, which we described in the Tutorial, makes it easy to ensure everything is loaded in the right order.
Save Dictionary Copies to a disk a compiled image of a program you have in memory. It saves the image to a file with the same filename as is shown at the top of the Mops window. For this reason, Save should be used with care. If you have added code to Mops.dic and wish to save the image as a separate application, then use the Save As… selection, below; otherwise, your Mops.dic file will contain your additions.
Save Dictionary As… Lets you copy to a disk a compiled image of a program you have in memory (you are prompted for a new filename, and you may save to a different disk, if you like). For example, when Mops.dic was originally built, its compiled image was saved with this command. To start a program saved in this manner, double-click the appropriate Mops document icon from the desktop, just as you start Mops.dic. It is recommended that you save programs in this manner only after their source code has been sufficiently debugged. Until then, you'll want to take advantage of the interactivity of the Mops interpreter while debugging source files by maintaining the code as source files and Loading them to test how well the program runs.
Quit This is the equivalent of the Mops command, ˜bye'. All files are immediately closed, and you are returned to the desktop.

The Edit Menu

Cut, Copy, Paste, Clear and Select All These perform all the customary editing functions in the Mops window.

The List Menu

Words Presents a running list of all words in the current dictionary, starting with the word most recently defined (i.e., highest in memory). The name field of each dictionary entry is displayed along with the hex address of the name field. To pause the list, press any key once. To restart the list, press the Spacebar; to cancel the list display, press any key other than the Spacebar.
Objects… This is not yet implemented in Mops. Eventually it will present a dialog box from which you select the class in memory whose objects you wish to see listed.
Classes… This is also not yet implemented. It will present a list of all classes defined in the current dictionary in memory. The classes will be arranged hierarchically so you can see the inheritance chains of all classes in the dictionary.

The Show Menu

HFS Paths Displays in the Mops window the current paths which will be searched when you ask Mops to open a file.
Free Space

Displays in the Mops window the amount of memory available for new dictionary entries, as well as the condition of the heap. The Total heap figure is the current available heap if you do nothing to purge modules from it. The Largest block figure represents the largest amount of heap available in a contiguous block if you purged all extraneous blocks from the heap. A typical listing is:

Room in dictionary:                    223926
Distance to top of hibase range:        61906
Total heap (no purge):                 325888
Largest block (purge):                 325990
Show Module Status Lists all modules defined in the dictionary in memory, and indicates which one(s) are currently on the heap by printing their load addresses. Modules are locked while executing to prevent their being removed from the heap at an inopportune time. A typical listing is shown below:

The Utilities Menu

Echo During Load Displays every line of text from a source file as it is being loaded and compiled into Mops. Use this feature in the early stages of program development to aid you in discovering exactly where your bugs are cropping up. By following the load, line-by-line, you can see exactly where Mops runs into trouble and stops the load. Once your code is sufficiently debugged, you can turn off echo to speed up loading. This selection is identical to the Mops command +echo. If you select Echo During Load, a check mark appears next to the menu listing. Selecting it again turns off the feature and removes the check mark. You can pause an echoed load by hitting a key, while quiet loads do not pause to permit type-ahead.
Clear Stack Clears the stack. This command is also available in QuickEdit.
Clear Window Clears all text from the Mops window. This command is also available in QuickEdit.
Install The use of Install has been described in the Tutorial.
Purge Modules Clears the heap of all modules loaded by your program.

Communication with QuickEdit

Mops and QuickEdit send Apple Events to each other, with a number of benefits. Of course, to use these features, both Mops and QE must be running. If this isn't so, or if you're running an earlier system which doesn't support Apple events, these commands will be ignored.

  1. If an error occurs during loading a file, Mops sends QE an Apple event asking it to open the source file at the error line.
  2. The Mops command ˜edit someFile' will ask QE to open the given file.
  3. The Mops command œopenSource someWord will ask QE to open the source file containing the definition of someWord. If there's a log file, QE will put the cursor to the start of the definition. If there isn't, QE will search to the first occurrence of ˜someWord' in the file (which will probably be at the start of the definition anyway, or maybe in a comment just before).

In QE, there is now a ˜Mops' menu with a number of commands:

  1. Load
  2. Save and load (command-K)
  3. Clear Stack (command-0). Also now available in Mops as command-0.
  4. Open Source (command-=). You highlight a word, ˜someWord' say, then choose this command, and QE asks Mops to execute œOpenSource someWord as described above.
  5. Clear Window (command--). Clears the Mops window. Also available in Mops as command-2.
  6. Glossary (command-Y). Opens QE's glossary of Mops words and classes. The word under or to the left of the cursor (if any) is searched for automatically.
  7. Edit file (command-E). You highlight a word, then choose this command. If Mops is running, it will open the file with that name (if it exists).

  Reference Reference 2
Documentation