home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 16 / 16.iso / t / t200 / 1.img / CLUS_PDQ.BAS < prev    next >
Encoding:
BASIC Source File  |  1993-11-13  |  4.7 KB  |  156 lines

  1. '******************************CLUSTER.BAS*******************************
  2. '
  3. 'I'm Getting a 535 MB Hard drive. Want to know how to use FDISK.EXE to
  4. 'partition it most effectively. Most files are NOT 8K (8192 bytes) long
  5. 'and only one file fits per cluster. Using 8K Clusters on a 100 MB drive
  6. 'gave me 12 MB (sic) of "Slack Space"; Using MS-DOS 5.0 (or greater)
  7. 'with FDISK.EXE and reformating the drive gave me 2 K Clusters and regained
  8. '6 MegaByte&s of disk space... Worth doing.... If you are the fearless type
  9. 'and have really and truly backed up your hard drive to TWO tapes and run
  10. 'the tape compare on BOTH of them.
  11. '
  12. 'John De Palma on CompuServe 76076,571
  13. '11/12/93
  14. 'can't compile with PDQ because of:
  15. 'Exteral error with Setborder because it was in BORDER2.BAS with a
  16. 'different TYPE declaration, putting it here makes it work!, now to fix
  17. 'the next two errors
  18. 'B$USNG error "Print Using"  <--- fixed
  19. 'B$POW4 error "Raising a number to a power"  <--- fixed
  20. 'fixed the SETBORDER ERROR had to change the USER DEFINED TYPE to the
  21. 'PDQ one and make it a sub here, though not sure that was necessary
  22. DECLARE SUB SetBorder (ColrByte%)
  23. DEFINT A-Z
  24. '$INCLUDE: 'PDQDECL.BAS'
  25.  
  26. 'DEFLNG A-Z
  27. COLOR 15, 1
  28. CLS
  29. 'KiloByte& = 2 ^ 10
  30. 'MegaByte& = 2 ^ 20
  31. 'EightKCluster& = 2 ^ 13
  32. 'FourKCluster& = 2 ^ 12
  33. 'TwoKCluster& = 2 ^ 11
  34. CONST Row% = 2
  35. 'NumberPerMega& = MegaByte& / EightKCluster&
  36. CALL SetBorder(13)
  37. text$ = "Cluster Size vs Hard Drive Size"
  38. LOCATE Row%, 41 - LEN(text$) / 2, 0
  39. COLOR 11, 0: PRINT text$
  40. text$ = "-ALMOST- Every Thing you Need to Know about Clusters..."
  41. LOCATE Row% + 1, 41 - LEN(text$) / 2
  42. COLOR 11, 2: PRINT text$
  43. text$ = "Or... How many Hard Drive Partitions to Make with 2K Clusters"
  44. COLOR 11, 3: LOCATE Row% + 2, 41 - LEN(text$) / 2
  45. PRINT text$
  46.  
  47. COLOR 15, 1
  48. LOCATE Row% + 4, 10
  49. PRINT "One KiloByte equals: "; TAB(55); "1024"; " bytes"
  50. LOCATE Row% + 5, 10
  51. PRINT "One MegaByte equals: "; TAB(50); "1,048,576"
  52. LOCATE Row% + 7, 10
  53. PRINT "Eight K Cluster equals: "; TAB(55); "8192  bytes"
  54. LOCATE Row% + 8, 10
  55. PRINT "Four  K Cluster equals: "; TAB(55); "4096"
  56. LOCATE Row% + 9, 10
  57. PRINT "Two   K Cluster equals: "; TAB(55); "2048"
  58. LOCATE Row% + 11, 10
  59. PRINT "Eight K Clusters per MB is: "; TAB(56); "128   Number"
  60. LOCATE Row% + 12, 10
  61. PRINT "Four  K Clusters per MB is: "; TAB(56); "256"
  62. LOCATE Row% + 13, 10
  63. PRINT "Two   K Clusters per MB is: "; TAB(56); "512"
  64.  
  65. 'use integer divisor to round down
  66.  
  67. LOCATE Row% + 15, 10
  68. PRINT "Max Hard disk size with 2 MB clusters is: "; TAB(56); : COLOR 11 + 16, 1: PRINT "127"; : COLOR 15, 1: PRINT " MB"
  69. COLOR 15, 1
  70. LOCATE Row% + 16, 10
  71. PRINT "Max Hard disk size with 4 MB clusters is: "; TAB(56); "255 MB"
  72. LOCATE Row% + 17, 10
  73. PRINT "Max Hard disk size with 8 MB clusters is: "; TAB(56); "511 MB"
  74.  
  75. text$ = "MAXIMUM Number of Clusters = 65,518"
  76. LOCATE Row% + 20, 41 - LEN(text$) / 2
  77. COLOR 11, 0: PRINT text$
  78. text$ = "Press any key to END..."
  79. LOCATE Row% + 21, 41 - LEN(text$) / 2
  80. COLOR 14, 6: PRINT text$
  81. text$ = "John De Palma on CompuServe 76076,571"
  82. LOCATE 25, 41 - LEN(text$) / 2
  83. COLOR 11, 0: PRINT text$;
  84. WHILE INKEY$ <> "": WEND                'clear keyboard
  85. DO
  86. kee$ = INKEY$
  87. LOOP UNTIL LEN(kee$)                    'pause
  88. LOCATE , , 1
  89. CALL SetBorder(0)
  90. 'This file was last compiled with:
  91. 'BC C:\QB45\PDQ\CLUS_PDQ.BAS  /o;
  92. 'LINK CLUS_PDQ+
  93. '     C:\QB45\PDQ\_NOERROR C:\QB45\PDQ\_CPRINT C:\QB45\PDQ\_NOVAL C:\QB45\PDQ\_NOREAD+
  94. '     /nod /noe /packcode /far
  95. '
  96. '     nul
  97. '     C:\QB45\PDQ\PDQ
  98. 'This file was last compiled with:
  99. 'BC C:\QB45\PDQ\CLUS_PDQ.BAS  /o /d;
  100. 'LINK CLUS_PDQ+
  101. '     C:\QB45\PDQ\_CPRINT+
  102. '     /nod /noe /packcode /far
  103. '
  104. '     nul
  105. '     C:\QB45\PDQ\PDQ
  106.  
  107. 'This file was last compiled with:
  108. 'BC C:\QB45\PDQ\CLUS_PDQ.BAS  /o;
  109. 'LINK CLUS_PDQ+
  110. '     C:\QB45\PDQ\_CPRINT+
  111. '     /nod /noe /packcode /far /ex
  112. '
  113. '     nul
  114. '     PDQ
  115. 'This file was last compiled with:
  116. 'BC C:\QB45\PDQ\CLUS_PDQ.BAS  /o;
  117. 'LINK CLUS_PDQ+
  118. '     C:\QB45\PDQ\_CPRINT+
  119. '     /nod /noe /packcode /far /ex
  120. '
  121. '     nul
  122. '     PDQ
  123.  
  124. 'This file was last compiled with:
  125. 'BC C:\QB45\PDQ\CLUS_PDQ.BAS  /o;
  126. 'LINK CLUS_PDQ+
  127. '     C:\QB45\PDQ\_CPRINT+
  128. '     /nod /noe /packcode /far /ex
  129. '
  130. '     nul
  131. '     PDQ
  132.  
  133. SUB SetBorder (ColrByte%) STATIC
  134. DIM Regs AS RegType
  135. Regs.ax = &H1001
  136. Regs.bx = ColrByte% * &H100
  137. CALL INTERRUPT(&H10, Regs)
  138. END SUB
  139.  
  140. 'This file was last compiled with:
  141. 'BC C:\QB45\PDQ\CLUS_PDQ.BAS  /o;
  142. 'LINK CLUS_PDQ+
  143. '     C:\QB45\PDQ\_NOERROR C:\QB45\PDQ\_CPRINT C:\QB45\PDQ\_NOVAL C:\QB45\PDQ\_LOCATE C:\QB45\PDQ\_NOREAD+
  144. '     /nod /noe /packcode /far
  145. '
  146. '     nul
  147. '     C:\QB45\PDQ\PDQ
  148. 'This file was last compiled with:
  149. 'BC C:\QB45\PDQ\CLUS_PDQ.BAS  /o;
  150. 'LINK CLUS_PDQ+
  151. '     C:\QB45\PDQ\_CPRINT+
  152. '     /nod /noe /packcode /far /ex
  153. '
  154. '     nul
  155. '     PDQ
  156.