4D v14.3SEND PACKET |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
SEND PACKET
SEND PACKET
SEND PACKET sends a packet to a serial port or to a document. If docRef is specified, the packet is written to the document referenced by docRef. If docRef is not specified, the packet is written to the serial port or document previously opened by the SET CHANNEL command. A packet is just a piece of data, generally a string of characters. Note: When you pass a BLOB in packet, the command does not take into account any character set defined by the USE CHARACTER SET command. The BLOB is sent without any modification. Before you use SEND PACKET, you must open a serial port or a document with SET CHANNEL, or open a document with one of the document commands. When writing to a document, the first SEND PACKET begins writing at the beginning of the document unless the document was opened with USE CHARACTER SET. Until the document is closed, each subsequent packet is appended to any previously sent packets. Note: This command is useful for a document opened with SET CHANNEL. On the other hand, for a document opened with Open document, Create document or Append document, you can use the commands Get document position and SET DOCUMENT POSITION to get and change the location in the document where the next writing (SEND PACKET) or reading (RECEIVE PACKET) will occur. The following example writes data from fields to a document. It writes the fields as fixed-length fields. Fixed-length fields are always of a specific length. If a field is shorter than the specified length, the field is padded with spaces. (That is, spaces are added to make up the specified length.) Although the use of fixed-length fields is an inefficient method of storing data, some computer systems and applications still use them: $vhDocRef :=Create document("") ` Create a document This example illustrates the sending and retrieval of extended characters via a BLOB in a document: C_BLOB($send_blob) |
PROPERTIES
Product: 4D
HISTORY
Modified: 4D v11 SQL SEE ALSO
Get document position ARTICLE USAGE
4D Language Reference ( 4D v14 R2) Inherited from : SEND PACKET ( 4D v11 SQL Release 6) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||