proc main integer iLoop, Event, iCount string sName dialogbox 0 8 20 142 57 3 "Searching Modems" text 1 8 12 124 26 "Searching for available modem, please wait." center enddialog fopen 0 "modems.txt" CREATE TEXT ;Open text file to hold list of modems on system itemcount MODEM CONNECTION iCount ;Get number of connections on system for iLoop = 0 upto iCount-1 ;Loop through list of connections, zero-based itemname MODEM CONNECTION iLoop sName ;Get name corresponding to connection ID if not strfind sName "direct connect-" ;Don't want direct connects set modem connection sName ;Turn on and off command mode to see if modem is available commandmode ON ;All of this if clause except the fputs command can be removed if success ;If only a list if wished, and not to set a connection commandmode OFF fputs 0 sName ;Put connection name in file endif endif endfor fclose 0 dlgdestroy 0 CANCEL dialogbox 0 8 20 264 130 31 "Select Modem" ;Displays dialog with valid and available connections flistbox 1 9 7 246 91 "modems.txt" SINGLE sName HSCROLL SORT pushbutton 2 101 106 61 18 "OK" DEFAULT enddialog while 1 dlgevent 0 Event switch Event case 1 endcase case 2 exitwhile endcase endswitch endwhile dlgdestroy 0 OK set modem connection sName ;Set connection to selected name endproc