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!

Variable dates?

Status
Not open for further replies.

shibby

Programmer
Oct 17, 2002
9
US
This may be a very simple question, I hope so.

I am a new ASPECT user, and this may be the only ASPECT script that I ever have to write.

We have a few business people here who use Procomm to pull some reports on a daily basis. They dial in, supply a userID and password, and then send some information to the terminal that calls the report.

An example would be to view all sold units within the last 30 days from the current date.

We no longer have the ASPECT documentation that (supposedly) came with the Procomm installation many moons ago, so my question is twofold.

1). Is there an online source where I could view an ASPECT language definition and/or tutorial?

and

2). Can one do variable-based dates in ASPECT? If so, how do you do it? An example of displaying the current date and the date 30 days prior to the current date would be excellent.

Thanks. :)

John
 
Unfortunately, there is not much online documentation for ASPECT. I started aspectscripting.com for that purpose. There is no online ASPECT reference manual and no printed ASPECT manual has been produced since version 3.0, so you are pretty much stuck with the ASPECT help file.

As for finding the date of the day 30 days past, you can use this code to do so. It takes the system variable $LTIME, subtracts 2592000 (the amount of seconds in thirty days), then uses the ltimestrs command to convert the modified value into a date and time string. sDate would contain the date 30 days in the past.

proc main
long lDate
string sDate, sTime

lDate = $LTIME
lDate = lDate - 2592000
ltimestrs lDate sDate sTime
endproc aspect@aspectscripting.com
 
Hiya, thank you for the expedient reply.

I've tried to use the code you supplied, but when I try to compile it from within Procomm, I get a lot of compilation errors. It's almost as if it doesn't understand what a "String", "long", etc is.

Here are examples:
Error C025 Line 30: Unexpected command: LONG
Error C025 Line 31: Unexpected command: STRING
Error C024 Line 33: Invalid command or expression token: LDATE
Error C024 Line 34: Invalid command or expression token: LDATE
Error C023 Line 35: Invalid expression token: LDATE
Error C023 Line 35: Invalid expression token: SDATE
 
I've managed to work around the problem I just described, I believe it had to do with where I had inserted the variable declarations in my script. It now compiles :)

The script does EVERYTHING I want it to do with one exception. Generally, during the manual process that this script is supposed to emulate, the user will hit alt-f1 to start the screen capture mode of Procomm.

How do include this functionality in the script, and where can I specify the output file for the captured text?

Thanks!

John
 
John,

Post your Script and I'll take a Look at it..

Hank
 
Instead of having the script send the keypresses for the Alt-F1 keystroke, you can just the use capture on command to open the capture file, then use capture off to close the capture file at the end of your process. You will want to review the set capture commands as listed in the ASPECT help file, as you will probably want to set some of the capture file parameters prior to opening the capture file. For example, you would use set capture file "filename" command to set the name of your capture file, where filename is replaced by the name (but not the path) of the capture file. If you need to set a path different from the default capture directory, you would use the set capture path command.

aspect@aspectscripting.com
 
Here's the script that I'm using. I have the capture thing working alright, but there are two problems. It was created by doing the record function to generate most of the script, and then adding the automation that I desired for dates and so forth. I have changed the phone number and userid/pass to protect the innocent.

1). In order for the script to run properly, the user has to go to Tools->Modem Command Mode. She says it won't do anything without her doing so. I don't have a modem on my development box, we're in a networked environment and my phoneline here is digital anyway. Is this true, and if so, why and how can I get around it?

2). She says the file output is "wrapped" which I guess means that it has no line breaks. Can this be changed?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Recorded script. Editing may be required.
proc main

long lDate
string sDate
string sTime
string name = "sale.cap"

lDate = $LTIME
lDate = lDate - 2592000
ltimestrs lDate sDate sTime

