GetCurrentPath$() 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 the path location used by a MapInfo Pro File dialog. Each type of table or file has its own remembered location.

You can call this function from the MapBasic window in MapInfo Pro.

Syntax

GetCurrentPath$( current_path_id )

current_path_id is one of the following values:

	PREFERENCE_PATH_TABLE (0)
	PREFERENCE_PATH_WORKSPACE (1)
	PREFERENCE_PATH_MBX (2)
	PREFERENCE_PATH_IMPORT (3)
	PREFERENCE_PATH_SQLQUERY (4)
	PREFERENCE_PATH_THEMETHEMPLATE (5)
	PREFERENCE_PATH_MIQUERY (6)
	PREFERENCE_PATH_NEWGRID (7)
	PREFERENCE_PATH_CRYSTAL (8)
	PREFERENCE_PATH_GRAPHSUPPORT (9)
	PREFERENCE_PATH_REMOTETABLE (10)
	PREFERENCE_PATH_SHAPEFILE (11)
	PREFERENCE_PATH_WFSTABLE (12)
	PREFERENCE_PATH_WMSTABLE (13)

Return Value

String

Description

Given the ID of a special MapInfo Preference directory, the GetCurrentPath$() function returns the path of the directory. An example of a special MapInfo directory is the default location to which MapInfo Pro writes out new native MapInfo tables.

Note: The return value changes each time a user changes the path location in the dialog and completes the operation (cancels do not count).

Example

Copy this example into the MapBasic window for a demonstration of this function.

include "mapbasic.def"
declare sub main
sub main
dim sMiPrfFile as string
sMiPrfFile = GetCurrentPath$( PREFERENCE_PATH_WORKSPACE)
Print sMiPrfFile 
end sub

See Also:

GetPreferencePath$() function