Set port name

Command group Flag affected Reversible Execute on client Platform(s)
Report destinations YES NO NO All

Syntax

Set port name {port-name (e.g. COMn: or LPTn:)}

Description

This command specifies the name of the port to be used with subsequent input or output via the port. The flag is set if the port is successfully selected. The command should follow Send to port. You can set the baud rate and other parameters for the port using Set port parameters.

Set port name is not reversible, but if you use it in a reversible block the specified port is closed when the method terminates.

If an error occurs, then this command sometimes generates a fatal error. You can use an error handler to intercept the fatal error; see Load error handler for details.

Example

Set report name rMyReport
Send to port
If platform()='X'
  Set port name {1 (Modem port)} ## macOS
Else
  Set port name {COM1:} ## Windows & Linux
End If
Set port parameters {1200,n,7,2}
Print report