ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Handling errors
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Gets or sets the current drive.
JavaPHP In this version, the current drive cannot be changed.
// Get the current drive
ResCurrentDrive = fCurrentDrive()
Syntax

Getting the current drive Hide the details

<Result> = fCurrentDrive()
<Result>: Character string
Path of the current drive in the following format:
  • <drive letter>:. For example: "A:". The drive letter is written in uppercase character.
  • UNC path. For example: "\\<ServerName>\<ShareName>".
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax

Changing the current drive Hide the details

<Result> = fCurrentDrive(<Path of new current drive>)
<Result>: Character string
Path of the current drive in the following format:
  • <drive letter>:. For example: "A:". The drive letter is written in uppercase character.
  • UNC path. For example: "\\<ServerName>\<ShareName>".
<Path of new current drive>: Character string
Path of the new current drive (up to 260 characters) in the following format:
  • <drive letter>:. For example: "x:".
  • UNC path. For example: "\\<ServerName>\<ShareName>".
Remarks
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax

Handling errors

Caution: fCurrentDrive returns no error code. To determine if this function caused errors, use ErrorInfo with the errMessage constant.
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Example fCurrentDrive()
PROCEDURE DB_Inicialize(TrueFalse)

Server, User, Password, BD is string

NextTitle("Atenção")

IF TrueFalse = True THEN

PathFile is string = fCurrentDir( fCurrentDrive() ) +"\config.ini"

IF fFileExist(PathFile) = True THEN

Server = INIRead("Nagyro", "Server", "", PathFile)
IF ErrorOccurred = True AND Server = "" THEN
Error()
END

User = INIRead("Nagyro", "User", "", PathFile)
IF ErrorOccurred = True AND User = "" THEN
Error()
END

Password = INIRead("Nagyro","Password", "", PathFile)
IF ErrorOccurred = True AND Password = "" THEN
Error()
END

BD = INIRead("Nagyro", "BD", "", PathFile)
IF ErrorOccurred = True AND BD = "" THEN
Error()
END

Sincronizar = INIRead("Nagyro", "Sincronizar", "", PathFile)
IF ErrorOccurred = True AND Sincronizar = "" THEN
Error()
END

HCloseConnection(ConnNativa)

ConnNativa..Server = Server
ConnNativa..User = User
ConnNativa..Password = Password
ConnNativa..Database = BD
ConnNativa..Provider = hNativeAccessSQLServer
ConnNativa..Access = hOReadWrite
ConnNativa..ExtendedInfo = "Extended information"
ConnNativa..CursorOptions = hClientCursor

ok is boolean = HOpenConnection(ConnNativa)

IF ok = False

Info(ErrorInfo())
Close()

ELSE

Info("OK")

END

ELSE
Info("Arquivo de configuração config.ini não localizado.")
END

END

IF Sincronizar = "S" THEN
ExeRun("NET TIME \\192.168.1.180 /SET /YES",exeIconize,exeDontWait)
END
adrianoboller
24 Feb. 2015

Last update: 09/15/2024

Send a report | Local help