DIARY.ACC & EdHak.ACC Versions 1.8 3/5/90 ---------------------------------- DIARY has a new big brother called EdHak. This documentation is for both of these, and any references to DIARY also apply to EdHak. The reason for having these two versions is so that anyone who JUST wants an editor to safely edit files can have it, while those of us who want the ability to edit ANYTHING can have that. EdHak is exactly the same as Diary, but has the two added features of (1) being able to edit disk sectors (with which you could ruin your hard drive or floppies by changing the boot sector, FAT, or directory), and (2) being able to edit your ST's memory (which can merely cause bombs on your screen). To Registered users receiving this on a disk in the mail: The 'R' on the end of the 1.8R means this version is for you. It is not to be made available for download anywhere, and I would appreciate it if you want to share Diary with anyone, that you give them the standard DIARY_18.ACC, also included on the Diary disk. Your v 1.8R has been personalized for you (take a look at the Help screen). Also, it (a) has the New Configuration feature enabled and (b) defaults to non-display of the 'cr' at the end of lines and allows you to toggle that display on and off with Ctl-Return. I think Diary has become a fairly mature piece of software, as well as including some unique features. Therefore, I am starting to request $10 for registration from people who have not previously registered. See information below on what all you get for registering. New for Version 1.8 (3/5/90) ------------------- 1) Much faster text output for those who don't use TurboST or QuickST (learning assembly language is FUN, hah!). 2) Word wrap when a line has no spaces now doesn't stick carriage return characters in the middle of the line. 3) Now compatible with Quick ST (text output bypasses QuickST), but you will still see improvements in scrolling when using either QuickST or Turbo ST. Also note that Darek Mihocka has now fixed the bug in QuickST that caused the cursor to do weird things in earlier versions of Diary (and some other programs) when using TOS 1.0. 4) Shift-ClrHome from the top page now acts just like ClrHome, rather than letting the cursor stay wherever it was. 5) The headers that go above the file selector box have been shrunk to fit above the Universal Item Selector III (not really necessary since UIS III can be moved down, but I did it anyway). I also re-worded the headers to be more consistent and not make you think that Diary could only handle text files. 6) When you re-open the Diary window, the cursor is now right where you left it, rather than going to the bottom of the window. 7) Added 2nd menu so all keyboard commands are fairly accessible by mouse. 8) Set right wrap column. ( Alt > ) 9) Set left print margin. ( Alt < ) This just inserts spaces when printing. 10) Set tab spacing. (Alt-Tab) All tabs still have the same spacing between them. 11) Insert current date at cursor. (Alt-D) This assumes you have your ST's date set. 12) Line & column display in text mode; 'n' & hex character display only in hack mode. The 'n' means how many bytes (characters) you are from the top of the buffer -- this could also be called the offset. The first character is therefore number zero. 13) Notices like Insert/Overwrite are now shown at their own location in high and medium resolution. 14) MACROS !! ( 10 of them, 80 chars each ) First select a block with the function keys or the mouse, then save to a function key with Cntrl-FuncKey; then when you want to insert that macro, hit Alt-FuncKey. Using the menu entry for macros first displays all ten macros, one per line. Note that if you want the macros to still be there after rebooting, you need to save the configuration, which requires a registered version of Diary. 15) Config file (Alt-New config) User-alterable buffer size finally! (4-64K) (Saving a new config is available only to registered users.) This first shows your current status and settings: buffer size/used, margins, tabs, end of line character, insert/overwrite mode, case sensitivity in search, wrap on/off mode, text/hack mode, current path and filename, and macros (display of the macros is truncated to what will fit on one line). You are then given the option of changing the buffer size, but this does not take effect until you reboot (or reload into Multi-Desk). Then you are asked if you want to save that whole configuration. Note that everything except the buffer size gets saved to a DIARY.CFG file, while the buffer size gets written into the DIARY_18.ACC file itself. It must be done this way for acc's to be able to safely allocate the proper amount of memory. Other desk accessories that use a more typical method of allocating memory (dynamic allocation using a Malloc call) are not handled properly by TOS and will steal gobs of extra ram if you ever try switching between low and medium resolutions, because TOS does not deallocate that ram before allocating it again, (for instance Notepad and at least the demo version of STeno). NOTE: The file must be named its original name (e.g., DIARY_18.ACC, or EDHAK18R.ACC) for it to be found for writing the new buffer size. However, I realize you may have reasons to name it something else, such as if you want to have two copies of it loaded at the same time, or different copies with different buffer sizes. To do this, just rename it AFTER you have saved the desired buffer size to it. 16) Fixed block print error introduced in 1.8A. 17) Fixed vertical slider positioning after a merge. 18) Fixed it so moving a window over a highlighted block does not highlight over that other window. 19) Esc character can now be output with Alt-Esc as well as the normal Cntrl-[ (which puts out ASCII character #27, just like cntrl-A puts out ASCII #1 and cntrl-Z puts out ASCII #26). This is useful for putting in printer control codes -- see section on Printing below. 20) Fixed bugs in using mouse to select a block while scrolling. 21) Opening Diary with the mouse positioned right where the 'Menu' button is now draws the whole window properly. 22) Compatibility with Flash is now almost perfect: Opening up Diary now almost always draws the window fully (and when it doesn't it's no big deal since just resizing the window fixes it). And if you go to Flash's on-line mode without exiting Diary, you can now return to Diary without crashing (after getting back to Flash's edit window, of course). That one took a couple entire weekends of work to figure out, and I caution you not to try that with any other text editor accessories or any accessory that opens a window (such as the Atari control panel). Finally, the cursor position does not now get screwed up when going back and forth between Diary and on-line mode. The research I did for this stuff also resulted in some changes to make Diary much better able to deal with opening/closing any application with the Diary window open. I'd like to hear if you find a program with which this doesn't work. 23) Diary now lets you know if it ran out of disk space while trying to save a file. 24) Fixed bug that wouldn't let you undo a deletion of the very first character in the buffer right after bootup. 25) Insert byte string (Alt-I). This is for direct entry of all 256 characters. To enter ones above ASCII #127 you need to enter their hex values (unless you know some key combination that I don't that will do it!). For instance, to get the trademark symbol (little 'TM') on the screen, you need ASCII #191 (decimal) which is $BF in hex. Don't expect your printer to output a 'TM' though. On my printer, character #191 is an italics question mark. Note that here and anywhere a string is to be entered, such as for search/replace, entering hex byte values gives access to all 0-255 possible characters. Hex digits must be entered in pairs or the string will be interpreted simply as a string of characters rather than hex values. 26) AutoLoad a file (Available only to registered users, since it requires saving a new configuration) This option allows you to specify a file for Diary to load into its buffer automatically upon bootup, so when you open Diary the file is already there without you having to go find and open it. This is especially useful if you are always editing or appending to the same file such as a diary. You set this up by: (a) load the file of interest into the buffer, then (b) go to New Config (Alt-N), and (c) click through the screens until you are asked if you want to AutoLoad the current file, and finally (d) click on Yes. The full path and filename get saved to the DIARY.CFG file along with the rest of the current configuration (assuming you tell it to really save the configuration when it asks). If it can't find the specified file upon bootup, it just skips over that routine and no harm is done. Features available in EdHak that are not in Diary: 27) View/Edit RAM (Alt-V) Yes, you can load any part of your ST's memory into the edit buffer, either by searching for a sequence of characters or by choosing which specific block of memory to load. Then you can edit it, save it to a file, or even write it back RAM in its original or some other location. Hack away! but don't complain to me if your machine crashes after you change something in RAM. The RAM you can access includes addresses from zero up to whatever your operating system thinks is the top of physical RAM (phystop). This includes all the system variables, screen ram, etc. However, with the ramdisk I use (Eternal2), phystop is lowered to fit the ramdisk above it, so phystop becomes lower than the actual top of physical ram. To get to that RAM in a ramdisk you can use the disk editing feature described below. 28) You can now use Diary's big brother, 'EDHAK.ACC' as a disk sector editor! To do this, start as if you were going to open a file, but leave the filename part of the item selector empty and just specify which drive you want. Then open it and you will be asked which sector to start reading from. Sector zero is the boot sector, and this is followed by two copies of the FAT (file allocation table), then the root directory, and finally the actual file data. Unless you are using a very strange format for your drive (i.e., something not supported by GEM), files are stored in 1K chunks called 'clusters' each of which consists of two 512-byte 'sectors'. Diary will load as many sectors as will fit into the buffer and still leave you a couple K to add to it, just as if you had loaded part of a file that was too big for the buffer. If you don't know anything about disk structure, do NOT try saving this back directly to disk sectors. If you want to save it as a file, then give it a filename and all will be safe. If you DO know what you are doing, then this disk editing feature provides some different options from anything you are likely to find in a typical disk/sector editor, since you can view/edit more than one sector at a time, toggle into text mode, insert, append to files, etc. Known Bugs ---------- 1) When word wrapping an existing paragraph (i.e., reformatting it) if a sentence ends with a period at the end of a line followed immediately by the carriage return, only one space will be put after the period if it ends up elsewhere on a line due to the wrap. To be fully correct it would need to put two spaces after the period, but I have not even tried dealing with that yet. 2) Someone mentioned to me that they saw Diary do something weird when called from ST Writer (in medium resolution). The window opened up LESS than half a screen. Some confirmation of whether this actually happens and any more information would be helpful. Next Feature(s) --------------- I plan to add the ability to search large disk files (infinitely large) and disk sectors to find which part you want to load into the buffer. The routines to do this would also let me change the Encryption feature to work on a whole file of any size, rather than just what will fit into the buffer (which has limited the encryption capability to the buffer size so far). I'm currently working on speeding up the search routine (translating into assembly code) since searching through a couple megabytes of ram currently takes a long time (about a minute or so). I plan to make .PRG versions of both of these, possibly allowing the user to change it by just changing the extender. Also an updated 'S'tripped accessory version for absolute minimum memory use will be available soon. UPGRADES -------- Registered users can always get the latest version by sending me $2 (or more) to cover my cost of disk and mailing. I will send a post card to all registered users to let you know whenever I come up with a new version. The version available to non-registered users will always have some feature(s) disabled. For instance, non-registered users will always have to live with the 'cr' character at the end of the lines, and you can not save a new configuration. I don't consider these major, but just a little added incentive to register. Some possibilities for the future --------------------------------- 1) Maybe create my own sliders/arrows that repeat (the GEM ones don't without TOS 1.4). 2) I MAY eventually see about making the drop-down menu items highlight as you move the mouse over them. But I consider that basically a cosmetic improvement, and I'm not much into putting effort into cosmetics. 3) Make the desktop directory windows update themselves when a file is saved from Diary. For now you have to hit Escape after leaving Diary to get the window updated. (Just as is true with Universal Item Selector). 4) Deal directly with files with other end-of-line characters (e.g., just LF). For now you have to do a full search/replace to change some other end of line character sequence into CR/LF to use Diary in its text mode. 5) One person suggested adding a little picture drawing feature... That could be a fun can of worms for me to get into!... but since there is now an accessory called MultiPaint available on various BBS's, I don't plan on getting into that area in the foreseeable future. INTRO FOR THOSE NEW TO DIARY ---------------------------- You can always hit the Help key or use the drop-down menu if you don't know what you're doing. This program is simply a text editor accessory that opens up a half-screen window which you can move up or down on your screen, and toggle between full and half size. Being a desk accessory, it is available from within any other GEM program that has a menu bar, so you can get to it whenever you want to jot something down or view or make changes in a file without going to get your favorite word processor or disk sector editor. Unless you register and get the version that allows saving a new configuration, the text buffer is limited to 10K of data, which it allocates all at once when you boot up. Any text in the buffer stays there until you Clear it or reboot, regardless of whether you have the Diary window open. In Text mode, Diary deals strictly in text with the standard CR/LF at the end of each line, but in 'Hack' mode it can handle anything. It only displays the 'cr' but the line feed is still there. If you are editing something other than text, just turn off the word-wrap before doing anything else or switch to Hack mode. If you cover up the Diary window by clicking on a desktop or application window, you can get back to Diary either by clicking on any visible part of the Diary window (if any is still showing) or by going to the desktop desk accessory menu and clicking on Diary as if you were opening it. In all the cases I've tested, it is OK to open or close an application when the Diary window is open. It just causes the window to close, and you can then re-open it as usual. One slightly strange thing in Diary is the simple little drop down menu within the Diary window. The items don't highlight as in a normal menu (since I couldn't justify the added program size and programming hassle to accomplish this), but the menu goes away just by moving the mouse outside the menu without having to click again. If you have less available RAM than needed for the normal versions of Diary, but still want some way to do simple text editing, a stripped version of Diary called DIARY17S.ACC is available that only takes up 38K of ram (compared to about 70K for the full version 1.8). This was accomplished by decreasing the buffer size to 4K and removing a number of features, most notably the word wrap and all block functions. Word Wrap (Alt-W, F10, Wrap...) -------------------------------- I should probably explain a little about the Turn Off/On button in the Wrap selection box. With Wrap turned On, Diary will word wrap to a default line length of 75 characters, plus the CR/LF for a total of 77 (or 64 if in 'Hack' mode, or appropriately shorter lengths in low resolution). This length can be changed with the Alt- '>' command. Word wrap occurs automatically when adding to the end of your text and you hit the word wrap column, or when inserting text in a line that reaches the wrap column. With Wrap turned Off, you can create/edit lines of any length (within the 10K limit for the whole buffer, of course). Regardless of whether Wrap is turned on or off, you can always force a wrap (reformat of paragraph, line, or whole buffer) with the Wrap! button of the dialog box (F10 or Alt-W). Block Cut/Paste and Delete functions (Alt-B, F1-F5, Delete, Shift-Delete, UNDO) ------------------------------------------ The buffer that is used to hold cut blocks and deleted lines and characters is not very large. It is equal to 1/8 the size of the edit buffer (1280 bytes in the case of the normal 10K buffer). Deleting a line (or multiple lines or characters in sequence) has the same effect as doing a block cut of them. It is similar to the Flash editor in that after deleting, you can paste it back any number of times wherever you want. So to do a block copy, you first cut, then paste at the same location, and finally paste where you want the copy to be. The Undo key does the same thing as F5 (paste). Note that doing multiple backspaces only puts the last character deleted into the paste buffer. Extended lines (longer than one window width) -------------- Be sure to turn off Wrap before trying to edit a line that extends beyond the first window, unless you want it to wrap when you hit the end of the second (or later) window. Simply moving the cursor with the arrow keys beyond the furthest left or right columns of the window will move you to the next or previous section of the line. Shift-left or right arrow takes you to the start/end of the line, no matter how far over it is. Another command, Control-arrow, takes you just to the left or right edge of the current window. Clicking with the mouse by the edge of the window will also take you to the next/previous section of the line. One interesting thing you can now do with wrap turned off is to use Diary instead of a sector editor to Find and then change text strings in PRG, TOS, or any other file. Just be careful not to change the length of them! Tabs ---- In insert mode, the tab key inserts whatever number of spaces you have it set for (default is 5). In overwrite mode, it skips over that number of spaces rather than erasing anything. I figured it would be more useful that way for editing existing tables. Files larger than the Diary buffer or even larger than your ST's total memory! (or when is 10K equal to 100 megs?) ----------------------------------- Despite Diary's small (default of 10K) text buffer size, it will handle ANY size file by loading in only a portion of the file that you want. It is "limited" to the first 99 megabytes, just because the biggest number the dialog box lets you enter is 99999. If anyone finds this to be a limitation, let me know! Block zero is the first 8K block of the file, and the dialog box will allow you to go up to a block starting at about 1K from the end of the file, which would give you over 8K of free space to add text to the end of the file. When you go to save the file, Diary will take care of stringing together the text from the original file with the block of it that you edited to create a new file. This means that it won't overwrite the latest version of the original on disk, since it needs that to create the new version to be saved. For you power users this also means that you should be careful if you have two copies of Diary or Diary plus another editor running at the same time, not to make changes in the same document on disk or in both windows of Diary, and then expect to be able to save a complete file from both. Since you can only load an 8K block of a file that is bigger than 10K, it will require more work to do some things, like doing a cut/paste from the end of a big file to its beginning. To do such a thing you would need to first save the file after the Cut, then read in the other portion of the file, and finally do the Paste. Or to handle a block larger than the paste buffer size, you can first save the block to disk and then use the Merge feature to paste it at the desired location. Printing (Alt-P) -------- This allows either printing the whole buffer or just a marked block. Note that you can send any printer control codes you want to set left margin, bold, near letter quality, or any other things your printer can do. All you have to do is look at your printer manual to find out what codes do what. For example, on my printer (which is pretty much Epson compatible) the code to set the left margin is esc-'l'-'x', where x is the number of spaces over to set the margin. To get the escape character, just type Control-[. Then type lowercase L. Then type Control-E to set a left margin of 5, since E is the fifth letter of the alphabet (don't worry about the funny character that appears - that's just what the ST uses for displaying this control code which is normally non-printable). REGISTRATION ------------ Incidentally, if you find yourself using this on any sort of regular basis, it is shareware, and I'd be most appreciative of something in return for my year of effort. For the $10 registration I would gladly provide custom versions with different ALT-key and function key assignments. Registration will also get you more complete documentation, IF you request it. I am also very interested in suggested improvements, bug reports, etc. Further improvements are expected, and registering will reward you with a more full-featured version than is available for download. If you use Diary, but don't feel that it is worth $10 to you, send me $5 and any suggested improvements, and I will still register you. Registering either Diary or EdHak gets you registered for both. The Modula-2 source code for the initial version exists as a different file earlier in the ST downloads, and I'd happily provide source to this and later versions to any registered user. Feel free to distribute Diary to friends, BBS's etc, but please also include this documentation file. Oh, and how about a disclaimer: This software and documentation have no warranty of anything. You use it at your own risk. I use it myself all the time, but since I can not possibly check it out with every hardware/software set up out there, I can only offer to try to fix any bugs that you find and report to me. DIARY.ACC & EDHAK.ACC version 1.8, copyright 1990 by Craig Harvey GEnie: c.harvey CompuServe: 73047,600 Clear Thinking, BBS: 313-761-2444 P.O. Box 715 Ann Arbor, MI 48105 THANK YOU ( Those who have registered ) --------- James Kleiser James Conway Robert Wenham Clayton Hardiman Kenneth Ledgard, D.D.S. Warren Tryk (Hired Hand Graphics) Chet Walters J. Philip Arno (new since last release:) John Rosenberg Patrick McShane (PCS School for Advanced Learning) William Nelson Frederick Dickey Terry Lee West Edward Williams Russ Crum Joseph Meehan Jimmy Johnson Ron Robinson Dr. Alfredo Gonzalez Barry Bradfield John Anderson (EMU Ski Club)