You can add */m-timer.shm* to the end of your command line in the shell.bat file.

However, a side effect of using a startup macro is that it prevents the shell screen from properly displaying. To correct that issue, you can add this to the beginning of the macro:

{Ctrl-F3}{Ctrl-F3}

That forces the Shell screen to do a refresh.

Another curious thing about the way Shell works is that the timer doesn't seem to work if you're sitting at the Shell menu screen. (It also doesn't work when sitting inside some other programs running under Shell such as ED.) But as soon as you go into DP it starts working. That wasn't intentional. Nothing in the macro code makes it specific to DP. Just something I've noticed. However, if a {PROMPT}msg~ line is added to the macro to count off the time (as I did while debugging the macro), that makes it work no matter what screen you're sitting at. Not sure why that it is.

Like I said, not guaranteed to be perfectly reliable.

Tim Rude

On 9/2/2015 9:46 AM, [email protected] wrote:
Tim. How can I run the macro time.shm when I start shell? I open shell with a DOS batch file shell.bat containing:

i:\dp23\mc shell /nt=0 /u=RIK /d-c:\shell\temp

Sent from my iPhone

Begin forwarded message:

*From:* "[email protected] <mailto:[email protected]>" <[email protected] <mailto:[email protected]>>
*Date:* August 31, 2015 at 3:58:16 PM EDT
*To:* Tim Rude <[email protected] <mailto:[email protected]>>
*Subject:* *Re: [Dataperf] Macro to exit DP*

This is exactly what I need. Thank you!

Sent from my iPhone

On Aug 31, 2015, at 1:27 PM, Tim Rude <[email protected] <mailto:[email protected]>> wrote:

Not guaranteed to be perfectly reliable but I've slapped together the attached Shell 4.0 macro that might work for you.

Essentially, it has to stay running the entire time DP is running to monitor for keystrokes and pass them through to DP. When it times out, it should exit from both DP and Shell.

You set the number of seconds for the timeout on the first line of the macro.

It's probably not bulletproof and there's no visible indication that it's running until the time runs out and everything exits. And if the user presses Ctrl-Alt-Shift-F1 it will abort the macro and prevent the timeout from ever happening. It survives a normal F1 but not the super Ctrl-Alt-Shift-F1.

Test it and tinker with it. Adjust it as you want or need to.

"No deposit, no return."

Tim Rude

PS: In case the attachment gets stripped off, here's the listing of the macro so that it can be re-entered via Editor:

========== START LISTING ==========
{ASSIGN}TimeOut~30~

{;}TimeOut·is·the·number·of·seconds·to·wait·for·a·keypress·before~
{;}giving·up·and·exiting.~

{;}So,·to·wait·one·minute·(approximately),·TimeOut·should·be·set·to·60.~
{;}To·wait·5·minutes,·TimeOut·should·be·300.·For·10·minutes·600,·etc.~

{;}Note·that·times·will·not·be·perfectly·exact·but·should·be·close.~

{CANCEL OFF}

{ASSIGN}Timer~0~
{ASSIGN}Ticks~{VARIABLE}TimeOut~*18~

{WHILE}{VARIABLE}Timer~<{VARIABLE}Ticks~~
  {LOOK}Key~
  {IF EXISTS}Key~
    {ASSIGN}Timer~0~
    {;}Reset·the·timer~
{IF}{KTON}{VARIABLE}Key~~=33023~{ELSE}{VARIABLE}Key~{END IF}
{;}33023·is·the·code·used·when·shell·cannot·recognize/process·keystroke~
{;}properly.·We·ignore·these·keystrokes·to·keep·shell·from·crashing.~
{;}This·isn't·documented·anywhere·-·I·found·it·by·trial·and·error.~
  {ELSE}
    {ASSIGN}Timer~{VARIABLE}Timer~+1~
    {WAIT}1~
  {END IF}
{END WHILE}

{;}If·we·get·here,·our·timer·has·run·out·and·we·need·to·exit.~

{;}The·following·should·exit·from·both·DP·and·Shell.~

{DISPLAY OFF}
{Ctrl-Alt- }
{DISPLAY OFF}
{F7}4{Enter}
{F1}{F1}{F1}{F1}{F1}{F1}{F1}{F1}{F1}{F1}
{Esc}{Esc}{Esc}{Esc}{Esc}{Esc}{Esc}{Esc}{Esc}{Esc}
{F7}{F7}{F7}{F7}{F7}{F7}{F7}{F7}{F7}{F7}
========== END LISTING ==========

On 8/31/2015 10:18 AM, Robert Kendall wrote:
Is there a way to use a shell macro to exit DP after an interval of inactivity?

Robert Kendall


_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf

<TIMER.SHM>
_______________________________________________
Dataperf mailing list
[email protected] <mailto:[email protected]>
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf


_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf

_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf

Reply via email to