Uedit.tutorial Follow the instructions in this file in order to: A) evaluate Uedit B) familiarize yourself with Uedit. To move forward and backward, use shift-upArrow and shift-downArrow. If you have a printer, you will probably want to print this file before continuing. Here's how: (( ctl-upArrow scrolls you to front of this document. )) (( ctl-downArrow scrolls you to the end of this document. )) - Press ctl-downArrow, then press the alt-key, and click the mouse well below the last text in this document. - Press ctl-upArrow to return to front of document. - If the document is not hilited, you must set the start of hilite: Press the shft-key and click the mouse at the beginning of the top text-line. If the text doesn't become hilited, you must have done it wrong, so try again. - Once it's hilited, just press ctl-p and it will be printed on your printer. This tutorial is only meant to get you started. It cannot begin to show you everything you can do with Uedit. Uedit will be an ongoing process of discovery. Six months from now, you will still be discovering new things about it or things you didn't know that it can do. While using this tutorial, select "Restore" in the menu every now and then, if you want to restore this document after you have made changes or mistakes. Scrolling 1. Try each of these keys: shft-upArrow/downArrow - to see prev/next half-page. alt-upArrow/downArrow - to see prev/next page. ctl-upArrow/downArrow - to see front/end of file. normal-upArrow/downArrow - to scroll by one line. shft/alt/ctl-leftArrow/rightArrow - to horizontal scroll. 2. Press ctl-downArrow again. Now you're at end of file. Press keypad-5. This "finds" cursor, wherever it is. Moving the Cursor 3. Experiment with these keypad-keys: keypad4, keypad6, keypad8 and keypad2. These all move the cursor around. Use shft, alt and ctl with them: - normal- works at word level. - shft- works at character level. - alt- works at line level. - ctl- works at page level. You can also position the cursor with the left mouse-button. And keypad5, right in the center of the keypad, "finds" the cursor. Scratch Deleting, Undo-delete, Quick and Dirty Cut & Paste 4. Place the mouse-cursor several lines above this line. Click the left mouse button. Press keypad7, then keypad9. Press ctl-d. These are "scratch delete" keys. Press keypad0. This is the Undo-delete key. Experiment by using keypad7 and keypad9 along with the shft, alt or ctl key. Undo the deletes by pressing keypad0. 5. Position the cursor somewere in the above paragraph. - Press ctl-d to delete the cursor line. - Press keypad0 to put it back. - Place the cursor at the beginning of any line on this page. - Press keypad0 again to "paste" a copy of the earlier scratch delete. - Press keypad8, then press ctl-d, to get rid of what was just "pasted". Click-loading Files, Show-Flags, and Read-Only 6. Press F7 or select "Set search" in the menu. Type "readOnly" followed by ESC. This is to set up for a search we'll be using in a moment. Write down or memorize these instructions, and then follow them: - Press the ctl-key and mouse-click this word: Uedit.tutorial - Answer "Yes" to the read-only question. - Press F9 twice, to find this area in the tutorial. - Press keypad5, to center the cursor in the window. You are now looking at a second copy of Uedit.tutorial. 7. Select "Show flags" in the menu. It says "readOnly". - Type some letters. It won't let you. - Select "Read-only" in the menu and type again. It will let you. - Select "Show flags". It says "no" on "readOnly" now. - Press F3 or select "Close" in the menu. Answer "No" to the "Save changes?" question. Press alt-i or select "uninvert" in the menu. Making Commands, Auto-Loading Files 8. This file was auto-loaded at start-up because of a command that looks like this: It was compiled and stored in Uedit.dat. Press F6 or select "Compile" in the menu. The compiler will find the left angle bracket and try to compile the command again. It will see that a command for shftAltCtl-z already exists. Answer "Yes" to the question and the same command will be recompiled. Notice that you can compile commands anywhere! 9. Put the cursor on the LEFT angle-bracket of the above command. Press the DEL key one time. Now the compiler will not find that command. Press F6 or select "Compile" in the menu. Answer "Yes" to the question. The following command will be compiled. The compiler says there's an error. The cursor is sitting just beyond the error. Press keypad7 to delete "aMistake". Press F6 or select "Compile" again and select "Yes" again. Now it has been compiled. Select "Save config". Now those two files will be auto-loaded next time you start Uedit. Favorites, Kill-Key, Save & Restore Configuration 10. Select "Favorite" in the Settings menu. Now "Uedit.tutorial" is a "favorite" document. We will load in some new documents in a moment. You can return to this "favorite" document instantly by: - selecting "Next fav't" in the menu, or - pressing shift-f1, or - clicking the 3rd invisible gadget in the message line. The message line is just below the window Title Bar and the gadgets are each 1/4th of the message line. Now, press shftAltCtl-z. Both files are loaded automatically by Uedit. NOTE: You could load as many as 20 files, but if you name more than 20, only 20 will be loaded. Experiment with F1 (or the 4th gadget) and shft-F1 (or the 3rd gadget) to switch among files. You can also use "Next file" and "Next fav't" in the menu. Notice that you can always return instantly to this "favorite" file by using shft-f1 or "Next fav't" or the 3rd gadget. Go to each of the other 2 files and press F3, or select "Close", in order to get rid of them for now. Do NOT save them! 11. Select "Kill key" in the menu. Very Carefully - press shftAltCtl-z. If you kill the wrong key, select "Load config" in the menu and answer "Yes". Then repeat the "Kill key" procedure. Now select "Save config" in the menu. Now there is no shftAltCtl-z command, so nothing will be done at start-up next time you run Uedit. If you want the tutorial auto-loaded at start-up next time, put the left angle-bracket back onto the command in #8 up above and recompile it. Then select "Save config" and answer "Yes". HELP Key, and Swapping Keys and Gadgets 12. Press altCtl-f6 or select "Swap keys" in the menu. Now the next two keys will be swapped. Press the HELP key. Now press the letter "h". The two commands have been swapped. ("h" didn't have a command before.) Press "h" and the Help file appears. Press "h" again, and it disappears. Now we'll swap it somewhere else, and eventually we'll put it back onto the HELP key. Press altCtl-f6 again. Press the letter "h". Now press the alt-key and click the 1st invisible gadget in the message line. (That is, click the mouse in the first 1/4th of the line just below the Title Bar.) Now they are swapped. Now press the alt-key and click the 1st gadget. The Help file appears. Do it again, and Help disappears. NOTE: If you missed the invisible gadget when you clicked the mouse, you will have swapped "h" with the left mouse-button instead. Remember that the mouse button places the cursor. Since pressing "h" can't create a new mouse location like moving the mouse can, the "h" key can't do what the mouse button could do before they were swapped. But the mouse-button is able to do what "h" could do - that is, make the Help file appear. Select "Load config" in the menu. Now the keys are all as they were when you last saved them with "Save config". Before swapping keys around, you should read what the manual says about it. The reason is that menu items always execute key or gadget or mouse commands. And also some commands call other commands. The HELP file shows you which keys you should not swap. They are marked with a "(*)". (This is not necessary: But if you are a technical person, you may want to load in Uedit.cfg and search on "runKey". This will show you many cases where keys borrow other keys.) Hilite/Invert and Cut/Paste/Copy 13. We can hilite this paragraph, as follows: - Press the shift-key. - Place the mouse at the beginning of the first line and click the left mouse-button. - Move the mouse down to blank line below this paragraph. - Press the alt-key. Click the left mouse-button. The paragraph is hilited. Press alt-h or select "unhilite" in the menu, to unhilite the paragraph. Now we will hilite this paragraph using a different method: - Put the cursor at the beginning of the paragraph's first line. Press keypad1, which sets the beginning of hilite. - Put the cursor on the blank line below below this paragraph. - Press keypad3, which sets the end of hilite. Now it is hilited. Press alt-h to unhilite it. 14. We'll use a third way, in order to hilite this paragraph: - Press the shift, alt and ctl keys all at once and hold them. - Move the mouse to the beginning of the first line of this paragraph. - Press the left mouse button and HOLD it down. - Drag the mouse down to the blank line below and release the button. Hilite this paragraph using one of the methods we just used. Here are the cut/paste/copy/clear commands: a) You can store a copy of it by pressing keypadDot (the "." on the keypad) or by selecting "Copy" in the menu. b) You can copy and delete it by pressing keypadMinus (the "-" on the keypad), or by selecting "Cut" in the menu. c) Once you have made a copy of it, you can paste it at the cursor in any document by pressing keypadEnter (the "Enter" on the keypad), or by selecting "Paste" in the menu. d) Pressing ctl-h or selecting "Clear" in the menu will erase the hilited paragraph without making a copy of it. e) Pressing alt-h or selecting "unhilite" will unhilite the paragraph. Press keypadDot, the "." key on the keypad, or else select "Copy" in the menu. This makes a copy of the hilited region. We can now paste it into any buffer at the cursor, by pressing keypadEnter, or by selecting "Paste" in the menu. Select "New file" in the menu, and then press keypadEnter or else select "Paste" in the menu. This pastes it into the New File. To get rid of the New File, press F3 or select "Close" in the menu. Answer "No" to the "Save changes?" question. Notice that we could as easily have used scratch delete keys and the Undo key for this cut and paste operation. We could also have done it using an invert-region instead of a hilite-region. The "I-" menu selections are for an inverted region. Inverted regions can be created using either the ctl-keypad keys or the mouse button. See the Help file. Speaking, Printing, Selecting Colors 15. Now we'll demonstrate speaking and printing. Hilite this paragraph by using one of the methods described previously. If you can't remember how, then press the HELP key or go back and read what we did earlier. Now press alt-s or select "Speak hilite" in the menu. If you have a printer attached to your AMIGA, press ctl-p. This prints the hilited region. 16. We already have a hilite-region. Make an invert-region as follows: - Put the cursor in the middle of the above hilited region. - Press ctl-keypad1. - Put the cursor just below this paragraph. - Press ctl-keypad3. Now there should be an inverted region which overlaps the hilited region. Select "Load config", just in case. Now press alt-help or select "Colors" in the menu up to 24 times, until you see a color combination that you like. Then select "Save config". This saves Uedit's configuration, including your favorite colors. Press alt-h and alt-i to unhilite and uninvert the regions. Search/Replace 17. Use the mouse to place the cursor anywhere above this line: Press F7 or select "Set search" in the menu. Type "test", followed by ESC. If you made a mistake, use BACKSPACE to erase it. After you pressed ESC, the first occurrence of "test" should have been found. test test test test test test test test test test test test test test test Press F8 or select "Set replace" in the menu. Type "GOOD", followed by ESC. Now the replace-text is set up. Since a search was already done and the "found" region is inverted, press F10 or select "Replace fwd" in the menu. You can replace all occurrences by selecting "Repl all fwd" in the menu. To recover from the changes you just made, select "Restore" in the menu, answer "Yes", and press F9 to find this section again. To search backward, press shft-F9 or select "Search bkwd" in the menu. To replace backward, following any search, press shft-F10. Primitive Mode and Abort Key 18. Primitive Mode is used for inputting one-time things like search and replace strings, line numbers to go to, command multiplier, and so on. We have used it for setting up search and replace text already. Primitive Mode is exactly what Uedit would be, if you took away every single key, mouse, menu or gadget command it has got. Here is everything there is to know about Primitive Mode: - The Title-Bar always tells you when you are in Primitive Mode. - Function-keys, menus, and mouse buttons do not work in Primitive Mode. - To delete characters, use BACKSPACE and DEL. - To skip forward or backward, use shift-SPACE or shift-BACKSPACE. - When finished typing, press ESC. 19. Amiga-ESC: Anytime you want to stop a command or process, press Amiga-ESC. This is the Abort Key. Multi-Files and New Files 20. Select "Show flags" and see if this document is marked as a "favorite". If it is not, select "Favorite" in the menu. We are going to load in some other files, and you can get back to this file immediately by any one of the following: - Pressing shft-f1 - Selecting "Next fav't" in the menu. - Clicking the 3rd invisible gadget. Remember that you can always switch files by pressing F1 or by selecting "Next file" in the menu, but this switches among ALL files, not just the "favorite" ones. 21. Press the ctl-key and click this filename: Uedit.manual Select "Rename" in the menu, while Uedit.manual is in the window, and type "Junk", followed by ESC. This is so that you cannot damage Uedit.manual by mistake. Select "New file" in the menu. Now you have a clean slate to use for practice. Create a hilite-region and an invert-region in "Junk". Now do this: - Press keypadMinus to Cut the hilite. - Press the ctl-keypadMinus to Cut the invert-region. - Place the cursor somewhere interesting and press ctl-d a few times. Now you have got copies of three different things you can paste somewhere. Press F1 until you see the New File in the window. Paste the copied material into the New File: - Press keypadEnter or select "Paste" to paste the copied hilite. - Press carriage return to make a blank line. - Press ctl-keypadEnter or select "I-paste" to paste copied invert. - Press carriage return to make a blank line. - Press keypad0 to paste the Undo buffer. You may need to press ctl-upArrow to see the material you pasted in. Note that these all do their pasting at the cursor location. Document Names and AmigaDOS 22. If you aren't looking at the New File, press F1 until you see it. Select "Rename" in the Files menu. Type in "Junk2", followed by ESC. This renames the New File without saving it. 23. Select "Save as..." in the menu. Type in "Junk3", followed by ESC. This saves "Junk2" to disk as "Junk3" and renames it in Uedit. 24. If you saved the document to disk, delete it as follows: - Select "Dos + result" in the menu. - Type "Delete Junk3", followed by ESC. 25. You click-loaded file-names earlier. You can get a directory listing to click-load files from by selecting "Directory" in the menu. Select "Directory" in the menu, then press ESC. This will get a directory listing of your current directory. It will be put into a file buffer so that it will stay around for you to use. You already know how to click-load documents, so press F3 or select "Close" to get rid of the directory listing. Select "No" on the "Save changes" question. Command Multiplier and Learn Mode 26. You should only have Uedit.tutorial in the editor at this time. If there are other documents, find them using F1 and close them using F3. Answer "No" on the "Save changes?" question, if it pops up. Place the cursor on the blank line above this one, using the mouse. Press ctl-m. Type the number 40. Now press the letter "z". Press keypad7 to get rid of it. ctl-m lets you set the Command Multiplier. It multiplies the next thing that you do with mouse, keyboard, menu or gadget. 27. Command Multiplier is especially useful when you have used Learn Mode to teach Uedit some series of things to do. Learn Mode sequences can switch between files, move anywhere inside them, type or delete or do whatever you "teach" Uedit to do with the menus, keys, mouse and gadgets. We will use this list of names in the example: Mary John Kim Albert Nancy Joan Kathy David Ed Jim Lucy Here is an example of what Learn Mode can do: - Select "New file" to get a clean slate. - Type "Dear ,", and put the cursor on the comma after "Dear ". - Press F1 to return to this document. - Put the cursor in the name "Mary" above. - Press ctl-s. This starts Learn Mode. - Press keypad6, keypad4, keypad9, and keypad0. - Select "Next file". ((Could also use F1.)) - Press keypad0. - Select "Refresh" in the menu. ((This is just to give you time to see it. You could also hilite and print it, like a form letter.)) - Press keypad7. - Click the 4th gadget to return here. ((Could also use F1.)) - Press ctl-r. This ends Learn Mode. If you made a mistake in the above, do it over again. (NOTE: "Next file" and the 4th gadget were used only to show Uedit's flexibility.) Now press ctl-r several times, to see it work. Put the cursor on the name "Mary" again. Press ctl-m to set Command Multiplier. Type in the number 11. Press ctl-r. You can press Amiga-ESC to abort before it is finished. This Learn Mode sequence isn't very useful, but perhaps you can begin to see how Learn Mode can merge a customer list with a form letter and print a whole customer mailing for you. See the mail merge example in Uedit.manual, Appendix A. This example is slower because it has to keep redrawing the window. In many other cases, this is not necessary and the learned sequence can run quickly. There are dozens of ways of doing an example like the above and like the mail merge example in Appendix A. For example, you can use hilite, Copy, and Paste, instead of using the delete and undo keys. 28. Now we will Learn Mode to compare two files, looking for minor differences. Get rid of all files except this tutorial. Press F1 to find them, and press F3 to close them. Answer "No" to the "Save changes?" question. Now you should only have Uedit.tutorial in the editor. Did you leave the left angle-bracket off of the command in #8 above? Or did you make a change anywhere in this tutorial file? If you can't think of an edit that you made, just put an extra space in one of these lines or delete a letter from any word. Press the ctl-key and click this name: Uedit.tutorial Answer "Yes" to the read-only question. Now you have two copies. We are going to use Learn Mode to compare them. Rename the new copy: Select "Rename", type "Test File", then ESC. Make both copies of Uedit.tutorial "favorite" by selecting "Favorite" in the menu. Verify that they are each "favorite" by using "Show flags" on each. ((You don't need to make them "favorite" unless there are other files in the editor, but we thought we'd use it anyway.)) Now the Learn Mode sequence. ((We'll set up to start for real later on)): - Press ctl-s to start Learn Mode. - Press alt-downArrow, shft-F1, alt-downArrow, shft-F1 - Press shft-F1 twice more. - Press ctl-r to end the learning sequence. Now press ctl-upArrow on this document to scroll to the front of file. Make sure that the other copy is also paged to front of file. Now you can begin. Just keep pressing ctl-r until a minor difference jumps out at you. If you are in doubt, press shft-F1 a couple of times to double check. ((You can use F1, if there are no other documents in Uedit.)) If you want to sit back in your easy chair and watch, you could do the above Learn Mode sequence again, putting in a couple more shft-F1's and then set the Command Multiplier to 20 or 30 and let Uedit run it by for you. Always use an even number of shft-F1's, to end up at the same document. The more shft-F1's you add, the clearer the comparison, but the slower it runs. 29. Here's a third example of Learn Mode. We'll use it to help us install formfeeds for your printer to print this document. ((Whether the formfeeds will work or not depends upon your printer and the Workbench Preferences settings you are using.)) Press ctl-upArrow to scroll to the front of this document. Place the cursor in the very top line, just below the message line: - Press ctl-s, to begin Learn Mode. - Press ctl-m, to set the Command Multiplier. - Type "66" ((or whatever your form-length is)) followed by ESC. - Press keypad2, which moves the cursor down one line. - Press keypad5, which "finds" the cursor". - Press ctl-r to end Learn Mode. Now everytime you press ctl-r, the cursor moves down 66 lines, or one form-length, and centers itself in the window. Reposition the cursor in the very first line of this document. To install formfeeds, do the following: - Press ctl-r. - Look at where the cursor has landed. This is the line which would be printed as the first line on the next page of your printout. - Allow 5 or 10 lines for borders, and move the cursor up to a convenient place, hopefully a blank line between paragraphs. - Put the cursor at the very beginning of that line. - Press ctl-c, then press ctl-l or just the letter "l". This puts in a formfeed. It will appear as a funny looking "box" character. - Go back to the first instruction and repeat the process until you reach the end of this document. - Then hilite the whole document and press ctl-p to print it. - If you want to keep the formfeeds, press F2 to save the file. The formfeed character has a numerical value of 12. To verify that you put in the right character, put the cursor on the "box" character and press ctl-/. ctl-/ will tell you what the numerical value of any character is. Various Useful Keys All menu items can also be executed from on the keyboard. You can find what their keys are by looking at the Help file. Here are some useful keys you might want to remember: ctl-s - start Learn Mode. ctl-r - end Learn Mode, if ctl-s was pressed earlier. ctl-r - run what was "learned". ctl-m - set Command Multiplier for next command (such as ctl-r). ctl-f - convert cursor character to upper or lower case. ctl-j - merge cursor line with next line. ctl-c - input next character as a control-character. ctl-v - make control-characters visible or invisible. ctl-z - enter an AmigaDOS command. ctl-n - input text line-number to go to. alt-c - remove extra spaces between the next 2 words. ctl-p - print the hilite-region. ctl-/ - identify binary value of character under cursor. ctl-e - change a document's end-of-line character. alt-e - change Uedit's end-of-line character. alt-l - shift the hilited region left by one space. alt-r - shift the hilited region right by one space. Adding or Deleting Menu Items 30. We saved this for last, because you'll need to drop out of Uedit in order to complete it. To add a new menu item, do the following: - Load Uedit.cfg - Search for "Speak hilite" in it. You should now be looking at a column of "menu" functions. We are going to add a new one that will print the hilite-region. Do the following: - Press alt-i, to uninvert the invert-region, if you wish. - Press alt-keypad6, to put the cursor at the end of its line. - Press the Return key. - Type the following line (or copy and paste it in): menu("Print hilite",2,ctl-p) Now let's Double Check: - Did you type in the line exactly as shown above? - Does the menu item directly above it have the number "2" in it also? If there's a mistake, fix it now! You may want to select "Restore" for Uedit.cfg and start over. Now the config-file has the new menu item in it and we need to make Uedit read the config-file. Uedit will read it automatically, if it cannot find the dat-file, Uedit.dat, when you start Uedit next time. Select "AmigaDOS" in the menu. Type "Rename Uedit.dat Uedit.dat.OLD", and press ESC. Now the dat-file is renamed, so Uedit will not find it next time. Select "Quit" in the menu. Answer "No" on the "Save changes?" question. Start Uedit again. Uedit will compile the config-file. It takes about 20 seconds. Look at the menu and your new item will be in there.