PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Example 1: Modifying the stored path of a file in an archive
  • Example 2: Modifying the stored path of a file in an archive
zipChangePath (Example)
Example 1: Modifying the stored path of a file in an archive
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax The following code is used to modify the stored path of a file in an archive. The archive is already opened and it contains several archived files. The stored path of the file only contains the name and the extension of the file. The file whose path must be modified is selected in a Table control populated programmatically (TABLE_ArchiveTable).
Caution: In order for the index of the Table control populated programmatically to match the index of the selected file, the Table control must not be sorted.
// --Click code of "Modify the file path" button
// Declare and initialize the variables
ArchiveName is string = "MyArchive"
ErrorCodeChangePath is int
FileIndex is int
// Select the file in the archive
FileIndex = TableSelect(TABLE_ArchiveTable)
 
// Modify the path of the selected file
ErrorCodeChangePath = zipChangePath(ArchiveName, FileSubscript, "Backup.doc")
 
// Display an error message if the path was not modified
IF ErrorCodeChangePath <> 0 THEN
Error(zipMsgError(ErrorCodeChangePath))
END
Example 2: Modifying the stored path of a file in an archive
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax The following code is used to modify the stored path of a file in an archive. The archive is already opened and it contains several archived files. The stored path of the file only contains the name and the extension of the file. The file whose path must be modified is selected according to its stored path.
// --Click code of "Modify the file path" button
// Declare and initialize the variables
ArchiveName is string = "MyArchive"
ErrorCodeChangePath is int
 
// Modify the path of the "Report.doc" file
ErrorCodeChangePath = zipChangePath(ArchiveName, "Report.doc", "Backup.doc")
 
// Display an error message if the path was not modified
IF ErrorCodeChangePath <> 0 THEN
Error(zipMsgError(ErrorCodeChangePath))
END
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment