3 Cases Where DIR$ Gives "Illegal Function Call" in Basic 7.00 (59430)
The information in this article applies to:
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
This article was previously published under Q59430 SUMMARY
Page 107 of the "Microsoft Basic 7.0: Language Reference" manual (for
7.00 and 7.10) incorrectly states that you can only receive "Illegal
Function Call" using the DIR$ function if you don't specify a
filespec$ the first time you call DIR$.
However, the DIR$ function returns an "Illegal Function Call" in the
following three circumstances:
- Invoking DIR$ for the first time without a filespec$ parameter
causes an "Illegal Function Call" error.
- If you invoke DIR$ with a filespec$ and no matching files are found
(it returns a null string -- ""), if you then invoke DIR$ another
time without the filespec$ parameter, you will receive an "Illegal
Function Call" error. In other words, you must call DIR$ with a
filespec$ until a match is found. After that, DIR$ can be called
again with no filespec$ to get the next filename in the list of
files found.
- Once the entire list of matched file names has been retrieved,
using DIR$ without a filespec$ correctly returns a null string
telling you that the end of the list has been reached. Invoking
DIR$ one more time after that point generates an "Illegal Function
Call." In other words, once you run out of files that matched your
original filespec$, you must call DIR$ with a filespec$ again until
another match is achieved.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | KB59430 |
---|
|