Sver
Full Member
Posts: 145
|
Post by Sver on Nov 25, 2023 5:38:23 GMT -5
maxPorts=40
dim port$(maxPorts) statictext #main.txt, "Select Port", 75, 55, 100, 20 combobox #main.portcb, port$(), [portDoubleClick], 75, 75, 100, 100 open "Get port example" for window as #main print #main, "trapclose [quit]"
' Populate the drop down list of available COM ports gosub [getPorts] wait
' Handle the combobox doubleclick event [portDoubleClick] print #main.portcb, "contents? Com$" open Com$;":9600,n,8,1,ds0,cs0,rs" for random as #com wait
[getPorts] for port = 1 to maxPorts port$(port)="" next index=1 ' now find all active ports for port = 1 to maxPorts oncomerror [trap] open "Com";str$(port);":9600,n,8,1,ds0,cs0,rs" for random as #com port$(index)="Com";str$(port) index=index+1 close #com [trap]
oncomerror next print #main.portcb, "reload" print #main.portcb, "selectindex 1" return
[quit] close #main end
|
|