The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
script |
Post Reply |
Author | |
Martin
Newbie Joined: March 24 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
Posted: March 24 2004 at 11:33am |
Hello, my question is in regards to automizing a proc using a script. I'm not sure how to write the script, I do have a little bit of understanding of VB. Could someone tell me how to write a script so that I can automize a proc. The proc is called "Gifted". I have Accuterm97
|
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi Martin -
You can use a script to automate a proc by using the Session Output and WaitFor functions. Use the built-in ActiveSession variable to automate the currently active session. To send data to the host, as if the operator typed at the keyboard, use the Output method. For example, if the session is at TCL, you can invoke the proc by using: ActiveSession.Output "Gifted" & Chr$(13) The Chr$(13) is the ASCII code for Carriage Return. If you need to wait for a message from the proc before responding to another prompt, use the WaitFor function. For example, if the proc requires a date, and prompts for the date by displaying "Enter Date:", you could wait for this prompt by using: If ActiveSession.WaitFor(1,10,"Enter Date:") Then ... Then send the date to the proc using .Output as shown above. If you are using WaitFor, you must set ActiveSession.InputMode = 1 when you begin the script, and reset it back to 0 before the script terminates. This prevents a competition for data sent by the host between the screen and the script, and makes the screen wait until the script examines the data first. Thanks, Peter |
|
Martin
Newbie Joined: March 24 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Peter,
Thanks for the tip! Is it also possible to write a script to capture my proc as a text file? For example I want to be able to send this proc out as a text file and dump it somewhere in the C:\ drive. If I can do this then I am set. Your help is appreciated. |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi Martin -
Do you want to capture the output that is generated by executing the proc, or do you want to copy the proc itself to a text file? Thanks, Peter |
|
Martin
Newbie Joined: March 24 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Peter,
Yes, I would like to capture the output based upon the proc itself if possible. Thanks, Martin |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi Martin -
Before sending the final response to the proc (or before exeuting the proc if there are no other responses) turn on capture: ActiveSesison.Capture "c:\stuff.txt", 1, 1 when the proc is done sending data, turn off capture: ActiveSession.CaptureEnd You might need to spin in a loop waiting for output to complete. This might be a little tricky with AccuTerm 97. In AccuTerm 2K2 you can periodically check the value of ActiveSession.BytesIn property and see if any more data has been received. Thanks, Pete |
|
Martin
Newbie Joined: March 24 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Peter,
Your help has been great! |
|
Martin
Newbie Joined: March 24 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Pete,
Is there a way I can get MS Access2K to run a saved Accuterm97 script. Previously I was able to save a batch file on my C:\ drive and then in Access I was able to use the Shell command to run the batch file when I clicked on a command button. Can I do the same for an Accuterm script File? |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi Martin -
Its time to upgrade to AccuTerm 2K2! With AccuTerm 2K2 (and 2000), the script files have thier own extension (.atsc) which is associated with the AccuTerm application. You can create a shortcut to a script file which will launch AccuTerm then execute the script. No reason you could not initiate this from the Shell command in Access. Thanks, Pete |
|
Martin
Newbie Joined: March 24 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Pete,
I saved my script file to my C:\drive, I have Accuterm open, but when I click on the saved script file it gives me the following message. C:\Program Files\Atwin\ScriptTest.SCR is not a valid Win32 application. Could I get around this in Accuterm97? |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Sorry - AccuTerm 97 does not understand file associations.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |