Topic: Extended File_Open(): with Search Path (1 of 1), Read 15 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Wednesday, February 11, 2004 08:10 AM


Some days ago Pauli Lindgren expressed a feature wish for the "Open file at cursor" command.

It should be possible to have a search path (for C include files in this case) which is walked through when trying to open the file.

I answered that it would be a too special case for OPENCURS.VDM (IMHO).

But anyway: That feature really could be a nice thing.
So I coded it as an additional macro.
It can be used for custom modifications of OPENCURS and perhaps many other solutions.

From the macro's docu:

// Extends the File_Open() command with a search path.
//
// The search path is given in T-Reg 103 and the filename in T-Reg 104.
// If the file is found in one of the given directories that one is opened.
// Otherwise the standard File_Open() is used, which looks in the current
// directory, opens the file if existing or creates a new one there.

So you can use it like:

Reg_Set(103,'"C:\", "C:\xxx\vedit", "C:\xxx\test with space\", "C:\xxx\test tdir\", "C:\temp"')
Reg_Set(104,"TestFile.txt")
Call_File(100, "FileXOpen.vdm")

Christian

 
FILEXOPEN.VDM (3KB)