proc main integer iLoop, iCount string sName itemcount MODEM CONNECTION iCount ;Get number of connections on system for iLoop = 0 upto iCount-1 ;Loop through list, 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 ;Use command mode to determine if modem is available commandmode ON if success ;If so commandmode OFF ;Turn off command mode and exit loop exitfor endif endif endfor endproc