These two lines:
Right(' ' + $D_Capacities[$Index], 15)
Right(' ' + $D_FreeSpace[$Index], 15)
take the capacity and freespace STRING values, left pad them with spaces, and then take the rightmost 15 characters. Thus, it formats and displays in one step. To convert the bytes to K, M, or GBytes, you need to divide the numeric value by the appropriate value.
Keep in mind that the byte values are strings, so need to be converted to numbers. Since the actual values could exceed the limits of integer processing, we convert them to doubles, then divide by MB. As I indicated in my prior post, you can replace these lines with my example:
Right(' ' + (CDbl($D_Capacities[$Index]) / 1048576.0), 15)
Right(' ' + (CDbl($D_FreeSpace[$Index]) / 1048576.0), 15)
The byte values are converted to double-precision numbers, divided by 1MB, then appended to a string of 15 spaces, then trimmed to 15 spaces. This "padding" makes the numbers right-justified in a 15-char wide column.
Note the ".0" at the end of the 1MB divisor - this assures that the division is DBL / DBL, maintaining precision. Kix automatically converts the result to a string, since a string is the first type being combined with the result of the calculation inside the quotes.
Glenn
_________________________
Actually I
am a Rocket Scientist!