transmit "ATE1V1Q0^M"
waitfor "K^M^J"
transmit "atdt 5555555^M"
waitfor "rocomm Plus Ready!^M^J"
transmit "^M"
waitfor "SE LOG IN^M^M^J^M^J"
transmit "hel-menu^M"
waitfor &quot;ENTER TERMINAL TYPE <RETURN FOR R+R100> &quot;
transmit &quot;^M&quot;
waitfor &quot; ^[G0^[&^[=&B&quot;
transmit &quot;userid^M&quot;
waitfor &quot;^[.2&quot;
transmit &quot;mypassword^M&quot;
waitfor &quot; ^[G0^[&^[=7*&quot;
transmit &quot;77^M&quot;
waitfor &quot; ^[G0^[&^[=7*&quot;
transmit &quot;1^M&quot;
waitfor &quot; ^[G0^[&^[=7*&quot;
transmit &quot;6910^M&quot;
waitfor &quot; ^[G0^[&^[=`&quot;-&quot;
transmit &quot;SA1 CJ^M&quot;
waitfor &quot;^[TLOADING VALID FIELD NAMES&quot;
transmit &quot;O&quot;
waitfor &quot;^[TO&quot;
transmit &quot;^M&quot;
waitfor &quot;MM/DD/YY=&quot;

transmit sDate
transmit &quot;^M&quot;

set capture file name
capture on

waitfor &quot;DEAL DTEý--------.............................................&quot;
transmit &quot;N&quot;
waitfor &quot;^[(^[.2^[T^GREPORT COMPLETE. PRESS RETURN TO CONTINUE &quot;
capture off
transmit &quot;^M&quot;
waitfor &quot; ^[G0^[&^[=7j&quot;
transmit &quot;B^M&quot;
waitfor &quot; ^[G0^[&^[=7*&quot;
transmit &quot;77^M&quot;
waitfor &quot; ^[G0^[&^[=7*&quot;
transmit &quot;2^M&quot;
waitfor &quot; ^[G0^[&^[=7*&quot;
transmit &quot;6910^M&quot;
waitfor &quot; ^[G0^[&^[=`&quot;-&quot;
transmit &quot;SE1 CJ^M&quot;
waitfor &quot;^[TLOADING VALID FIELD NAMES&quot;
transmit &quot;O&quot;
waitfor &quot;^[TO&quot;
transmit &quot;^M&quot;
waitfor &quot;MM/DD/YY=&quot;


lDate = $LTIME
lDate = lDate - 604800
ltimestrs lDate sDate sTime

transmit sDate
transmit &quot;^M&quot;

name = &quot;service.cap&quot;
set capture file name
capture on

waitfor &quot;NOT EQ&quot;
transmit &quot;N&quot;
waitfor &quot;^[(^[.2^[T^GREPORT COMPLETE. PRESS RETURN TO CONTINUE &quot;
capture off
transmit &quot;^M&quot;
waitfor &quot;^[=/&quot;
transmit &quot;B&quot;
waitfor &quot;^[TB&quot;
transmit &quot;^M&quot;
waitfor &quot; ^[G0^[&^[=7*&quot;
transmit &quot;88^M&quot;
waitfor &quot;N^[G0^[&^[=65&quot;
transmit &quot;Y&quot;
waitfor &quot;^[TY^[=66&quot;
transmit &quot;^M&quot;
endproc
 
I was mistaken, it appears the output file wraps after 80 characters.

But if she manually does the alt-F1 file capture, and pulls these reports, they come through fine and the captured text is the appropriate width.
 
The later versions of Procomm don't talk directly to the modem, like earlier releases did. Instead, they communicate with the modem through the Windows TAPI layer. You can use the commandmode on command before you issue the various AT commands so that your script turns on modem commmand mode when necessary.

Regarding the capture file issue, the script should be using the current settings that Procomm is also using. Has she tried repeating the process immediately after running and completing your script?
aspect@aspectscripting.com
 
Fair enough, thanks knob, I will try that.

Can I adjust the column width and other settings from within the script? Here in my local copy it appears I only have two choices, 80 characters and 132 characters. That's from the menus themselves.

Jane (the user) claims that if she adjusts the column width to 132 before my script runs, she gets less problems, but some of the lines still spill onto a second line.

We're also getting a lot of these characters in the output file, and we don't know why: ý

They don't appear when she does her normal &quot;manual&quot; process. Perhaps it is an emulation issue. I'd be lying if I said I was too adept working with modems/emulation/etc. I normally work with SQL and C++, heh.
 
Again, the script should use the current settings in Procomm, so if it works OK for her outside of the script, I would remain a bit puzzled. You can use:

set terminal columns 132

in your script to force this particular screen width.

As for the odd characters in the output, I would think this is another case where should be seeing the same output between the script and the manual operations. You can set the terminal emulation via your script as well, you could use the set terminal type &quot;termname&quot; command to do so, where termname is replaced by the emulation name.
aspect@aspectscripting.com
 
Hello,

On the Dialing Issue, I'd simply setup a Dialing Connect Entry and use the Dialload command within the script. Then the user would only have to Run the Script and the Number would be Dialed Automatically. The Dialing Connection entry can also besetup for Capture Files and such.

Hank camphm@bellsouth.net
 
Hello,

I have a Script that might give you some Ideas. Drop me an E-Mail and I'll pass it your way !

Hank camphm@bellsouth.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top