SerialDevice.LastIndex
From Xojo Documentation
Shared Property (As Integer)
Returns the index of the last serial device.
Example
The following displays the names of the serial devices on the computer:
Returns the index of the last serial device.
The following displays the names of the serial devices on the computer: