Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
|
No problem - we're here because we enjoy this. 
You, however, do have one small problem.. Let me try to clarify a bit.
"$aSysInfo" is a array, basically a list of related data accessed by an index. Think of one column in a spreadsheet - a variable called $COL_A contains data in 20 rows. In Excel, the rows are numbered 1-20, but in Kix (and most programming languages) arrays are numbered 0-19. This is called "Zero-Based".
Think of the $aSysInfo in terms of a column in a spreadsheet for a moment. Cells 30-34 contain lists of information about drives - "C:,D:,E:" in one, and "14981948109,12390419843,13893049" in the next. Thus, your brain can associate the C: with 14981948109 bytes in the next row; D: with 12390419843, and so on. The computer needs to do it a bit differently. The section of your code that looks like $D_Letters = Split($aSysInfo[32], ',') takes the comma-delimited text string from the 32nd array element and creates a new array called D_Letters. Each element in this array has one drive letter. Since we're doing that for each of these lists, we have several arrays. (consider the spreadsheet, where columns M, N, O, and P represent these vars, and rows 1-3 represent the values. So M1 holds "C:", N1 holds the capacity, O1 holds the freespace, and so on..)
I see that you added a new array $D_VolumeName. This - in effect - altered the spreadsheet model by inserting a new column, but your new column is "hidden". 
Right after we split the drive data strings into individual arrays, we assume that $D_Letters contains one element for each drive letter. Using a For/Next loop, we iterate all of the element values of the drive data arrays using the $Index var. Right after the "For $Index" line are statements that format and output the various array values (note that each one is referenced as $arrayname[$INDEX]). Each of these lines pad the array value with spaces, but then trim it to a specific length. What you're missing is a reference to the new array you created. If you use the first line as a model, you should be able to add the labels the same way, although you'll need to adjust the spacing of the header as well. Each column is 15 chars wide.
< Stop reading here if you want to think about the solution yourself >
So - bottom line - you've correctly referenced the VolumeLabels string from the array, and split it into individual items, but you haven't output it. Copy the "Left($D_Letters".. line, paste a new copy below it, and change the var name to $D_VolumeName and you should be good to go.
Glenn
_________________________
Actually I am a Rocket Scientist!
|