PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Managing the errors
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 or modifies the current disk.
JavaPHP In this version, the current disk cannot be modified.
// Find out the current disk
ResCurrentDisk = fCurrentDrive()
Syntax

Find out the current disk Hide the details

<Result> = fCurrentDrive()
<Result>: Character string
Path of the current disk 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 QueriesAjaxUser code (UMC)

Modifying the current disk Hide the details

<Result> = fCurrentDrive(<Path of New Current Disk>)
<Result>: Character string
Path of the current disk 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 Disk>: Character string (with quotes)
Path of the new current disk (up to 260 characters) in the following format:
  • <drive letter>:. For example: "x:".
  • UNC path. For example: "\\<ServerName>\<ShareName>".
Remarks
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)

Managing the errors

Caution: fCurrentDrive returns no error code. To find out whether errors have been generated by this function, use ErrorInfo associated with the errMessage constant.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Java wd230java.jar
Minimum required version
  • 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
Feb. 24 2015