Zumasys Homepage
Forum Home Forum Home > AccuTerm > Scripting & Automation
  New Posts New Posts RSS Feed - External Program Execution Terminology
  FAQ FAQ  Forum Search   Register Register  Login Login

External Program Execution Terminology

 Post Reply Post Reply
Author
Message
sbhenkel View Drop Down
Newbie
Newbie


Joined: March 03 2017
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbhenkel Quote  Post ReplyReply Direct Link To This Post Topic: External Program Execution Terminology
    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?
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2142
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: March 12 2021 at 12:26pm
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

Back to Top
sbhenkel View Drop Down
Newbie
Newbie


Joined: March 03 2017
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbhenkel Quote  Post ReplyReply Direct Link To This Post Posted: March 12 2021 at 2:46pm
That makes perfect sense now.  Thank you. :-)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.