Storing Your Macro
To store your macro, and return to the ME-CAD screen, press [Ctrl] [D]. The file is stored on your system disk. This is shown by the following message at the bottom of your screen:
writing 'cad_mac.m'
If you list your current directory, 'cad_mac.m' appears in the list.
If you alter your file in the editor, you might decide that you don't want to keep the changes. Hit [ESC] or [Break] to exit from the editor, and the changes will not be written to disk.
You can add as many macros as you want to a file. The sequence of the macros in the file is not important. But placing the macros in alphanumeric sequence by name makes it easy to find a macro.
When you are writing and debugging a new macro, you may want to write this new macro at the beginning of the file. The first page of a file is displayed when you enter the editor using the EDIT_FILE command, so you don't need to scroll through the file to find the macro. Later, when the macro is completely debugged, you can move it to its correct alphabetical position in the file.
Another way to write and debug a new macro is to create a separate file for the new macro. When the macro is fully debugged, you can append it to your normal macro file. This method has two advantages:
When you use the EDIT_FILE command, your text is displayed faster.
The INPUT command executes faster. (The INPUT command compiles and loads your macro, and is discussed in the next section).
It is advisable to keep separate files for each macro. You can then give the file the same name as the macro. If your macro calls other macros, you may have to input these other macros separately.
There is another method for storing less frequently used macros. Group similar macros in one file. For example, all bolt macros could be stored in the file 'bolt.m', flange macros in 'flange.m'. Use macro names that are common to all files. For example, the first bolt macro and the first flange macro are both called macro1, the second bolt macro and the second flange macro are both called macro2, and so on. Load each file as it is needed. Each time a file is loaded, macros of the same name are overwritten. For example, the bolt macro1 overwrites the flange macro1, and so on. This means that valuable memory space is not used by infrequently-used macros.
When you use the INPUT command within a macro, it must be used with the qualifier IMMEDIATE, see also INPUT.
Est-ce que cela a été utile ?