4D v14.3VERIFY DATA FILE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
VERIFY DATA FILE
VERIFY DATA FILE
The VERIFY DATA FILE command carries out a structural check of the objects contained in the 4D data file designated by structurePath and dataPath. Note: For more information about checking data, please refer to the Design Reference manual. structurePath designates the structure file (compiled or not) associated with the data file to be checked. This can be the open structure file or any other structure file. You must pass a complete pathname, expressed with the syntax of the operating system. You can also pass an empty string, in this case a standard Open file dialog box appears so that the user can specify the structure file to be used. dataPath designates a 4D data file (.4DD). It must correspond to the structure file defined by the structurePath parameter. Be careful, you can designate the current structure file but the data file must not be the current (open) file. To verify the currently open data file, use the VERIFY CURRENT DATA FILE command. If you attempt to verify the current data file with the VERIFY DATA FILE command, an error is generated. The data file designated is opened in read only. You must make sure that no application accesses this file in write mode, otherwise the results of the check may be distorted.
In the dataPath parameter, you can pass an empty string, a file name or a complete pathname, expressed in the syntax of the operating system. If you pass an empty string, the standard Open file dialog box appears so that the user can specify the file to be checked (note that in this case, it is not possible to select the current data file). If you only pass a data file name, 4D will look for it at the same level as the specified structure file. The objects parameter is used to designate which types of objects will be checked. Two types of objects can be checked: records and indexes. You can use the following constants, found in the “Data File Maintenance” theme:
To verify both the records and the indexes, pass the total of Verify Records+Verify Indexes. The value 0 (zero) can also be used to obtain the same result. The Verify All option carries out complete internal verification. This verification is compatible with the creation of a log. The options parameter is used to set verification options. A single option is currently available, found in the“Data File Maintenance” theme:
Generally, the VERIFY DATA FILE command creates a log file in XML format (please refer to the end of the description of this command). You can cancel this operation by passing this option. To create the log file, pass 0 in options. The method parameter is used to set a callback method that will be called regularly during the verification. If you pass an empty string, no method is called. If the method passed does not exist, the verification is not carried out, an error is generated and the OK variable is set to 0. When it is called, this method receives up to 5 parameters depending on the objects being verified and on the event type originating the call (see calls table). It is imperative to declare these parameters in the method:
The following table describes the contents of the parameters depending on the event type:
(*) The Verification finished ($1=2) event is never returned when the mode is Verify All. It is only used in Verify Records or Verify Indexes mode.
Special case: When $4 = 0 for $1=2, 3 or 5, the message does not concern a table or an index but rather the data file as a whole. The callback method must also return a value in $0 (Longint), which is used to check the execution of the operation:
Note: You cannot interrupt execution via $0 after the End of execution event ($4=1) has been generated. Two optional arrays can also be used by this command:
By default, the VERIFY DATA FILE command creates a log file in XML format (if you have not passed the Do not create log file option, see the options parameter). Its name is based on that of the data file and it is placed in the "Logs" folder of the database. For example, for a data file named “data.4dd,” the log file will be named “data_verify_log.xml.” Simple checking of data and indexes: VERIFY DATA FILE($StructName;$DataName;Verify indexes+Verify records;Do not create log file;"") Complete verification with log file: VERIFY DATA FILE($StructName;$DataName;Verify all;0;"") Checking of records only: VERIFY DATA FILE($StructName;$DataName;Verify records;0;"") Checking of records from tables 3 and 7 only: ARRAY LONGINT($arrTableNums;2) Checking of specific indexes (index of field 1 of table 4 and index of fields 2 and 3 of table 5): ARRAY LONGINT($arrTableNums;0) `not used but mandatory If the callback method does not exist, an error is generated and the system variable OK is set to 0. |
PROPERTIES
Product: 4D
HISTORY
Modified: 4D v11 SQL Release 3 SEE ALSO ARTICLE USAGE
4D Language Reference ( 4D v14 R2) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||