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!

incremental changes

Status
Not open for further replies.

johnpoole

Programmer
May 26, 2004
19,375
US
using a short script, what the best way to have it increase this line by one and stop at 1999?
Code:
procmain
    loop:
    waitfor "NPA  "
    transmit "1200^M"
    call stepto
    goto loop 

endproc

on each pass i need to bump 1200 up 1 digit and stop at 1999. thanks

john poole
bellsouth business
columbia,sc
 
This should do the trick:

proc main
integer iCount
string sCount

for iCount = 1200 upto 1999
waitfor "NPA "
itoa iCount sCount
transmit sCount
call stepto
endfor

endproc

 
thanks again

john poole
bellsouth business
columbia,sc
 
Code:
proc main
    integer iCount  			;name integer
    string sCount			;name string

    for iCount = 1200 upto 1999		;define a liner value for icount
    waitfor "NPA  "
    itoa iCount sCount		; ? turn interger into string
    transmit sCount			; transmit same
    call stepto
    endfor

did i follow that almost, not sure about the itoa line, even after looking up each line in the manual.

john poole
bellsouth business
columbia,sc
 
i emailed that script to your site, i've tried building that one for a while, i had a working script but i knew the right way had to be shorter then 30K lines, that would hang and worked if i was the one using it. this one is so clean it hurts, and thanks again

Code:
proc main
 
   transmit "****^M"
   waitfor ">"
   transmit "ld 90^M"
   
   waitfor "REQ  "
   transmit "new^M"
   waitfor "CUST "
  
   transmit "0^M"
   waitfor "FEAT "
   transmit "net^M"
   waitfor "TRAN "
   transmit "ac1^M"
   waitfor "TYPE "
   transmit "npa^M"
   call theproc
 endproc       
proc theproc

      
        integer iCount
        string sCount
        for iCount = 1200 upto 1999
        loop:
        waitfor "NPA  "
          itoa iCount sCount    
          transmit sCount  
          transmit "^M"
        call myproc 
         endfor       


 
        goto loop 
       
endproc

proc myproc
       waitfor "RLI  "
       transmit "2^M"
       waitfor "SDRR "
       transmit "^M"
       waitfor "ITEI "
       transmit "^M"
   
   
   
 endproc

john poole
bellsouth business
columbia,sc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top