home *** CD-ROM | disk | FTP | other *** search
/ PC Plus 34 / UTILS / DGEDIT.DOC next >
Encoding:
Text File  |  1989-01-01  |  22.1 KB  |  423 lines

  1.  
  2.   ░░░░░▌ ░░░░░▌ ░░░░░░▌ ░░░░░░▌ ░░░░░░▌ ░░▌  ░▌  ░░░░▌  ░▌
  3.   ░▌  ░▌ ░▌     ░▌   ░▌ ░▌      ░▌   ░▌ ░░░▌ ░▌ ░▌   ░▌ ░▌
  4.   ░░░░░▌ ░░░░░▌ ░░░░░░▌ ░░░░░░▌ ░▌   ░▌ ░▌░░▌░▌ ░░░░░░▌ ░▌
  5.   ░▌     ░▌     ░▌░░▌        ░▌ ░▌   ░▌ ░▌░░▌░▌ ░▌   ░▌ ░▌
  6.   ░▌     ░▌     ░▌ ░░▌       ░▌ ░▌   ░▌ ░▌ ░░░▌ ░▌   ░▌ ░▌
  7.   ░▌     ░░░░░▌ ░▌  ░░▌ ░░░░░░▌ ░░░░░░▌ ░▌  ░░▌ ░▌   ░▌ ░░░░░▌
  8.   \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  9.                 
  10.          ░░░░░▌ ░░░░░▌  ░░░░░░▌ ░░░░░░▌ ░░░░░░▌ ░░░░░░▌
  11.          ░▌     ░▌   ░▌   ░▌      ░▌    ░▌   ░▌ ░▌   ░▌
  12.          ░░░░░▌ ░▌   ░▌   ░▌      ░▌    ░▌   ░▌ ░░░░░░▌
  13.          ░▌     ░▌   ░▌   ░▌      ░▌    ░▌   ░▌ ░▌░░▌
  14.          ░▌     ░▌   ░▌   ░▌      ░▌    ░▌   ░▌ ░▌ ░░▌
  15.          ░░░░░▌ ░░░░░▌  ░░░░░░▌   ░▌    ░░░░░░▌ ░▌  ░░▌
  16.          \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  17.  
  18.          Note: This the text file DGEDIT.DOC. Press [Esc] to exit editor.
  19.  
  20.             1. Introduction
  21.  
  22.             2. Getting Started.
  23.  
  24.             3. Function Keys.
  25.  
  26.             4. Program Description.
  27.  
  28.             5. Applications.
  29.  
  30.             6. Restrictions & Limitations.
  31.  
  32.             7. Registration. 
  33.  
  34.             8. Bug Fixes & Improvements. 
  35.  
  36.             9. Program Source Code. 
  37.  
  38.  
  39.                                                  
  40.                        ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ 
  41.                       ▌ Personal Editor Ver 1.00 ▐
  42.                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  43. Introduction                  
  44. «≈≈≈≈≈≈≈≈≈≈»
  45.  
  46.      This program was written mainly as an exercise in Assembly Language
  47. programming. As such it is lacking in certain areas which might have been
  48. improved should more thought have been applied to what the program was going
  49. to evolve into at the outset. However, as a text processor the program is
  50. quit adequate and its simplicity can be an advantage. It is ideal for writing 
  51. programs where as products such as wordstar are slow and unweildy and offer
  52. many more facilities than the average programmer would ever want to use. Also
  53. the compressed 'EXE' file is very small and can be included on any diskette
  54. without a great loss in disk space.
  55.      One of it's best features is it's easy to learn command windows. Nearly
  56. all of the editors features can be accessed by first pressing a function key
  57. and then selecting the appropriate function from those selected with the up
  58. and down cursor keys. Once the option is selected that you wish to perform you
  59. need only press enter to select it.  Once a window has been called up there are
  60. two ways to cancel it without selecting a function, firstly you can select the
  61. last option, which is always called cancel, or secondly you can press the
  62. escape key. In fact you need only press this escape key in many situations and
  63. whatever you are doing will be terminated.
  64.  
  65. Getting Started
  66. «≈≈≈≈≈≈≈≈≈≈≈≈≈» 
  67.  
  68. To start the editor you need only type the program name followed by <ENTER>. 
  69. You will then be presented with the initial logo screen. To proceed you need 
  70. only press any key and the screen will be cleared and you will be asked for 
  71. the name of the file that you wish to edit. 
  72.    There is another quicker method of editing a file however and that is 
  73. done by specifying its filename on the same command line when invoking the 
  74. program. 
  75.    The editor has the ability to edit up to five files simutaneously and if 
  76. you want to edit more than one file you can specify all the filenames when 
  77. you invoke the program. 
  78.  
  79. Examples :- 
  80.  
  81.       (1) DG<cr> 
  82.       (2) DG MYFILE.TXT<cr> 
  83.       (3) DG MYFILE1.TXT MYFILE2.TXT MYFILE3.TXT MYFILE4.TXT MYFILE5.TXT<cr> 
  84.  
  85.  
  86. Function Keys
  87. «≈≈≈≈≈≈≈≈≈≈≈»
  88.  
  89. F1 - Displays a help screen which gives you a breif summary of all of the 
  90.      editors function key assignments along with the editors software version
  91.      number. If you press the F1 key whilst there is a Window on screen a 
  92.      small pop-up help message will be displayed which will give you a better
  93.      idea of what the various menu functions do.
  94.  
  95. F2 - This provides you with a quick method of jumping to either the top or the
  96.      bottom of the current file.
  97.  
  98. F3 - This will display the File Menu, from which you can perform many file/disk
  99.      orientated operations follows :-
  100.  
  101.      i) New - this function will always abandon whatever file is currently in 
  102.               memory and ask you for a new file specification.
  103.  
  104.      ii) Save - this will save you current document to disk using the filename
  105.                 displayed on the status line at the bottom of the screen.
  106.                 Should the current document not have a filename you will be 
  107.                 prompted for it before the program will save the document. 
  108.  
  109.      iii) Exit - this is a combination of the above to functions. The program
  110.                  will save the current document, clear it from memory and ask
  111.                  you for a new file specification.
  112.  
  113.      iv) Rename - this allows you to change the name of the document you are
  114.                   currently working on. Note that this will only affect 
  115.                   subsequent save opterations and will not rename any files on 
  116.                   the disk. 
  117.  
  118.      v) Finish -  this allows you to save the current document and quit the 
  119.                   editor in one operation. You will be prompted for a filename 
  120.                   should the document not have one already. 
  121.  
  122.      vi) DIR - this will give you a list of the files in your current
  123.                directory. Note that only files with normal attributes
  124.                will be displayed. Should there be more files in the
  125.                directory than can be displayed on one screen then a
  126.                prompt '<-More->' will appear at the bottom of the screen
  127.                and will wait for you to press a key before continuing.
  128.                Once all the files have been displayed, the prompt
  129.                '<-No More->' will appear before the screen is cleared. 
  130.  
  131.      vii) CHDIR/MKDIR/RMDIR - allow you to perform the standard directory
  132.                               functions as per the normal dos commands.
  133.  
  134.      viii) ERASE - is the equaivalent of the dos ERASE/DEL function with
  135.                    the only difference being that this function does not
  136.                    allow you to perform global *.*/*.bas etc type deletions. 
  137.  
  138.      ix) RENAME - will let you rename a file on the disk and should not be
  139.                   confused with the 'Rename' function above which merely
  140.                   renames the document in memory.
  141.  
  142.      x) ?.? - is a facility that has been provided so that you can select
  143.               any file type when performing a directory search with the DIR
  144.               function. It will present you with a menu of pre-selected
  145.               standard extensions for you to use or you can select '?.?' 
  146.               again if you wish to use a different file specification. 
  147.  
  148.      xi) - is a quick way of deleting from disk the filename that you are 
  149.            currently viewing. 
  150.  
  151.      xii) Switch - is a function which allows you to select another 
  152.           file/session. You can edit up to 5 files simultaneously, each of 
  153.           which can be up to 61k bytes. There is two other methods that you 
  154.           can use to switch between files. Either you can type ALT+F to pull 
  155.           down the file selector menu or just type ALT+S to automatically 
  156.           switch though them in sequence. 
  157.  
  158.  
  159.  
  160. F4 - This option will give you a graphical representation of how much of the
  161.      available memory your current document is using. On all IBM machines this
  162.      will be represented by a white bar on the screen. On the Hitachi MBE-16002
  163.      however the bar will change color as it progresses along the screen. It
  164.      will change colour at 50k and 60k to give you a more easily recognisable
  165.      warning of when you are getting towards the memory limitations. You should
  166.      take great care once your file has exceeded 60k as it is possible that you
  167.      could start to loose the end of your document if you start adding text 
  168.      at the begining of it. As yet the program will not provide you of any
  169.      warning once this starts to occur, although you will be notified if you
  170.      attempt to load a file which is too big. In this situation the editor
  171.      will load as much as it can, and then print a warning message to the
  172.      effect 'FILE TRUNCATED'. You will require a graphics adapter and suitable
  173.      screen to be able to use this function.
  174.  
  175. F5 - This is here to give you a quick impression of what your document looks
  176.      like. It is most useful for viewing documents where you want to get an
  177.      idea of what the format is like before printing. You can also examine
  178.      program files quickly to see if they contain any screens. Each vertical
  179.      row of text displays 200 lines of your document. This function also
  180.      requires the use of a graphics adapter/screen.
  181.  
  182. F6 - This key is used in conjunction with the F7 key and it's function is to
  183.      enter any ASCII character including those which would normally have a 
  184.      special meaning to the editor such as the ESC key. You can also use this
  185.      key for drawing diagrams by assigning it one of the ASCII line characters.
  186.      To assign a character to this key you must first press the F7 key. You
  187.      can select any character you wish from the display generated by the
  188.      ASCII Select function. The only character that I suggest that you avoid
  189.      using is the END OF FILE character/marker which is character 26 or the 
  190.      Arror symbol (the one pointing right). Shame, I know but there you go.
  191.      The only other characters that have any special meaning to the editor
  192.      are character 13 & 10 which are Carriage Return and Line Feed respectively.
  193.      Even these chacaters may be enetered freely as they only take on any
  194.      special meaning to the editor when they appear together like <CR><LF>.
  195.      Should you enter these two characters together the next time the screen
  196.      is completely redrawn the line will no longer display these characters but
  197.      appear to be split. This is exactly what the split line function does.
  198.  
  199. F7 - This function displays a series of miscellaneous options which in general 
  200.      allow you to access more easily the extended character set which you would
  201.      normally find more difficult to generate on the standard IBM keyboard. 
  202.  
  203.      This first option is called ASCI Table and one you have selected this you 
  204.      will be have the entire character set displayed on your screen. You will
  205.      also notice that one of these characters is highlighted. This is the 
  206.      currently selected charater to be used by the F6 key. You may select 
  207.      another character by moving the highlighted area with the cursor keys.
  208.      Once the character that you wish to use has been highlighted you need 
  209.      only press enter. As with all other functions you need only to press
  210.      the ESC key to quit without doing anything. 
  211.  
  212.      The second option from the initial screen is described as select macro. 
  213.      as a programmer I often have to draw flow charts and simular types of  
  214.      diagrams. The IBM has access to many more characters than you can easily 
  215.      generate from the keyboard and it is quite possible to create some usefull 
  216.      symbols with these shapes. This function allows you to select a predefined 
  217.      shape for drawing with the Draw Macro command. 
  218.  
  219.         ░░░░░░░░░░░░░░░░░    ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒        ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  220.         ░   BOX 1       ░    ▒    BOX 2      ▒        ▓    BOX 3      ▓
  221.         ░░░░░░░░░░░░░░░░░    ▒               ▒        ▓               ▓
  222.                │             ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒        ▓               ▓
  223.                │                    │                 ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  224.                │                    │                       _/\_
  225.               ▄▀▄                   │                     _/    \_
  226.             ▄▀   ▀▄                 │                   _/        \_
  227.           ▄▀       ▀▄             ╔═══╗               _/  Diagonal  \_
  228.          █ Decision  █────────────║ A ║ Connectors   /      Lines     \
  229.           ▀▄  Box  ▄▀             ╚═══╝           ╔═══╗             ╔═══╗
  230.             ▀▄   ▄▀                               ║ B ║             ║ C ║
  231.               ▀▄▀                                 ╚═══╝             ╚═══╝
  232.  
  233.                            ░░░░░░░░░░░░░░░░░
  234.                            ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  235.                            ░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  236.                            ░▒▓▓ 3 Different ▓▓
  237.                            ░▒▓▓  types of   ▓▓
  238.                             ▒▓▓ box shading ▓▓
  239.                              ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  240.  
  241.  
  242.     Now press F5 and see whats happens, now you see why F5 does what it does.
  243. If you had written this document some months ago and could not remember quite
  244. what it contained, then that display could give you a quick impression of the
  245. document as a whole, especially the diagrams it contains.
  246.  
  247.    The next function under the draw macro command, is provided to allow you
  248. to quickly and painlessly remove the result of the last macro you have drawn
  249. You should note that all of the predefined macros restore the cursor to it's
  250. starting position at the end so that you are in the correct position to erase
  251. the macro should you find that you have drawn it in the wrong place. Also note
  252. that the erase function does not restore the area to its former state, merely
  253. overtypes the charcters with spaces. Obviously there are bound to be shapes 
  254. that you wish to use on a regular basis that you won't find already defined for 
  255. you. It is for this reason that there is a facility to create your own, user 
  256. defined macro's and load them in from disk.  
  257.      To create your own macro, you should first create a new file, or at the
  258. least use a empty part of you current file. It is important that when you
  259. create a new macro, that the only characters displayed on the screen are
  260. the actual characters that compose the macro that you are creating. Any macro
  261. can only ever be as large as a single screen of data. 
  262.     Note that this function will only read from the current screen and does
  263. not work on the whole of the file that you are editing. You can therefore 
  264. use a single file to hold the source for all of you macros. If your not sure of 
  265. what will happen, try the following example. After you have read this, position
  266. the following picture so that it is the only thing on the screen. Then press
  267. F7 and select the save macro option. The program will then, rapidly proceed
  268. to scan the screen for any no-blank areas which will be put into the macro
  269. file. As it works down the screen it will place an asterisk '*' over each
  270. character that has been processed. Once the screen has been completed you
  271. will be prompted for the filename that you wish to use for this macro. It
  272. can be any filename you wish but I surgest that you use an extension of '.MAC'
  273. or something simular so that you can easily identify these files later. If
  274. you decide at this point that you do not wish to create a file then you should
  275. press the ESC key. Once the macro has been written to the filename you have
  276. specified, the screen will be restored to it's original situation. Now lets
  277. Load this macro back into the editor so that we can actually use it. Press
  278. F7 again and select the option to Load a Macro. You will need to respecify
  279. the filename that you have just used. Once loaded it is a simple matter of
  280. selecting this (User Macro) from the Select Macro option/window and we will be
  281. ready to use it.
  282.    Position the cursor to any part of this file, or any other file for that
  283. matter, and select the Draw Macro command. Here is an example for you to 
  284. experiment on.
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.                             │
  292.                       ╔═════╧═══════╗
  293.                      ╔╝ SAVE THIS  ╔╝
  294.                      ║ BOX AS A    ║
  295.                     ╔╝ MACRO 'MAC'╔╝
  296.                     ╚═══════╤═════╝
  297.                             │
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.    The next facility offered on the F7 window are to Select and Save the 
  310. colours to be used by the editor. If you select the first of these options you 
  311. will be presented with another window which displays all the areas of the editor 
  312. which you can define the colour of. If you then select one of these the screen 
  313. will be cleared and a colour chart displayed. Each colour is allocated a number 
  314. which reflects the attribute byte setting used. Remembering which area of the 
  315. editors colour scheme you are defining you need only to position the arrow on 
  316. the screen so that it points to the colour that you want and then press enter. 
  317. If you want to leave the colour of the selected item as it was you should press 
  318. the escape key. Once you have come out of the select colour option the F7 menu
  319. will automatically position the highlight bar on the save option for you to 
  320. make these colours permanent. Should you decide to save these colours then you
  321. should press enter. The colours will be saved in the root directory of the
  322. current logged drive in a file called 'SETUP.DG' If you are using the editor 
  323. for the first time on a particular disk, and you have not got the above file 
  324. already in the root directory then it will automatically create it for you 
  325. using it's default colour scheme. If you are quick you may see the Create/Write
  326. and Close messages appearing just before the main program logo comes up. 
  327.  
  328.    The option that follows this is described as AUTO TAB and governs how the
  329. cursor will behave when you press the ENTER key at the end of a line. If AUTO
  330. TAB is ON the cursor will automatically position itself under the start of
  331. the previous/last line provided that it is still visible. If AUTO TAB is OFF
  332. then the cursor will always return top column position 1 on the next line.
  333. The AUTO TAB setting will be saved along with the colour settings.
  334.  
  335.    The last option is described as 'Pick Up ASCII' and provides you with a
  336. quick method of capturing a character from the screen for you to later enter
  337. with the F6 key.
  338.  
  339.  
  340. Program Description
  341. ═══════════════════
  342.  
  343.     The entire program was written in assembler using Microsoft's Macro 
  344. Assembler Ver 4. Some of the code is particulary inefficient which is mainly 
  345. due to the fact that this is my first assembler program. I am currently in the 
  346. process of re-writing some of these routines which will no doubt appear in 
  347. later releases of the program. If you are using this program on any machine 
  348. comparable in speed with a lowly IBM PC it will no doubt appear rather sluggish. 
  349. There are three things that you can do to improve this :-  
  350.  
  351. In order of preference. 
  352.  
  353.                    1) Buy a faster machine. 
  354.                    2) Reduce the maximum size of the file that can be edited. 
  355.                       (This can be done by reducing the number of bytes 
  356.                       specified by MAXBYTES at the top of the program.)
  357.                    3) Avoid the use of insert mode when extending lines, and 
  358.                       if you really want to cheat, pre-extend all the lines you 
  359.                       are going to type on by entering a space at coloumn 
  360.                       position 80 or greater. 
  361.  
  362.     Now, I bet your wondering how an assembly language program can be so slow. 
  363. Well, let me tell you, it wasn't easy. The primary reason for it being so 
  364. sluggish is the way that text is held in memory. With a high level langauge 
  365. such as basic, you could use an array to hold each line of the text. When you 
  366. wanted to insert some characters into a line, basic would perform so very neat 
  367. and complicated housekeeping. In short basic would look for the next available 
  368. area of memory that could accomodate the new line, move the line there, and 
  369. adjust its array pointers accordingly. This has the effect of the text  
  370. leapfrogging its way though memory leaving little ununsed gaps all over the 
  371. place so basic has occasionally to have a good clean up and move all the 
  372. elements of the array into continuos memory locations. Complicated eh ! 
  373. Well I thought so, so this program holds the text in memory in the same way 
  374. as it appears on the screen. Each line follows directly after the previous one 
  375. in memory, only separated by CR LF combinations. This is a much simpler method, 
  376. but it has the disadvantage of meaning that every time you enter a character 
  377. from the keyboard in insert mode (or extend an existing line) all subsequnt 
  378. characters in memory are shuffled up. In theory therefore the editor will get 
  379. faster the further down the document you get ! 
  380.     I considered using 'C' but although it supports arrays I'm not sure I could 
  381. set up variable length arrays. If I couldn't the maximum size of the file that 
  382. I could edit would be drastically reduced. 
  383.  
  384.  
  385. Applications 
  386. ════════════ 
  387.  
  388.     There are three particular advantages this editor has over most, firstly 
  389. you can enter any characters you wish, unlike some editors which only let you 
  390. enter standard characters, using the rest for special text formating functions. 
  391. Secondly it is ideal for creating diagrams especially with the various macro  
  392. functions and the limitless line length. The third reason which I consider 
  393. to be an advantage of this editor is that it has been written in such a way 
  394. as to be as hardware independant as possible. That is to say that it should 
  395. work on the majority of MS-DOS computers. For example, the program was written 
  396. on an Hitachi PC which is by no means an IBM Clone. If you find that you have 
  397. a problem with the editor which you suspect to be due to compatability then 
  398. please let me know. The most common varaitions I have come across are how the 
  399. cursor appears on different machines. Also the differences between machines
  400. in respect of printer status return codes are quite difficult to cater for.
  401.  
  402.  
  403. Registration
  404. ════════════
  405.      If you like this program and wish to ensure that you have the latest
  406. version then you can register as a legitimate user by sending £15.00 to :-
  407. Not only will you receive the latest version but also the source code for 
  408. your enjoyment - over 200k. 
  409.  
  410.       D.Garratt,
  411.        9 Godwin Road,
  412.         Wisbech,
  413.          Cambs. 
  414.           PE13 3HR 
  415.  
  416.      Any comments whether about bugs or requests for new features will be 
  417. very welcome. 
  418.  
  419.  
  420. Bug Fixes and Improvements.
  421. ═══════════════════════════
  422.  
  423.