SerialDevice.Count

From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aSerialDevice.Count

New in 2019r2

Supported for all project types and targets.

Returns the number of serial devices available.

Example

The following displays the names of the serial devices on the computer:

For i As Integer = 0 To SerialDevice.LastIndex
MessageBox(SerialDevice.At(i).Name)
Next