ApplicationDirectory$() 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 string containing the path from which the current MapBasic application is executing. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

ApplicationDirectory$()

Return Value

String expression, representing a directory path.

Description

By calling the ApplicationDirectory$() function from within a compiled MapBasic application, you can determine the directory or folder from which the application is running. If no application is running (e.g., if you call the function by typing into the MapBasic window), ApplicationDirectory$() returns a null string.

To determine the directory or folder where the MapInfo Pro software is installed, call the ProgramDirectory$() function.

Example

Dim sAppPath As String 
sAppPath = ApplicationDirectory$() 
' At this point, sAppPath might look like this: 
' 
' "C:\MAPBASIC\CODE\"

See Also:

ProgramDirectory$() function, ApplicationName$() function