4D v16.3RECEIVE RECORD |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
RECEIVE RECORD
RECEIVE RECORD
RECEIVE RECORD receives a record into table from the serial port or document opened by the SET CHANNEL command. The record must have been sent with SEND RECORD. When you execute RECEIVE RECORD, a new record is automatically created for table. If the record is received correctly, you must then use SAVE RECORD to save the new record. The complete record is received. This means that pictures and BLOBs stored in or with the record are also received. Important: When records are being sent and received using SEND RECORD and RECEIVE RECORD, the source table structure and the destination table structure must be compatible. If they are not, 4D will convert values according to the table definitions when RECEIVE RECORD is executed. Notes:
A combined use of SEND VARIABLE, SEND RECORD, RECEIVE VARIABLE and RECEIVE RECORD is ideal for archiving data or for exchanging data between identical single-user databases used in different places. You can exchange data between 4D databases using the import/export commands such as EXPORT TEXT and IMPORT TEXT. However, if your data contains graphics and/or related tables, using SEND RECORD and RECEIVE RECORD is far more convenient. For instance, consider a documentation system based on 4D and 4D Write. Since several writers in different locations wordwide work on it, we need a simple way to exchange data between the different databases. Here is a simplified view of the database structure: The table [Commands] contains the description of each command or topic. The tables [CM US Params] and [CM FR Params] respectivily contain the parameter list for each command in English and in French. The table [CM See Also] contains the commands listed as reference (See Also section) for each command. Exchanging documentation between databases therefore consists in sending the [Commands] records and their related records. To do so, we use SEND RECORD and RECEIVE RECORD. In addition, we use SEND VARIABLE and SEND RECORD in order to mark the import/export document with tags. Here is the (simplified) project method for exporting the documentation: // CM_EXPORT_SEL project method Here is the (simplified) project method for importing the documentation: // CM_IMPORT_SEL project method Note that we do not test the OK variable while receiving the data nor try to catch the errors. However, because we stored variables in the document that describes the document itself, if these variables, once received, made sense, the probability for an error is very low. If for instance a user opens a wrong document, the first test stops the operation right away. The OK system variable is set to 1 if the record is received. Otherwise, the OK system variable is set to 0.
See also
|
PROPERTIES
Product: 4D HISTORY
Created: < 4D v6 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||