The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
Can BASIC program interact with script? |
Post Reply |
Author | |
anonymous
Groupie Joined: January 15 2004 Location: United States Status: Offline Points: 46 |
Post Options
Thanks(0)
Posted: February 24 2004 at 7:19am |
Can a BASIC program on the host interact with an AccuTerm script to the extent of passing data back and forth? I'm not asking for a detailed set of instructions! But if you can point me to the best place to start in the docs, I would be appreciative. Overall application is to pass data from REALITY to a windows program's api, and then retrieve the 'answer' from same.
|
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Yes. You can build the script itself in the BASIC program as a long string, and then simply PRINT the string to launch the script. Do not include the Sub Main and End Sub lines, but everything inbetween. Separate multiple script lines with CHAR(25).
To pass data to a script you build in the BASIC program simply assign it to a script variable. For example, to display a message using the MsgBox function, and return the button clicked use: MSG = 'Do you want to proceed?' SCRIPT = '' SCRIPT = SCRIPT : 'X = "' : MSG : '"' : CHAR(25) SCRIPT = SCRIPT : 'Y = MsgBox(X, vbOkCancel)' : CHAR(25) SCRIPT = SCRIPT : 'InitSession.Output CStr(Y) & Chr$(13)' PRINT CHAR(27) : CHAR(2) : 'P' : SCRIPT : CHAR(13) : INPUT RESPONSE This sample assigns to the script variable X the value of the host variable MSG, enclosed in double-quote marks. Then the result of the MsgBox function is assigned to script variable Y. Finally, the result variable Y is sent to the host using the Session.Output method, followed by a CR. The result is picked up the the host program and stored in the host variable RESPONSE using the INPUT statement. You could dress this up a little by using PROMPT '' and ECHO OFF before the INPUT. |
|
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 |