Console Compiler 2 Bug still exists
Lance,
Thanks for the reply. I tried your code on my system
running Windows ME, and it failed!
An interesting twist though, is that I tried your code on an old
system I have here that's running Windows 98SE with partial success.
Under Windows 98SE, it worked on the 120 character long filename in
the code below. But on filenames longer than 124 characters, it too
failed!
Anyone else want to try to find a way around this problem?
Thanks,
Anon
--- Previous Reply from Lance ---
I tested your code and a variation that targets the NAME statement
explicitly. I tested this under Windows 2000, and it creates and
renames the exact file name you specified, without any errors.
Try this for yourself:
FUNCTION PBMAIN
c$ = CURDIR$
c$ = RTRIM$(c$, "\") + "\"
a$="(AM_Gold_Series)_(AM_Gold_The_Mid_1960's_Classics)_Dusty_Springfield_-_I_Only_Want_To_Be_With_You,_File_185_(01_17)_.mp3"
OPEN c$ + a$ FOR OUTPUT AS #1
PRINT #1, "test"
CLOSE #1
b$ = a$
REPLACE "_" WITH " " IN b$
NAME c$ + a$ AS b$
a$ = DIR$(b$)
PRINT c$ + a$
WAITKEY$
END FUNCTION
Note that this code does not perform any error testing, and I note
that your code does not test for an error immediately after the NAME
statement either. Maybe you could try adding:
ON ERROR GOTO DISPERR
To your code (and probably an appropriate RESUME statement if you want
to retry after an error).
BTW, which operating system are you using to test your code with?