The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
External Program Execution Terminology |
Post Reply |
Author | |
sbhenkel
Newbie Joined: March 03 2017 Status: Offline Points: 39 |
Post Options
Thanks(0)
Posted: March 12 2021 at 11:09am |
This concerns the two escape sequences that are available to execute external programs. ESC STX < "Executes the Windows command line command, then returns to AccuTerm..." and ESC STX > "Execute the Windows command line command and suspends the terminal session until the command completes." I am mainly interested in the second version. As quoted above, it says it executes the command and suspends the terminal session until... Then right below it says "Note: when using this function, you often need the host program to wait until the command terminates..." It then proceeds to suggest to use the ESC STX I command followed by an INPUT statement. I'm confused. If the basic function of the command "executes the window command line command and suspends...", isn't it redundant to say "you often need the host program to wait until the command terminates. If you require this functionality..." I mean, if the terminal session is suspended utnil the command completes, why do I need to follow it by an AccuTerm command that sends out a character string (release information) that I then capture with an input statement. The documentation even says AccuTerm will not process the ESC STX I until the command terminates." If it doesn't execute the extra escape sequence, doesn't that mean it's not going to execute ANYTHING else until the command terminates? It just seems unnecessary. The reason I even bring this up is because I tried following ESC STX > with ESC STX I (and then an INPUT statement) and it works fine. But it puts a line of needless information on the screen that will just confuse some people and quite honestly will throw certain display elements out of sequence. Is there something I'm missing in the wording of this command?
|
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi Steve - Good question. Here's why you need to add the INPUT to your Pick program. There are two CPUs running comcurrently - AccuTerm on the PC and the server running your Pick program. AccuTerm cannot influence your Pick program and cause it to pause. When you send the escape sequence to launch a program from AccuTerm using ESC STX >, AccuTerm is able to pause until the executed program terminates. When paused, it stops reading data from your Pick program and stops sending keys back to the Pick program. But the Pick program is running on an entirely separate CPU, and all you did to get AccuTerm to launch an external program is PRINT some data. What should the Pick program do after PRINT? It should execute the next statement. Which it does, and there is nothing to make it pause until the external program terminates. Hence the INPUT statement. That causes the Pick program to wait for input before proceeding. It just waits until the INPUT is satisfied. The extra ESC STX I that the Pick program sends to AccuTerm is stuck in some buffer until AccuTerm is resumes, when the external program terminates. At that time AccuTerm reads this from the buffer, and processes it, sending its registration text back to the Pick program, which is waiting at INPUT. You can prevent the screen mess by using ECHO OFF before INPUT and ECHO ON after, also a PROMPT '' will prevent the prompt character from messing the screen. Thanks, Pete |
|
sbhenkel
Newbie Joined: March 03 2017 Status: Offline Points: 39 |
Post Options
Thanks(0)
|
That makes perfect sense now. Thank you. :-)
|
|
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 |