proc main integer iEntries ;Number of entries in dialing class integer iCount ;Loop variable integer iEvent ;Event selected in dialog string sName ;Name of Connection Directory entry string sPassword ;Password entered by user string sList ;Holds list of Connection Directory entries string sChoice ;Connection Directory entry selected by user dialogbox 0 8 20 264 91 2 "Caption" listbox 1 26 15 80 55 sList SINGLE sChoice editbox 2 162 15 96 14 sPassword MASKED pushbutton 3 215 55 42 14 "Dial" text 4 120 15 38 14 "Password:" left enddialog dialcount TELNET iEntries ;Get number of entries in specified dialclass for iCount = 0 upto (iEntries - 1) dialname TELNET iCount sName ;Get entry name corresponding to index number dlglist 0 1 INSERT sName ;Add name to listbox endfor while 1 ;Loop forever dlgevent 0 iEvent switch iEvent case 0 endcase case 1 endcase case 2 endcase case 3 ;If Dial button selected if nullstr sChoice ;Display error message if no entry was chosen usermsg "Select an entry." elseif nullstr sPassword ;Display error messge if password field is blank usermsg "Please enter the password." else exitwhile ;Exit the while loop endif endcase endswitch endwhile dlgdestroy 0 CANCEL ;Destroy the dialog dial TELNET sChoice ;Dial the selected entry while $DIALING ;Pause while dialing yield endwhile endproc