4D v16.3

RECEIVE VARIABLE

Home

 
4D v16.3
RECEIVE VARIABLE

RECEIVE VARIABLE 


 

RECEIVE VARIABLE ( variable ) 
Parameter Type   Description
variable  Variable in Variable in which to receive

RECEIVE VARIABLE receives variable, which was previously sent by SEND VARIABLE from the document or serial port previously opened by SET CHANNEL.

In interpreted mode, if the variable does not exist prior to the call to RECEIVE VARIABLE, the variable is created, typed and assigned according to what has been received. In compiled mode, the variable must be of the same type as what is received. In both cases, the contents of the variable are replaced with what is received.

Notes:

  1. If you receive a variable from a document using this command, the document must have been opened using the SET CHANNEL command. You cannot use RECEIVE VARIABLE with a document opened with Open document, Create document or Append document.
  2. This command does not support array variables. If you want to send and receive arrays from a document or over a serial port, use the BLOB Commands.
  3. During the execution of RECEIVE VARIABLE, the user can interrupt the reception by pressing Ctrl-Alt-Shift (Windows) or Command-Option-Shift (Macintosh). This interruption generates an error -9994 that you can catch with an error-handling method installed using ON ERR CALL. Usually, you only need to handle the interruption of a reception while communicating over a serial port.

Example  

See example for the RECEIVE RECORD command.

The OK system variable is set to 1 if the variable is received. Otherwise, the OK system variable is set to 0.



See also 

ON ERR CALL
RECEIVE RECORD
SEND RECORD
SEND VARIABLE

 
PROPERTIES 

Product: 4D
Theme: Communications
Number: 81

The OK variable is changed by the commandThis command modifies the Error system variableThis command can be run in preemptive processes

 
HISTORY 

Created: < 4D v6

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)