I am meeting seemingly insurmountable opposition from QuickBasic 4.5
(Win98SE)
in two specific tasks within a large program.
1. Accessing folders, and moving between them ...
There are eight folders below a first level folder on a drive, let's call
them
E:\2BAS\A through E:\2BAS\H. These folders had names of people ("Bob
Blue") or
organisations ("Northern Star"). Each had a file with a common name
("Target.xxx") which I needed to access, extract some internal
information, and
then rename.
QB didn't like "Bob Blue" as a folder name, error 76 "Path not found" so I
replaced the space with an underscore in each folder name. The path
E:\2BAS\Bob_Blue was now acceptable.
Then came the problem of the foldername exceeding 8 chars. Bob_Blue was
fine
but Bob_Brown and the other six foldernames which were >8 chars weren't,
so
within the program that became Bob_Br~1 and QB was again kept happy, ...
except that Northe~1 kept giving an error 76. Typos have been excluded as
a
cause. I haven't yet tried changing the foldername completely, but all
the
other names such as John_C~1 work fine. It seems that this particular
name is
the problem.
2. Renaming the target file ....
The file/path string for reading the target file is valid and the
reading/extraction process works fine. But executing a command:
NAME "E:\2BAS\Bob_Br~1\Target" as "E:\2BAS\Bob_Br~1\NewName"
gives an error 64 "Bad file name". I am presuming this comes about
because
NewName$ contains "...\Bob_Br~1\ ..." but I'm far from 100% on that.
Is there a way - elegant or otherwise - to actually issue the equivalent
of a
PATH statement so that the rename command is cleaned up and becomes
NAME "Target.xxx" as "NewName.xxx"
?
Any constructive suggestions how to cir***vent these problems would be
appreciated.


|