Ana səhifə

Leopard II manual Table of Contents


Yüklə 3.21 Mb.
səhifə10/16
tarix24.06.2016
ölçüsü3.21 Mb.
1   ...   6   7   8   9   10   11   12   13   ...   16

4.3The Program Editor


The program editor is the main screen that you see when you start up C-Max (fig. 25). The screen shows you 27 lines at a time but you can scroll through all 4096 possible lines of a program using the scroll bar on the right. Program lines are created and edited using the control wizard (fig 29), which is brought up by double clicking on any existing or blank line. In the control wizard screen, choose the instruction type first (IF, THEN, …), then the instruction itself (Module/Point,…) and then the desired options that will appear in the bottom part of the window. Some instruction types will not display the list of options unless the expansion module type that it refers to is defined in the System Map. This is why it is best to start by defining your System Map first. Section III of this manual gives you the complete command reference guide to the options available for each instruction. You can also enter text comments for any program line by clicking the desired program line under the Comments column. A sample session showing the use of the program editor and command wizard can be seen in the Writing your first program tutorial at the end of Section 1.



Fig. 29

4.3.1Editing Commands

The Insert button on the left of the main screen allows you to insert a new program line at the currently highlighted line on the screen. The existing line and the other lines below it will all by pushed down by one line to make room for the new line. The Delete button does just the opposite, removing the currently highlighted line and pulling all lines below it up by one to fill the void. Doing each one of these operations causes the entire program listing to be updated and any "Skip To” offsets are recalculated to maintain correct program logic. Lastly, the Clear Line button removes any instructions on the highlighted line and leaves it blank. If you intend to insert or delete several lines at one time, see the discussion on cut/copy/paste below for time saving tips on doing this.

More complex editing tasks can be accomplished by right clicking your mouse over the program text area. The Cut control allows you to select a group of program lines to be removed from the program. To use it, begin by left clicking on the first line that you want to cut from the program and while holding down the mouse button, drag the mouse pointer to the last line that you want to cut, and release the mouse button. If the last line you want to cut is not displayed on the screen, drag your mouse above or below the program text area and the listing will automatically scroll through the lines in that direction. Once the mouse button is released, you will see the selected program lines highlighted. You can then right click your mouse over the program area and select the Cut command. The selected program lines will be immediately removed from the program and any program lines after the cut section will be pulled back up to fill the lines vacated by the cut. The lines that were cut are now held in memory for possible pasting. You can do one of two things at this point:


  1. Continue editing your program and ignore the cut lines. This is equivalent to having deleted the lines one by one and is actually a good time saving shortcut to do this because every time the Delete button is used, C-Max needs to update the entire listing. By cutting these lines as a group, only one update will be done.

  2. Paste the lines somewhere else. Cutting and pasting amounts to moving the lines from one location to another. To paste the lines, click the first line where you want to place the code segment and then do a right click and click on Paste. Any lines that were at that point or below will be pushed downwards to make room for the new lines.

The third program editing command in the right click menu is Copy. This works just like the Cut command except that the original program lines are not removed; they are only copied to memory for a subsequent Paste operation. This is used for making more then one copy of a group of program lines. The Copy command is also a handy time saver if you want to insert several new lines within your program. Suppose that you want to insert about 10 new lines in the middle of your existing program: Use the right hand scroll bar to quickly go past the end of your program and use Copy to quickly “grab” about 12 to 15 blank lines, then go to the line where you want to insert the new lines and Paste the blank lines there. C-Max will only need one screen update to reflect the insertion of all the new blank lines. Program the lines as you want them and then remove any superfluous blank lines by using Cut as described above.


Copying and pasting between different projects/programs is also possible by using the Save Code Snippet to Disk and Load Code Snippet from Disk commands, also in the right click menu. These are used just like the Copy and Paste commands except that instead of using memory to hold the selected program lines, they use disk files. Using these selections will open a file browser window allowing you to create or open the file where you want to store or load the file. Snippet files have a .snp file extension.
The Find > button (on the left of the editor screen) can be used to locate program lines by searching for text either in the program code itself or in the comments column. Use it as follows: Right click on the “Find” button and the shadow under the button will expand to a text field where you can enter the text you are looking. Enter the text string (it is not case sensitive) to be searched and also check the “include comments” box if you want to search the comments column as well. Then click on the “Find” button and the next line containing the search string will be highlighted every time the button is pressed. Note that the search will always begin from the currently selected program line (just click once on the desired start program line) downwards. You must re-select the start line if you want to do a new search. Finally, do another right click on the “Find” button to re-hide the search string.
1   ...   6   7   8   9   10   11   12   13   ...   16


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©atelim.com 2016
rəhbərliyinə müraciət