- Jun
- 760
- 16
The GOSUB command is supposed to support an optional filename to indicate that the subroutine is to be found in another file. In my experience, the filename specification is not properly parsed. Specifically, directory aliases are not expanded. I wrote something like:
That resulted in an error message that the file "bat:position.dat" could not be found. If I changed the command to the following, it worked:
Since GOSUB is a TCC command, it really ought to recognize directory aliases, extended parent directories, etc.
The documentation could also be improved by providing more details about the requirements for "filename". When "bat:position.dat" failed, I thought that perhaps the file had to have an extension of btm, bat, or cmd. Does the file always have to have a full path? If not, how is the file found? Does the calling batch file look in the directory in which the calling batch file resides? The drive and directory from which the calling batch file was called? Is a file extension required, or does TCC look for default extensions in some specified order?
gosub "bat:position.dat" label args
That resulted in an error message that the file "bat:position.dat" could not be found. If I changed the command to the following, it worked:
gosub "%@full[bat:position.dat]" label args
Since GOSUB is a TCC command, it really ought to recognize directory aliases, extended parent directories, etc.
The documentation could also be improved by providing more details about the requirements for "filename". When "bat:position.dat" failed, I thought that perhaps the file had to have an extension of btm, bat, or cmd. Does the file always have to have a full path? If not, how is the file found? Does the calling batch file look in the directory in which the calling batch file resides? The drive and directory from which the calling batch file was called? Is a file extension required, or does TCC look for default extensions in some specified order?