Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i shorten redundant script? 1

Status
Not open for further replies.

NeoValence

Technical User
Mar 21, 2006
35
US
Hi All,

Is it possible to shorten this script which is repeated 16 times to accomodate 16 separate inputs where the only values that change are the input number?

integer choice = 0

proc main

sdlgmsgbox "Cabling Config." "Connect your tp generator to Input #2 on the UUT. Then click OK." STOP OK choice 1
transmit "^M"
waitfor "#"
transmit "rte 1 a 2^M"
waitfor "#"
transmit "rte 1 b 2^M"
waitfor "#"
pause 1
smptetestpatt()

endproc

I would imagine there is something that could be added to this script that would accomplish this, but i just don't know where to start. Any replies would be greatly appreciated.

Thanks in Advance,

NeoValence
 
Assuming you want the script to go from input 1 to input 16, here is how you could do that:

proc main

string sMsg
integer iLoop, choice

for iLoop = 1 upto 16
strfmt sMsg "Connect your tp generator to Input #%d on the UUT. Then click OK." iLoop
sdlgmsgbox "Cabling Config." sMsg STOP OK choice 1
transmit "^M"
waitfor "#"
transmit "rte 1 a 2^M"
waitfor "#"
transmit "rte 1 b 2^M"
waitfor "#"
pause 1
smptetestpatt()
endfor
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top