WoBuildResourceFilename Function

Returns the full path name for a specified resource file.

Usage

resource_file = WoBuildResourceFilename(file) 

Returned Value

file — The name of the resource file.

Keywords

Appdir — A string that specifies the application directory name. This is the directory in which the application searches for resource files, string resource files, and icon files. See the Discussion. (Default: vdatools)

Subdir — A string specifying a resource file subdirectory. See the Discussion.

Discussion

By default, the function looks for file first in directories specified by the environment variable WAVE_RESPATH. This environment variable is a colon separated list of directories, similar to the PV‑WAVE WAVE_PATH environment variable. If not found in a WAVE_RESPATH directory, the directory $WAVE_DIR/xres/!Lang/vdatools is searched, where !Lang represents the value of the !Lang system variable in PV‑WAVE.

If Subdir is specified, the file is searched for in:

<wavedir>/xres/subdir/vdatools
<wavedir>\xres\subdir\vdatools

Where <wavedir> is the main PV‑WAVE directory.

If Appdir is specified, the application searches for resources in the following directory:

<wavedir>/xres/!Lang/appdir
<wavedir>\xres\!Lang\appdir

Where <wavedir> is the main PV‑WAVE directory.

If Subdir and Appdir are specified, the application searches for resources in the following directory:

<wavedir>/xres/subdir/appdir
<wavedir>\xres\subdir\appdir

Where <wavedir> is the main PV‑WAVE directory.

If the file is not already in the resource database, the full path name is returned.

Example

The following commands are taken from the code for the WzContour VDA Tool. The full path name of the resource file for WzContour is returned and is passed to the Resource keyword of WwInit.

...
resource_file = WoBuildResourceFilename('wzcontour.ad')
top = WwInit('WzContour', 'VDATools', layout, 'WoDestroyCB',$
   Shell_name='WzContour', Layout_name='toolArea', $
   Title=unique_name, /Form, ConfirmClose='WoConfirmClose', $
   Resource=resource_file, Userdata=unique_name)
...

See Also

WoLoadResources, WoLoadStrings, WwInit

For information on environment variables and logicals used with PV‑WAVE, see the PV‑WAVE Programmer’s Guide.