Article ID: 113252
Article Last Modified on 10/13/2003
ReplaceListItem szExtras$, ASC(MID$(GetWindowsDir(), 1, 1)) -
ASC("A") + 1, STR$(4096)
The MID$ function call creates a substring of length 1 and starting at
position 1 of the string returned by GetWindowsDir(). This substring will
be the drive letter of the drive from which Windows was started. The ASC
function call generates the numeric ASCII code for this character. Then the
numeric ASCII code for "A" is subtracted from this number. The script
expects the result of this to be between 0 and 25, and it increments this
number by 1 and uses it as an index into the szExtras$ list, which contains
26 items. If GetWindowsDir() returns an uppercase string, the result of the
subtraction will indeed be between 0 and 25. However, if GetWindowsDir()
returns a lowercase string, the result will be out of range.
ReplaceListItem szExtras$, ASC(MID$(GetWindowsDir(), 1, 1)) -
ASC("A") + 1, STR$(4096)
to the following:
ReplaceListItem szExtras$, ASC(MID$(UCASE$
(GetWindowsDir()), 1, 1)) - ASC("A") + 1, STR$(4096)
This will capitalize the value returned from GetWindowsDir(). If the
Windows directory is on drive C, this code will subtract "A" from "C", and
then add 1, resulting in a value of 3. The szExtras$ symbol has items 1-26,
one for each possible drive letter. The value 3 is a valid item in this
list.
Additional query words: 2.00 buglist2.00
Keywords: kbbug KB113252