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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with script 1

Status
Not open for further replies.

motox2

Programmer
Jun 21, 2007
426
GY
My script below that i have compiled off the forums here is giving me some trouble. The script starts to run but when it gets to "ECHG" it doesnt enter "YES" likes its supposed to. It skips to "CDEN" then puts the "YES" in, and errors out Any help would be greatly appreciated!!
Thanks in advance

Ok heres my script:

Proc main


string tn

integer count
string szline
fopen 0 "tn.txt" read

while not feof 0
SZLINE = "2"
fgets 0 szline

strtok tn szline "," 1
set txpace 50

transmit "****^M"
transmit "ld 20^M"
waitfor "REQ: "
transmit "chg^M"
waitfor "TYPE: "
transmit "500^M"
waitfor "TN "
transmit tn

waitfor "ECHG "
mspause 50 (tried with and without this pause)
transmit "YES^M"
mspause 50 (tried with and without this pause)
waitfor "ITEM "
transmit "cls cnia ^M"
waitfor "ITEM "
transmit "^M"



endwhile

fclose 0



endproc
 
Code:
waitfor "ECHG "
   transmit "yep^M"


this one works but, your problem looks like your "transmit tn" is sending two returns.. i've seen that in a file that was saved as xxx or pasted to a wud from excel..

i would copy the txt from the txt file, open aspect editor, file new, save as tn.wud... same file just in a format that aspect reads a little cleaner.. then change the open file line to reflect the new tn.wud filename
..

a lot of the time in scripts, the problem is one line prior to the broken line... your echg yes line works here

john poole
bellsouth business
columbia,sc
 
thank you sir, i will give that a shot!!!
 
still no go. Its reading the .wud ok but it still keeps skipping over the ECHG, and goes to CDEN placing the response "YEP" next to it then errors out. here is the modified script since your last post: what do you think?
Thanks again JP.

Proc main


string tnb

integer count
string szline
fopen 0 "tnb.wud" read

while not feof 0
SZLINE = "1"
fgets 0 szline

strtok tnb szline "," 1
set txpace 50

transmit "****^M"
transmit "ld 20^M"
waitfor "REQ: "
transmit "chg^M"
waitfor "TYPE: "
transmit "500^M"
waitfor "TN "
transmit tnb
waitfor "ECHG "
transmit "YEP^M"
waitfor "ITEM "
transmit "cls cnia ^M"
waitfor "ITEM "
transmit "^M"

endwhile
fclose 0



endproc
 
how did you create the list?

john poole
bellsouth business
columbia,sc
 
we take them from excel but do not copy the col.. highlight and copy just the txt.. your script runs clean from here... another thing i've done is save from excel to a tab delimited..

might try this.. start with a vacant wud, type in two or 3 tn's with a single return after each.. that might help trouble shoot

john poole
bellsouth business
columbia,sc
 
ok John, i dont know why this worked, but here is the script without "set txpace" and i also set my system transmit pacing in procomm to "5". The thing really flies, is this good or bad on the system overall to run scripts with that speed?




Proc main


string tnb

integer count
string szline
fopen 0 "tnb.wud" read

while not feof 0
SZLINE = "1"
fgets 0 szline

strtok tnb szline "," 1

waitfor "REQ: "
transmit "chg^M"
waitfor "TYPE: "
transmit "500^M"
waitfor "TN "
transmit tnb
waitfor "ECHG "

transmit "YES^M"
waitfor "ITEM "
transmit "cls cnia ^M"
waitfor "ITEM "
transmit "^M"

endwhile
fclose 0



endproc
 
neither.. on a new install (bars/sets) i run scripts as fast as they will run, on a port set to 19.2.. but for day to day small dept moves and changes, i slow them down so that i might be able to catch problems.. we are pricing an upgrade now from rls 3.. we need the ram and the newer cpu's not features.. when we are on high traffic, my response from the switch is slower, by using textpace i can see a clean exchange between the two...

(maybe i don't want the switch to think i can type faster then she can think)

john poole
bellsouth business
columbia,sc
 
Try this

after "transmit tnb" in your script the next line should be transmit "^M"


Proc main


string tnb

integer count
string szline
fopen 0 "tnb.wud" read

while not feof 0
SZLINE = "1"
fgets 0 szline

strtok tnb szline "," 1

waitfor "REQ: "
transmit "chg^M"
waitfor "TYPE: "
transmit "500^M"
waitfor "TN "
transmit tnb

TRANSMIT "^M"

waitfor "ECHG "

transmit "YES^M"
waitfor "ITEM "
transmit "cls cnia ^M"
waitfor "ITEM "
transmit "^M"

endwhile
fclose 0

endproc
 
i have had to use that IF the txt(wud) file is captured in txt cap or word docs.. if it comes from excel the return is embedded.. if the script stops at the end of the tn, add the transmit "^M" ;carriage return

john poole
bellsouth business
columbia,sc
 
Thanks everybody for all your help, i really appreciate it. I managed to get 'er done!!!

Thanks again!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top