TrueFileName$() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns a full file specification, given a partial specification. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

TrueFileName$( file_spec )

file_spec is a string representing a partial file specification (for example, "C:PARCELS.TAB")

Description

This function returns a full file specification (including full drive name and full directory name), given a partial specification.

In some circumstances, you may need to process a partial file specification. For example, on a DOS system, the following file specification is partial (it includes a drive letter, C:, but it omits the current directory name):

"C:parcels.tab" 

If the current directory on drive C: is "\mapinfo\data" then the following function call:

TrueFileName$("C:parcels.tab")

returns the string:

"C:\mapinfo\data\parcels.tab"

If your application prompts the user to type in the name of a hard drive or file path, you may want to use TrueFileName$() to expand the path entered by the user into a full path.

The TrueFileName$() function does not verify the existence of the named file; it merely expands the partial drive letter and directory path. To determine whether a file exists, use the FileExists() function.

See Also:

ProgramDirectory$() function