home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / fileutil / ddir5.arj / DDIR5.DOC < prev   
Encoding:
Text File  |  1991-12-13  |  8.4 KB  |  208 lines

  1. DDIR5
  2. =====
  3.  
  4. DDIR4 was made by Harron K. Appleman from the original DDIR program by
  5. Charles Petzold.  As part of the message exchange between these two
  6. programmers contained in the DDIR4.DOC file, Charles suggested that 
  7. DDIR be modified to accommodate screens longer than 25 lines.
  8.  
  9. I have made some quick (and dirty?) patches to the code of Charles and 
  10. Harron, to include a computation of the number of lines on the current 
  11. screen.  This can be done by dividing the number of _words_ of screen 
  12. memory by the number of characters per line.  Characters per line and 
  13. _#bytes_ per screen are stored in the ROM communication area at 40:4A 
  14. and 40:4C respectively, so the computation is relatively simple.  Then, 
  15. changing the screen-full-sensing code to compare with the stored 
  16. linecount will pause the screen when full.
  17.  
  18. I have tested this on two computers with 25 lines and 40 lines.  Please
  19. give it a try on your computer and let me know if you find a problem.
  20. DDIR5 should print out a full screen of directory and pause, regardless
  21. of the number of screen lines in use at the moment.
  22.  
  23. Joseph "Skip" Reymann, 
  24.  
  25.  
  26. The following is the .DOC file which was included with DDIR4.
  27.  
  28. DDIR4
  29. =====
  30.  
  31. DDIR by Charles Petzold has become another one of those PCMAG utilities that
  32. I use daily.  It resides on my system path, I use it routinely in place of
  33. DOS DIR, and I've come to take it for granted that it will always be there. 
  34. Imagine my surprise, then, when it became yet another casualty under DOS 4.0.
  35.  
  36. With help from Charles over at the PROGRAMMING/Environments forum I was able
  37. to modify DDIR so it would work under DOS 4.0 (MS-DOS 4.01 in my case).  It
  38. should still be compatible with previous versions of DOS.
  39.  
  40. This archived file contains DDIR4.COM, an immediately executable version of
  41. the new program; DDIR4.ASM, the modified source code; and, of course, this
  42. DOC file.  A copy of the communication between Mr. Petzold and me follows for
  43. those who are interested in what transpired.
  44.  
  45. Harron K. Appleman 73047,576 
  46.  
  47.  
  48. -----------------------------------------------------------------------------
  49.  
  50. #: 14086 S2/Environments [P]
  51.     03-Apr-89  15:15:37
  52. Sb: #DDIR Weirdness
  53. Fm: Harron K. Appleman 73047,576
  54. To: Charles Petzold
  55.  
  56. Charles,
  57.      As I recently related to you (when I had the problem with Key-Fake), I
  58. have switched from a vintage IBM PC running PC-DOS 3.3 to a Northgate 386
  59. running MS-DOS 4.01.  Another minor problem has cropped up, and I'd
  60. appreciate your help.  As I recall you also authored DDIR.  Look what DDIR
  61. does under my new system:
  62.  
  63. .            <DIR>     03-23-89 10:05a | PCMGNT   ARC     23103 11-16-88 12:30a
  64. ..           <DIR>     03-23-89 10:05a | PCP      ARC     30745 03-21-89 11:41a
  65. BS       BAT      2827 03-23-89  2:07a | PKATZCON ZIP     18048 03-31-89  9:50p
  66. COMPAT   SCR      8656 01-04-89 11:09p | PKZ-OPT  ZIP      8320 03-31-89  9:47p
  67. Directory of  D:\COMM\DNLD             | Volume Serial Number is 2268-10F      
  68. EXECPC   ARC      4728 03-30-89  2:59a | Volume in drive D is HARRON386_1      
  69.         9 File(s)   18089984 bytes free
  70.  
  71.      I've replaced the vertical bar extended character with "|" for this
  72. transmission, but the console output is otherwise intact.  Everything is
  73. there, just a bit scrambled.
  74.  
  75.      Any ideas?
  76.  
  77.                                                       -- Harron
  78.  
  79.  
  80. #: 14092 S2/Environments [P]
  81.     03-Apr-89  17:48:58
  82. Sb: #14086-#DDIR Weirdness
  83. Fm: Charles Petzold [PCMAG] 72241,56
  84. To: Harron K. Appleman 73047,576 (X)
  85.  
  86. Prior to DOS 4.0, the information that preceded the directory list was indented
  87. by one space.  That's how DDIR was able to exclude it when it accumulated all
  88. the file names and sorted them.  Under DOS 4.0, this information is not
  89. indented, so DDIR thinks those are more files.
  90.  
  91. The only solution to this is extensive revisions to DDIR that would recognize
  92. these non-filename strings and exclude them from the sort. At any rate, it
  93. seems to me that programs like DDIR are not required under DOS 4.0 because the
  94. shell provides similar capabilities.
  95.  
  96.                 Charles
  97.  
  98.  
  99. #: 14116 S2/Environments [P]
  100.     04-Apr-89  04:07:38
  101. Sb: #14092-DDIR Weirdness
  102. Fm: Harron K. Appleman 73047,576
  103. To: Charles Petzold [PCMAG] 72241,56 (X)
  104.  
  105. Charles,
  106.  
  107.      Thanks for the info.  I had a feeling DOS 4 was responsible for the
  108. mess-up with DDIR.
  109.  
  110.      My upgrade to MS-DOS 4.01 was not a deliberate choice.  It came with my
  111. new computer.  I haven't even tried loading the shell because I've assumed,
  112. correctly or not, fairly or not, that it's just another attempt to make DOS
  113. palatable to the micro-illiterate.  I'd rather type in a command (e.g., "DD" --
  114. my DDIR is named DD.COM) at the prompt than deal with menus.  Users like me may
  115. soon be dinosaurs with the onslaught of GUI, but that's the way I am.
  116.  
  117.      I'm going to peruse through your DDIR source code.  I think it would be a
  118. good programming exercise to see if I can make DDIR work under DOS 4.  Your
  119. input has, at least, given me a headstart.
  120.  
  121.                                                    -- Harron
  122.  
  123.  
  124. #: 14117 S2/Environments [P]
  125.     04-Apr-89  05:21:32
  126. Sb: #14092-DDIR Weirdness
  127. Fm: Harron K. Appleman 73047,576
  128. To: Charles Petzold [PCMAG] 72241,56
  129.  
  130. Charles,
  131.  
  132.      It was pretty easy.  Fortunately, all filenames are all caps, whereas
  133. non-filename strings are initial caps only.  So I just decided to check for a
  134. lower case letter in the second position.  Luck would have it that any other
  135. possible character in the second position, e.g. "." or any numeral, are all
  136. lower in ASCII value than lower case letters, which start at 61H.
  137.  
  138.                         YOUR ORIGINAL CODE
  139.                         ==================
  140.  
  141.                 Cmp     Byte Ptr DS:[SI],' '    ; See if first char is blank
  142.                 Jne     ItsAFile                ; If not, it's a file line
  143.                                                 
  144.                 Cmp     CS:[WithinFileList],1   ; See if doing file listing
  145.                 Jne     AllowTransfer           ; If not, just print stuff
  146.  
  147.                 Call    SortAndList             ; Files done -- sort and list
  148.                 Mov     CS:[WithinFileList],0   ; Not doing files now
  149.                 Jmp     Short AllowTransfer     ; So just print the stuff
  150.  
  151. ItsAFile:       Cmp     CS:[FileCounter],528    ; See if 11 buffer filled up
  152.                 Jb      NotTooManyFiles         ; If not just continue
  153.  
  154.  
  155.                         MY MODIFICATION
  156.                         ===============
  157.  
  158.                 Cmp     Byte Ptr DS:[SI],' '    ; See if first char is blank
  159.                 Jne     CheckForFile            ; If not, check 2nd char
  160.  
  161. Resume:         Cmp     CS:[WithinFileList],1   ; See if doing file listing
  162.                 Jne     AllowTransfer           ; If not, just print stuff
  163.  
  164.                 Call    SortAndList             ; Files done -- sort and list
  165.                 Mov     CS:[WithinFileList],0   ; Not doing files now
  166.                 Jmp     Short AllowTransfer     ; So just print the stuff
  167.  
  168. CheckForFile:   Cmp     Byte Ptr DS:[SI+1],61H  ; See if 2nd char is lower 
  169.                 Jge     Resume                  ; case -- if so, not a file
  170.  
  171. ItsAFile:       Cmp     CS:[FileCounter],528    ; See if 11 buffer filled up
  172.                 Jb      NotTooManyFiles         ; If not just continue
  173.  
  174.  
  175. This may be simplistic, but it's two additional lines of code plus a label,
  176. and it seems to work.
  177.  
  178.                                                         -- Harron
  179.  
  180.  
  181. #: 14125 S2/Environments [P]
  182.     04-Apr-89  14:55:36
  183. Sb: #14117-DDIR Weirdness
  184. Fm: Charles Petzold [PCMAG] 72241,56
  185. To: Harron K. Appleman 73047,576
  186.  
  187. OK, looks good.  I hope you're going to upload the new DDIR (call it DDIR4 or
  188. something like that) so others can use it.
  189.  
  190. Now how about modifying the program so it works right with 43 and 60 line
  191. screens?  <grin>
  192.  
  193.                 Charles
  194.  
  195.  
  196. Charles,
  197.  
  198.      Hey, look, I like this stuff, but I'm no masochist.  I'll leave the
  199. DDIR4_43_60 exercise for someone else with more knowledge and time and on
  200. their hands.
  201.  
  202.      In the meantime I'll upload DDIR4.ARC (DDIR4.ASM, DDIR.COM, and a copy
  203. of this thread) over at UTILFORUM.
  204.  
  205.      Thanks for the assistance.
  206.  
  207.                                                      -- Harron
  208.