PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example of extracted path
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns the different elements of a path: disk, directories, name and extension of the file.
Versions 16 and later
Universal Windows 10 App This function is now available for Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for Windows Phone applications.
Universal Windows 10 App This function is now available for Windows Phone applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVJavaUser code (UMC)
sFilePath is string
sResFileName is string
sResPathName is string

sFilePath = "C:\MyDirectories\File.doc"

// Retrieve the name of the file
sResFileName = fExtractPath(sFilePath, fFileName)
// sResFileName corresponds to "File"

// Retrieve the disk and path of the file
sResPathName = fExtractPath(sFilePath, fDrive + fDirectory)
// sResPathName corresponds to "C:\MyDirectories\"
WINDEVJavaUser code (UMC)
// Use of UNC paths
Trace(fExtractPath("\\lg-br\sharedfiles\downloads\WINDEV\setup.exe", fDrive))
// Returns \\lg-br\sharedfiles
Trace(fExtractPath("\\lg-br\sharedfiles\downloads\WINDEV\setup.exe", fDirectory))
// Returns \downloads\WINDEV\
Syntax
<Result> = fExtractPath(<File path> , <Path section to extract>)
<Result>: Character string
  • Requested path section,
  • Empty string ("") if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
<File path>: Character string (with quotes)
Name and full (or relative) path of file (up to 260 characters). A UNC path can be used. The existence of <File path> is not checked by fExtractPath. If the path does not end with a "\" character, the last element is considered as being a file.
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
WindowsLinux This parameter can be in Ansi or Unicode format.
Versions 16 and later
Universal Windows 10 App Windows Phone: The file path corresponds to a relative path in relation to the current directory. The current directory corresponds to the data directory of application.
Reminder: Only the files found in the data directory associated with the application can be handled.
New in version 16
Universal Windows 10 App Windows Phone: The file path corresponds to a relative path in relation to the current directory. The current directory corresponds to the data directory of application.
Reminder: Only the files found in the data directory associated with the application can be handled.
Universal Windows 10 App Windows Phone: The file path corresponds to a relative path in relation to the current directory. The current directory corresponds to the data directory of application.
Reminder: Only the files found in the data directory associated with the application can be handled.
<Path section to extract>: Constant or combination of constants
Section of file path to extract:
fDriveName of the unit.
Linux This constant is not available.
fExtensionExtension of the file, preceded by "."
fFileNameName of the file (without extension).
fDirectoryDifferent directories of the file (the file name and extension are not returned).
Remarks
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Example of extracted path

If the specified path is "C:\Temp\Data\File.txt", fExtractPath returns:
  • fExtension: .txt
  • fFileName: File
  • fDirectory: \Temp\Data\
  • fDrive: C:
  • fFileName+fExtension: File.txt
  • fDirectory+fFileName: \Temp\Data\File
  • etc.
Component : wd250std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video FextractPath
https://youtu.be/pOujawO1cVo
https://windevdesenvolvimento.blogspot.com/2019/09/dicas-2291-windev-webdev-mobile.html
// BTN_ABRE_DOCUMENTO
extensao_arquivo is string=fExtractPath(TABLE_ARQUIVOS.COL_ARQUIVO,fExtension)
IF extensao_arquivo=".txt" THEN
ShellExecute(TABLE_ARQUIVOS.COL_ARQUIVO)
ELSE
OpenDocument(TABLE_ARQUIVOS.COL_ARQUIVO)
END
amarildo
15 Sep. 2019