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

Help - Newbie - start me in the right direction

Status
Not open for further replies.

cirrus

Technical User
Aug 20, 2003
5
Hi two things.

1. Can someone point me to a thorough Aspect scripting manual I can download and study?

2. Provide me with a sample script which does the following:

listens on com1 for string1, string2, string3 etc.....

when string1 shows up run a simple DOS program command.

when string2 shows up run a simple DOS program command etc.. and keep on looping depending on which 3 or 4 strings show up?


If someone could get me started, I would like to expand the script from there given some documentation on the language.

I would be using Procom 4.8 on W2k.

Any help would greatly be appreciated.

Thanks,

Nick
 
There is not much in the way of ASPECT tutorials available, other than two PDF files located in the \Samples\ASPECT directory on your 4.8 CD. My site also has pointers to additional ASPECT information, but the PDF files are just about all that you will find on ASPECT.

The best way to look for multiple strings of text would be to use the when target command. The format is:

when target number "string" call proc_name

where number is replaced by a different number for each when target command (0, 1, etc.) that your script has, string contains the text you are looking for, and proc_name is the procedure that will be called when that string is received (you will need a different procedure for each string). You would want to execute all of the when target commands at the beginning of your script, then likely sit in a while loop where you wait for the various strings to arrive, such as this:

while 1
yield
endwhile

The run command could be used in the called procedures to run the DOS executable. However, if the strings returned by the program appear in the DOS window, Procomm will not be able to "see" that information.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top