It's been a long while since I programmed in PBCC, and I decided to just jump into PBCC 5.0. I have not tried this in any prior versions...
Objective:
Rename a subdirectory, BUT FIRST check it for the presence of a specific file.
Code:
The NAME command always fails on Error 70: Permission Denied. If I just run the NAME command without the DIR$ test (and without the IF), the command completes without any error. So DIR$ is somehow locking the subdir...?
...OK, so I located the DIR$ CLOSE statement, and if executed before the NAME command, there is no error.
HOWEVER, this necessary follow-up step is not explained under DIR$ in the Help File. I think it should be mentioned there, and under other affected commands, such as NAME... Also, the DIR$ explanation should mention how other commands can be affected. (Is NAME the only command so affected?)
Also, I have not been able to get DIR$(Mask$, ONLY %SUBDIR) to work.
The compiler complains that the %SUBDIR equate is not defined. If I define it myself, it works just fine.
HOWEVER, from the chart presented in the DIR$ help section, I thought that the DIR$-specific equates are pre-defined to PBCC; nothing indicates the programmer needs to define them (or of any requirement to INCLUDE Win32API.INC?).
Here, too, I believe such requirements imposed on the programmer should be mentioned explicitly.
Or am I just so far behind the times that everyone else already knows these things?
-John
Objective:
Rename a subdirectory, BUT FIRST check it for the presence of a specific file.
Code:
Code:
x = DIR$("c:\MySub\IS_THE_ONE.txt") IF x <> "" THEN NAME "c:\MySub" AS "c:\MySub_Other" END IF
...OK, so I located the DIR$ CLOSE statement, and if executed before the NAME command, there is no error.
HOWEVER, this necessary follow-up step is not explained under DIR$ in the Help File. I think it should be mentioned there, and under other affected commands, such as NAME... Also, the DIR$ explanation should mention how other commands can be affected. (Is NAME the only command so affected?)
Also, I have not been able to get DIR$(Mask$, ONLY %SUBDIR) to work.
The compiler complains that the %SUBDIR equate is not defined. If I define it myself, it works just fine.
HOWEVER, from the chart presented in the DIR$ help section, I thought that the DIR$-specific equates are pre-defined to PBCC; nothing indicates the programmer needs to define them (or of any requirement to INCLUDE Win32API.INC?).
Here, too, I believe such requirements imposed on the programmer should be mentioned explicitly.
Or am I just so far behind the times that everyone else already knows these things?
-John
Comment