PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Generation wizard
  • Special case: Extracting a database
  • Special case: ".WDD" file (analysis description)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Extracts a resource from the application into a physical device location.
Remarks:
  • Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst The resource to extract must have been included in the generated application by the generation wizard (see Notes).
  • Versions 23 and later
    WindowsLinux In WINDEV applications or WEBDEV sites, the resource to extract must be:
    • in the "Other" category of the Project explorer pane,
    • in the main library of the application (WDL file).
    New in version 23
    WindowsLinux In WINDEV applications or WEBDEV sites, the resource to extract must be:
    • in the "Other" category of the Project explorer pane,
    • in the main library of the application (WDL file).
    WindowsLinux In WINDEV applications or WEBDEV sites, the resource to extract must be:
    • in the "Other" category of the Project explorer pane,
    • in the main library of the application (WDL file).
  • AndroidAndroid Widget This function can be used in the Android simulator.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
New in version 18
Android Widget This function is now available in Android widget mode.
Android Widget This function is now available in Android widget 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.
Versions 23 and later
WINDEVWindowsLinux This function is now available for Windows and Linux applications.
WEBDEV - Server codeWindowsLinux This function is now available for Windows and Linux sites.
New in version 23
WINDEVWindowsLinux This function is now available for Windows and Linux applications.
WEBDEV - Server codeWindowsLinux This function is now available for Windows and Linux sites.
WINDEVWindowsLinux This function is now available for Windows and Linux applications.
WEBDEV - Server codeWindowsLinux This function is now available for Windows and Linux sites.
Example
Android
// Reads the content of readme.txt text file included in the application resources
IF fExtractResource("readme.txt", "/sdcard/extraction.txt") = True THEN
EDT_Text = fLoadText("/sdcard/extraction.txt"
END
Android
// Used to precisely locate the HFSQL data on the Android Smartphone
sDataPath is string = SysRepDirStorageCard() + fSep() + "Customer tests"  + fSep()
IF NOT fDirectoryExist(sDataPath) THEN fMakeDir(sDataPath)
 
fExtractResource("Product.fic", sDataPath + "Product.fic")
fExtractResource("Product.ndx", sDataPath + "Product.ndx")
fExtractResource("Product.mmo", sDataPath + "Product.mmo")
 
IF NOT HChangeDir(Product, sDataPath) THEN
Error(HErrorInfo())
END
Versions 19 and later
Android
// Extracts all the images in PNG format
fExtractResource("*.png", CompleteDir(SysDirStorageCard()) + "images")
New in version 19
Android
// Extracts all the images in PNG format
fExtractResource("*.png", CompleteDir(SysDirStorageCard()) + "images")
Android
// Extracts all the images in PNG format
fExtractResource("*.png", CompleteDir(SysDirStorageCard()) + "images")
Syntax
<Result> = fExtractResource(<Resource name> [, <Destination>])
<Result>: Boolean
  • True if the resource was extracted,
  • False otherwise. If an error occurs, the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo.
<Resource name>: Character string
Name of resource to extract (file name with its extension).
Versions 19 and later
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst The wildcard characters (* and?) are allowed. This allows you to extract several resources in a single call. In this case, the <Destination> parameter must correspond to a directory (that exists or not).
New in version 19
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst The wildcard characters (* and?) are allowed. This allows you to extract several resources in a single call. In this case, the <Destination> parameter must correspond to a directory (that exists or not).
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst The wildcard characters (* and?) are allowed. This allows you to extract several resources in a single call. In this case, the <Destination> parameter must correspond to a directory (that exists or not).
Versions 23 and later
WindowsLinux The resource to extract must be found in the main application library (WDL file). The library must have not been loaded by LoadWDL.
New in version 23
WindowsLinux The resource to extract must be found in the main application library (WDL file). The library must have not been loaded by LoadWDL.
WindowsLinux The resource to extract must be found in the main application library (WDL file). The library must have not been loaded by LoadWDL.
<Destination>: Optional character string
AndroidAndroid Widget Full or relative path of destination file. This path can be relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
If the directory exists, the resource is directly extracted into this directory.
The directory is created if it does not exist.
If this parameter is not specified or if it corresponds to an empty string (""), the resource will be extracted into the current application directory in a file named like the resource.
The destination file will be overwritten if it already exists before the extraction.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories, as well as to the external memory (SDCard).
iPhone/iPadIOS WidgetMac Catalyst Full path of destination file. This parameter is case-sensitive.
If the directory exists, the resource is directly extracted into this directory.
The directory is created if it does not exist.
If this parameter is not specified or if it corresponds to an empty string (""), the resource will be extracted into the "Documents" application directory in a file named like the resource.
The destination file will be overwritten if it already exists before the extraction.
Versions 23 and later
WindowsLinux Full path of destination file.
If the directory exists, the resource is directly extracted into this directory.
The directory is created if it does not exist.
If this parameter is not specified or if it corresponds to an empty string (""), the resource will be extracted into the application data directory (returned by fDataDir) in a file named like the resource.
The destination file will be overwritten if it already exists before the extraction.
New in version 23
WindowsLinux Full path of destination file.
If the directory exists, the resource is directly extracted into this directory.
The directory is created if it does not exist.
If this parameter is not specified or if it corresponds to an empty string (""), the resource will be extracted into the application data directory (returned by fDataDir) in a file named like the resource.
The destination file will be overwritten if it already exists before the extraction.
WindowsLinux Full path of destination file.
If the directory exists, the resource is directly extracted into this directory.
The directory is created if it does not exist.
If this parameter is not specified or if it corresponds to an empty string (""), the resource will be extracted into the application data directory (returned by fDataDir) in a file named like the resource.
The destination file will be overwritten if it already exists before the extraction.
Remarks
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst

Generation wizard

The wizard for generating Android, Universal Windows 10 app or iPhone/iPad applications allows you to specify whether files and libraries must be included in the application.
In an Android application, you have the ability to include:
  • specific resources.
  • specific Java archives.
Then, these files can be:
  • used directly (files to read for example: sound files, image files, etc.).
  • extracted with fExtractResource (e.g., files that will be modified by the application)
If an image is included in the application, it can be directly assigned to a control by specifying its name. For example:
IMG_Image = image1
Versions 19 and later
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst You have the ability to list the files included in the application with fListResource.
New in version 19
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst You have the ability to list the files included in the application with fListResource.
AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst You have the ability to list the files included in the application with fListResource.
For more details, see:
AndroidAndroid Widget

Special case: Extracting a database

If the file to extract is an SQLite database, use fDataDir to extract it into the data directory of the application ("databases" directory).

Example:
fExtractResource(<Database vame>.db, CompleteDir(fDataDir()) + <Database name>.db)
To connect to this database, all you have to do is specify <Database name>.db as source for the SQLite connection. For more details, see Android application: Using a database.

Special case: ".WDD" file (analysis description)

An analysis description (".WDD" file) integrated to the library of an application cannot be extracted.
To extract a file from a library that cannot be extracted by fExtractResource, you can use an HFSQL data file integrated in the library.
Component: wd270vm.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment