restricting the ability of users to change directories with TD_GetFile

According to the Manual, TD_GetFile will or won't let users change directories depending on the setting of changedir. Here is the relevant section from p. 213.

File Open Box
CALL TD_GetFile (type$, filename$, changedir)
TD_GetFile displays a typical file open dialog box. The list of file names displayed may be limited with the first argument. ... The selected file name is returned in filename$. If changedir = 0, the user is not allowed to change directories in the course of searching for the desired file name. If changedir = 1, the user may change directories.

Unfortunately, it doesn't seem to work that way, as users can change directories in either case. Changedir = 0 returns a filename with a full path, while changedir = 1 returns a filename with no path information. This is useful, and I'm glad this option is there; but obviously, it would be nice to update the manual so that it reflects what TD_GetFile actually does.

My problem, however, is that I have a program in which users need to select two data files, and the second one must be in the same directory as the first. So I need the feature that is described but not there: The first time TD_GetFile is called, the user can change directories; the second time, the user can't. Is there some way to do this?


Bill Roberts



I confirm that Td_Getfile seems to ignore the changedir setting. I guess what I would try and do is to capture the full directory when the user loads the first data file. You can then check the second file's directory against the first and flag the event if the directories don't match. Even easier would simply be to put in a dialog box before the TD_Getfile command that tells the user that both files must be in the same directory.