AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Example: Opening an external file
  • Example: Opening and/or creating an external file
  • Example: Opening an external file (WEBDEV)
  • Example: Opening and/or creating an external file (WEBDEV)
Example: Opening an external file
WINDEVReportes y ConsultasJavaCódigo de Usuario (UMC)
The following code is used to open an external file. The file is opened in read/write mode. The file name and path are selected by fSelect.
// Declare the variables
FileNameAndPath is string
FileID is int
// Select the file name and path
FileNameAndPath = fSelect("", "", "Selecting an external file", ...
"External file" + TAB + "*.txt", "txt", fselCreate)
// Open file
FileID = fOpen(FileNameAndPath, foReadWrite)
// Display an error message if the opening was not performed
IF FileID = -1 THEN
  Error(ErrorInfo(errMessage))
ELSE
  // Processes in the opened file
  ...
  // End of processes
END
Example: Opening and/or creating an external file
WINDEVReportes y ConsultasJavaCódigo de Usuario (UMC)
The following code is used to open and/or to create an external file. The file is opened in read/write mode. The file name and path are selected by fSelect. If the file already exists, this file will not be re-created (foCreateIfNotExist constant).
// Declare the variables
FileNameAndPath is string
FileID is int
// Select the file name and path
FileNameAndPath = fSelect("", "", "Selecting an external file", ...
"External file" + TAB + "*.txt", "txt", fselCreate)
// Open file
FileID = fOpen(FileNameAndPath, foReadWrite + foCreateIfNotExist)
// Display an error message if the creation was not performed
IF FileID = -1 THEN
  Error(ErrorInfo(errMessage))
ELSE
  // Processes in the opened file
  ...
  // End of processes
END
Example: Opening an external file (WEBDEV)
WEBDEV - Código ServidorPHPAjax
The following code is used to open an external file. The file is opened in read/write mode.
// Declare the variables
FileNameAndPath is string
FileID is int
// Select the file name and path
FileNameAndPath = "C:\MyDirectories\File.txt"
// Open file
FileID = fOpen(FileNameAndPath, foReadWrite)
// Display an error message if the opening was not performed
IF FileID = -1 THEN
Error(ErrorInfo(errMessage))
ELSE
// Processes in the opened file
...
// End of processes
END
Example: Opening and/or creating an external file (WEBDEV)
WEBDEV - Código ServidorPHPAjax
The following code is used to open and/or to create an external file. The file is opened in read/write mode. If the file already exists, this file will not be re-created (foCreateIfNotExist constant).
// Declare the variables
FileNameAndPath is string
FileID is int
// Select the file name and path
FileNameAndPath = "C:\MyDirectories\File.txt"
// Open file
FileID = fOpen(FileNameAndPath, foReadWrite + foCreateIfNotExist)
// Display an error message if the creation was not performed
IF FileID = -1 THEN
Error(ErrorInfo(errMessage))
ELSE
// Processes in the opened file
...
// End of processes
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 23/08/2022

Señalar un error o enviar una sugerencia | Ayuda local