[basic] INPUT WAIT?

126 views
Skip to first unread message

Kevin Doiron

unread,
Feb 4, 2019, 2:00:52 PM2/4/19
to Pick and MultiValue Databases
I've programmed in a number of languages over the years and I seem to recall that one of them had a construct with the INPUT command that would force a default value after a certain amount of time had passed, if there was no user input. I don't recall what the exact syntax was, or even if it was in a mv environment.

The code I have look sort of like this:
10 *
   * do some stuff
   SLEEP 600    ;* WAIT 10 MINUTES
   GO 10

The effect is an infinite loop. What I want to do is something like this:

10 *
   * do some stuff
   CRT "DO YOU WANT TO DO THIS AGAIN?"
   INPUT YESNO
   IF YESNO = "YES" OR IF (NO ANSWER AFTER 10 MINUTES) THEN GO 10
   STOP


Is my imagination running away, or have I just forgotten the syntax?

In case it makes a difference, I'm using UV11.1 in an AIX environment.

Thanks in advance for your answers.

David A. Green

unread,
Feb 4, 2019, 2:19:56 PM2/4/19
to mvd...@googlegroups.com

Here is one I use with UniData:

 

        INPUT ANY: WAITING DELAY.TIME THEN STOP

 

David A. Green

(480) 201-7953

DAG Consulting

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms

JJCSR

unread,
Feb 4, 2019, 2:21:42 PM2/4/19
to Pick and MultiValue Databases
Kevin:

I am using REALITY, with BASIC (we were formerly on D3, Advanced Pick, and GA), and I have the following syntax for an INPUT command that I use:

INPUT AMOUNT for 1200 else go 300 ; * release lock after 5 minutes

I have several programs running throughout our 125,000 sq ft retail space, with many, many terminals doing lookups on products, etc.   Because I have several items locked when they make a selection, I force a "RELEASE" on locked items after a specified time (above example holds for 5 minutes, then, if no activity, will release all locks on this port).

As you might imagine, the "go 300", following the "else", could very easily be a clause to do just about anything needed.

I don't know if the "for ..." clause exists on other MV systems, but it works for me.

Jim Cronin
Kittery Trading Post
Kittery, Maine

Nathan Rector

unread,
Feb 4, 2019, 2:23:27 PM2/4/19
to mvd...@googlegroups.com
I recall a version that did that too, but I always ended up doing the
following (well, I usually use LOOP/UNITIL/REPEAT instead of GOTO for
loops, but same process):

10

* Do something
* Wait 10 mins
TIMEOUT = TIME() + (60 * 10)
15*
IF SYSTEM(14) > 0 THEN
  * Found something in Keyboard Buffer
  BUFFER.LEN = SYSTEM(14)
  INPUT YESNO, BUFFER.LEN
  IF YESNO = "YES" THEN EXIT
END
SLEEP 1
IF (TIME() > TIMEOUT) THEN
  GO 10
END ELSE
  GO 15
END
* Timeout
GO 10
> --
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms

--

--------------------------------------------
Nathan Rector
International Spectrum, Inc
http://www.intl-spectrum.com
Phone: 720-259-1356

Conference Dates: April 8th-11th
http://www.intl-spectrum.com/conference/

Steve Trimble

unread,
Feb 4, 2019, 2:24:10 PM2/4/19
to mvd...@googlegroups.com
mvBASE has:
INPUTIF - so you could:
SLEEP 30
INPUTIF DIO ELSE DIO = 'Y'

d3 has:
INPUTWAIT

openQM has:
KEYIN with timeout options

take care,

Computerized Data Mgmt Inc
Steve Trimble
(501) 615-8674 office
(501) 772-3450 cell / text


--

Kevin Doiron

unread,
Feb 4, 2019, 4:48:30 PM2/4/19
to Pick and MultiValue Databases
Thanks to everyone for your responses.  It's good to know that I wasn't imagining things.

The syntax that I had forgotten was "INPUT ... FOR ...".  Once I saw Jim's response, I remembered it.    Unfortunately, while it may work in Reality, and on the jBase platform I used most recently, it does not work on UniVerse. Compiling gives me an error that "FOR" is not defined.  Sadly, neither did the "INPUT ... WAITING" syntax, and "SYSTEM(14)" is not defined in UniVerse.

However, the "INPUTIF" command seems like it will do the trick.

Thanks, everybody.


Brian Speirs

unread,
Feb 4, 2019, 6:39:22 PM2/4/19
to Pick and MultiValue Databases
For UniVerse, check Keith Johnson's routine on PickWiki:


Cheers,

Brian

Wols Lists

unread,
Feb 5, 2019, 8:46:38 AM2/5/19
to mvd...@googlegroups.com
For Pr1me (and then UniVerse) I know I used the "INPUT ANS, -1" syntax.
This will get the contents of the input buffer and put it in ANS,
returning immediately without waiting for a <CR>.

Because we had a whole variety of PCs running wIntegrate, and genuine
Pr1me and Wyse terminals as input devices, along with a fair few
technically clueless users, I wrote a little program as part of the
login sequence that sent the <ESC>E terminal response command, then
waited a second before an INPUT -1 to get the response. If I got an
intelligible answer I could set the TERM.TYPE otherwise I asked the
user. Saved me much grief.

Cheers,
Wol

Wols Lists

unread,
Feb 5, 2019, 8:49:31 AM2/5/19
to mvd...@googlegroups.com
On 04/02/19 19:22, Nathan Rector wrote:
> I recall a version that did that too, but I always ended up doing the
> following (well, I usually use LOOP/UNITIL/REPEAT instead of GOTO for
> loops, but same process):
>
> 10
>
> * Do something
> * Wait 10 mins
> TIMEOUT = TIME() + (60 * 10)
> 15*
> IF SYSTEM(14) > 0 THEN
> * Found something in Keyboard Buffer
> BUFFER.LEN = SYSTEM(14)
> INPUT YESNO, BUFFER.LEN
> IF YESNO = "YES" THEN EXIT
> END
> SLEEP 1
> IF (TIME() > TIMEOUT) THEN
> GO 10
> END ELSE
> GO 15
> END
> * Timeout
> GO 10

No system(14) in UV - see my other response, but the four lines

> IF SYSTEM(14) > 0 THEN
> * Found something in Keyboard Buffer
> BUFFER.LEN = SYSTEM(14)
> INPUT YESNO, BUFFER.LEN

Just become INPUT YESN0, -1

Cheers,
Wol

Ian McGowan

unread,
Feb 9, 2019, 4:34:55 AM2/9/19
to Pick and MultiValue Databases
Cache surprisingly has some of the best MV documentation.  They're agnostic to the different flavors and sometimes have the best comparisons of how the different systems do things.

Charlie Noah

unread,
Feb 9, 2019, 9:58:02 AM2/9/19
to mvd...@googlegroups.com
Ian, FYI http://www.pickwiki.com/index.php/InputWait has been timing out for several days.
Charlie
--

Sean Clark

unread,
Feb 13, 2019, 8:20:49 PM2/13/19
to Pick and MultiValue Databases
In Pick/D3 and Mentor I've used the Get command which has a 'waiting' clause.
It's somewhat lower level than the input command.

I think I first used it to make an input command that worked with arrow keys allowed multi-line editing of existing data in vanilla basic programs.
Reply all
Reply to author
Forward
0 new messages