I'm trying to run the following test snippet in the BIBM boot environment (from a BIBM bootable flash drive) and am hoping someone could tell me why I'm erroring out. I've combed through it several times, but as far as I can tell I'm following the TBOSDT manual p. 64 code, except I'm not trying to loop the snippet--I can't get that far. Right now I'm just trying to see if a single go will work with easily visible, hard-coded numbers for parameters, and can't even do that.
Actually there are two problems, one annoying but trivial, the other significant.
1: trivial issue
-----------------
The trivial problem is with the newline text feature in printl. It's giving me a newline down one line exactly onscreen where the previous one ends. So in the first printl() in the snippet...
"the HD number is " # vHD.num # ",^Nso the script should proceed to mount the drive",
...what the user sees onscreen is "the HD number is [X]," and then there is a newline, but it has a bunch of blank space all the way out to where the "[X]," is. Except of course the "[X]" is a line ABOVE the new line, so the real new line --the actual text--doesnt start just one line down but also doesn't appear until the blank space reaches a point corresponding to the ending comma of the previous line. Very odd, and makes the newline feature useless.
2: important issue
----------------------
I can live without newlines if necessary. More importantly, the first debug message--"the HD number is"--correctly reports the HD number as 0, so apparently getHDinfo() worked, but then Mount command won't execute. The error message I get is "Invalid parameter: vHD.num:". I have five physical disks attached to my system, by the way, and BIBM sees them correctly, so the problem is not that there's no disk to be found.
I can't see why I'm getting this message. If I run the plain command "mount 0: 0 1" out in TBOSDT, it works just fine, and that's exactly what I'm telling tbscript to do here--right?
sub main()
GetDrvLtrInfo()
vHD=GetHdInfo(0)
vPartitionNum=1
; THE SCRIPT EXECUTES THIS MESSAGE CORRECTLY (NEWLINE PROBLEM ASIDE, AT LEAST)...
printl("the HD number is " # vHD.num # ",^Nso the script should proceed to mount the drive.")
; ...THEN GOES INTO THE LOOP...
while vHD
; ...AND ERRORS OUT AT THIS LINE:
ext("mount vHD.num: vHD.num vHD.partition[vPartitionNum]")
vCheckpath=CHDIR(vHD.partition[vPartitionNum]#":\Windows\")
If vCheckpath=0
then vSyspath=GETCWD()
else ext("umount vHD.num:")
End if
printl (vSyspath now holds "#vSyspath#"^N--but if there was nothing at the end of the line above, the .partition[X] method^n didn't work to create a path.")
wend
end sub
The same problem seems to raise its head later at unmount; I get an "Unexpected 'ext'" error reported for line 20, which is the umount line. The script seems to error out at that point, since the final printl() does not get executed.
By the way, HD0/partition 1 should yield the path I'm looking for (the Windows system folder). if I code a different number into GetHDinfo(), e.g. 1, I still get the same "Invalid parameter: vHD.num:" error, but instead of "Unexpected 'ext'", the second error message tells me I don't have a proper End If. Can't make heads or tails of this.
By the way, as the rest of the code indicates, I want to end up checking the mounted drive for the [DRIVE]:\Windows directory and return that as a value to a variable, then keep the drive mounted for operations with that path, unmounting the drive only if it didn't contain the directory in question. If anyone can see yet other problems with this--i.e. with the CHDIR code, I'd love to know prior to undertaking yet more hours debugging.