PUT

Top  Previous  Next

Action

Sends a byte to the software UART.

 

 

Syntax

PUT #channel , var

 

Remarks

channel

Positive numeric constant that refers to the opened channel.

var

A variable or constant who's value is sent to the the software UART.

 

 

See also

GET , PRINT , INPUT, OPEN

 

 

Example

Open "com3.1:9600" For Output As #1                           'p3.1 is normally used for tx so testing is easy

Open "com3.0:9600" For Input As #2                            'p3.0 is normally used for RX so testing is easy

 

 

S = "test this"                           'assign string

Dum = Len(s)                              'get length of string

For I = 1 To Dum                          'for all characters from left to right

A = Mid(s , I , 1)                      'get character

Put #1 , A                              'write it to comport

Next

 

Do

Get #2 , A                              'get character from comport

Put #1 , A                              'write it back

Print A                                 'use normal channel

Loop

 

 

Close #1                                  ' finally close device

Close #2

End