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

Script Question

Status
Not open for further replies.

rlgriffin

MIS
Oct 26, 2004
34
US
I've got a quick question. Below is a script I am trying to gt to work and it is with the exception of one problem. When it gets to the second key entry it hangs up. What am I doing wrong?

proc main

string sline, tn,key0,key1,key2

fopen 0 "3904CHG.txt" READ ;Open our data file
while not feof 0 ;While the file still has data

fgets 0 sLine ;Read a line of data
strtok tn sLine "`t" 1 ;Get the first field
strtok key0 sLine "`t" 1 ;Get the second field
strtok KEY1 sLine "`t" 1 ;Get the third field
;strtok KEY2 sLine "`t" 1 ;Get the fourth field


set txpace 30
TRANSMIT "^M"
waitfor "req:"
transmit "CHG^M"
waitfor "type"
transmit "3904^M"
waitfor "tn "
transmit tn
transmit "^M"
waitfor "ECHG"
transmit "YES^M"
waitfor "ITEM"
transmit KEY0
transmit "^M~"
transmit "^M~"
transmit "^M~"
waitfor "KEY"
transmit KEY1
transmit "^M~"
transmit "^M~"
transmit "^M~"
waitfor "KEY"
transmit KEY2
transmit "^M~"
transmit "^M~"
transmit "^M~"
transmit "^M~"
transmit "^M~"




endwhile

fclose 0


endproc
 
post the 1st few lines of "3904CHG.txt".. the script looks right..

john poole
bellsouth business
columbia,sc
 
I don't know scripts but you have a ; in front of the strtok key2 line. That looks different than the other lines.
 
that's a good catch, the ; is the same as the old dos rem command, it removes that line by changing it to a note...

;this line is not use
;because i rem'ed it
;out

proc main
end proc


used to leave myself note, and[COLOR=black red] Nortellian,[/color] as good as you are at your job, you need to start doing scripts.. that's a powerfull tool worth picking up.. just do script record and make a simple change, save it and pull it up and look at the code.. it looks like greek but one line at a time it starts to make sense... i started back in the dos days but never had a lot of luck until the windows version and the compile feature... but i didn't have this forum or an internet.. at the time i couldn't find any tech that knew the switch and scripts to trade headaches with

john poole
bellsouth business
columbia,sc
 
Hi everybody!
It's very true what you said J.P but sometimes it's hard, especially when we only use from time to time scripts.
For those who doesn't want to get in to it, I made a tool script, for long service changes on the M1, and for me serves me better then the OTM or MAT.

It's all with textbox input and It reads a Excel file (.CSV), and you can choose the column, and the user can set what to "waitfor" and send text or/and the .CSV row, then you can set a loop until the and of the .csv file.
After you can save and open this sub-script you create and use it in the future and change it for other uses, the only limtation is that you can only define 17 commands.. but I am workig on it to get 54.
I think it's very useful, even for maintenance to run a sequence when the M1 sends an alarm, (like MISP down or DCH .. whatever... it's compiled for the procomm 4.8
I sent it to Knob (aspect procomm), I hope he can share it.
If not, could you tell me how to share it with the M1 tech people.
I have some more,like a patch tool for M1 for rls < X21 and MMail mailbox creater.
I'll send it if this gets "here".

bye. I am new around, this a very good site ...thanks
 
sounds like you know your stuff, the only way to share with us guys is to post the actual code. and it sounds that it might be a little large.. i've seen some posted here, maybe 6 or 8 pages, i don't know the limit.. if knob adds it to his website, then be sure and post the link... ghtrout has a nortel website, but i don't know if he post scripts, he doesn't seem to have much use for them from a couple of his post.. check firebird scramblers website, he's a major player in the script game, he's emailed me some real killer scripts... mine are quick to the point and no frills.. i'm working on a few full dressed, but with no more them i know, scripts are the most powerfull tool i've ever used.. something as simple as putting a few thousand names in 95.. if the customer has a soft copy, i'm just about done... post some of your stuff, we can use the pointers

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

Part and Inventory Search

Sponsor

Back
Top