Jeditom,
You can set a goto location by naming a section "AnyName:" and then using a "goto AnyName" comment. In the example below, the section name is 'Restart', and - if the waitfor command fails, you are sent to that section. The section can be anywhere AFTER your variable declarations, so if you need to begin from scratch with all of the variables at a null value, you will need to reset the variables before you call the ‘Restart’ section.
Is that what you were looking for? If not, let me know.
Eddie
-------------------------------------------------------------------------------------------
proc main
string sLine
string sShelf
string sSlot
string sStored
Restart:
if fopen 0 "d:modems1-4.txt" READ TEXT
while not feof 0
fgets 0 sLine
strextract sShelf sLine "," 0
strextract sSlot sLine "," 1
strextract sStored sLine "," 2
; TELNET INTO THE CONTROLLER
connectmanual telnet "192.168.51.103"
; CHOOSE 1 SELECT UNIT
waitfor "SELECT UNIT" Forever
waitfor "ENTER SELECTION : ^[[24;32H" 30 ;Wait 30 Seconds
if SUCCESS ;If received in 30 seconds
transmit "1"
transmit "^M"
else
;sLine = "" ;Use these only if you need to reset the strings
;sShelf = "" ; since the 'Restart' section cannot come before
;sSlot = "" ; the variable declaration
;sStored = ""
goto Restart ;Else goto section 'Restart'
endif
endwhile ;do not know if this is where it needs to be, but I had to add it to compile and test
endif ;same as above
endproc