PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Type of import
  • Array items
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
HImportJSON (Function)
In French: HImporteJSON
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
Imports a JSON file in a data file in HFSQL Classic format (data file described in the data model editor or declared by HDeclare, HDeclareExternal or HDescribeFile).
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 22 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 22
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 23 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
New in version 23
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
Example
// Import the "C:\MyFiles\Customer.json" file into the Customer file.
// The Customer file will be overwritten if it already exists (hImpCreation constant)
// A progress bar will be displayed in the PROGBAR_ProgBar1 control
HImportJSON(Customer, "C:\MyFiles\Customer.json", hImpCreation, PROGBAR_ProgBar1)
Syntax
<Result> = HImportJSON(<File Name> , <Path of JSON File> [, <List of Items to Import> [, <List of "Items" to Import> [, <Options> [, <Progress Bar>]]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if an error occurred. HError is used to identify the problem.
<File Name>: Character string (with or without quotes)
Logical name of data file in HFSQL Classic format into which the import will be performed. This file is automatically created if it does not physically exist.
<Path of JSON File>: Character string (with quotes)
Full access path of the JSON file to import.
<List of Items to Import>: Optional character string (with quotes)
List of names of items into which the import will be performed. The names can be delimited by single quotes and they are separated by commas or CR characters. The names of the composite key items, binary memo items and binary items are ignored.
The non-imported items will be initialized with their default value described in the analysis.
If this parameter is not specified or if it corresponds to an empty string, all the items are imported (except the composite keys, the binary items and the binary memos) in the physical order of description.
<List of "Items" to Import>: Optional character string (with quotes)
List of names of items to import. If this parameter is not specified or if it corresponds to an empty string, all the items found in the JSON file are imported.
<Options>: Optional Integer constant (or combination of constants)
Configures the type of import to perform:
hImpNormal
(default value)
If the import data file already exists, it is filled with the imported data ; otherwise, the data file is created.
hImpCreationIf the import data file exists, it is overwritten.
hImpBreakableThe import can be interrupted by pressing the ESC key.
If the import is interrupted, the imported records are kept in the data file.
<Progress Bar>: Optional character string (with or without quotes)
  • Name of window where the progress bar will be displayed
  • Name of Progress Bar control that displays the progress.
WEBDEV - Server code This parameter is not available.
Remarks

Type of import

If the list of items is specified: the import will find the "JSON items" with the same name as the items.
Example: The data file described in the analysis contains the following items: ITEM1, ITEM2, ... The JSON file must have the following structure:
{"File":
{
"Item1":Data of item 1,
"Item2":Data of item 2,
...
}
}
The names of items found in the JSON file that do not exist in the analysis or that are not specified in the list of items will be ignored during the import.
If the list of JSON items is not specified, the value of the JSON items is included in the item of the HFSQL data file that is named like the JSON item.

Array items

HImportJSON can also be used to import array items.
Components
WINDEVWEBDEV - Server code wd230hf.dll
Linux wd230hf.so
Minimum required version
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment