Re: [U2] KeyPressed

2013-08-12 Thread Brian Leach
Just for information now,

Input thisKey, -1 just returns whether or not there is anything in the input
buffer. It doesn't input it.

So -

* test ..
Loop
  (stuff)
  Input IsSomethingThere, -1
Until IsSomethingThere Do
Repeat
  
* and clear it out ..

  Loop
Input IsSomethingThere,-1 Do
  While IsSomethingThere Do
Discard = KeyIn()
  Repeat
  

Brian

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: 09 August 2013 21:04
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to
display the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


[U2] KeyPressed

2013-08-09 Thread Bill Brutzman
With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to
display the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread David A. Green
Try a HUSH ON/OFF around your input.

David A. Green
(480) 813-1725
DAG Consulting

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 1:04 PM
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to
display the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread Tom Whitmore
I do agree that INPUTCLEAR should work but since it doesn't, try CLEARDATA.

Your example seems to be missing something that may help clarify things but 
another thought is:
  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1
 input junk,1:

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen

The input junk,1 will take the first character entered and discard it but it 
will clear the buffer,

Tom Whitmore
RATEX Business Solutions

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 4:04 PM
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection 
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to display 
the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread Bill Brutzman
Tom:

Thanks for writing... but...

Once I put in 

Input junk, 1:

The loop waits for a user input and thus stops updating time.

--Bill

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tom Whitmore
Sent: Friday, August 9, 2013 4:19 PM
To: U2 Users List
Subject: Re: [U2] KeyPressed

I do agree that INPUTCLEAR should work but since it doesn't, try
CLEARDATA.

Your example seems to be missing something that may help clarify things but
another thought is:
  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1
 input junk,1:

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen

The input junk,1 will take the first character entered and discard it but
it will clear the buffer,

Tom Whitmore
RATEX Business Solutions

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 4:04 PM
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to
display the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread Tom Whitmore
Sorry, you need to do:
If (thisKey = '1') then
   Input junk,1:
End

Tom Whitmore
RATEX Business Solutions



-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 4:22 PM
To: 'U2 Users List'
Subject: Re: [U2] KeyPressed

Tom:

Thanks for writing... but...

Once I put in 

Input junk, 1:

The loop waits for a user input and thus stops updating time.

--Bill

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tom Whitmore
Sent: Friday, August 9, 2013 4:19 PM
To: U2 Users List
Subject: Re: [U2] KeyPressed

I do agree that INPUTCLEAR should work but since it doesn't, try CLEARDATA.

Your example seems to be missing something that may help clarify things but 
another thought is:
  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1
 input junk,1:

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen

The input junk,1 will take the first character entered and discard it but it 
will clear the buffer,

Tom Whitmore
RATEX Business Solutions

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 4:04 PM
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection 
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to display 
the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread Wjhonson
Bill you need to check the typeahead buffer to see if there is any key to 
process

You can use the INPUTIF command, if the type ahead buffer is empty it will take 
the ELSE clause
You can then do this in a loop with a time display as you wished

 

 Also look at the INPUT JUNK, -1
which will look at the typeahead buffer as well


 

-Original Message-
From: Bill Brutzman bi...@hkmetalcraft.com
To: 'U2 Users List' u2-users@listserver.u2ug.org
Sent: Fri, Aug 9, 2013 1:22 pm
Subject: Re: [U2] KeyPressed


Tom:

Thanks for writing... but...

Once I put in 

Input junk, 1:

The loop waits for a user input and thus stops updating time.

--Bill

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tom Whitmore
Sent: Friday, August 9, 2013 4:19 PM
To: U2 Users List
Subject: Re: [U2] KeyPressed

I do agree that INPUTCLEAR should work but since it doesn't, try
CLEARDATA.

Your example seems to be missing something that may help clarify things but
another thought is:
  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1
 input junk,1:

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen

The input junk,1 will take the first character entered and discard it but
it will clear the buffer,

Tom Whitmore
RATEX Business Solutions

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 4:04 PM
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to
display the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread Allen Egerton
0001   EQUATE TRUE TO 1
0002   EQUATE FALSE TO 0
0003   PROMPT 
0004   DUMMY = @(0,0)
0005 *
0006   WAIT = TRUE
0007   LOOP WHILE WAIT
0008  INPUT XYZ, -1
0009  IF (XYZ) THEN
0010 INPUT XYZ,1  ; *  Eat the char
0011 WAIT = FALSE
0012  END ELSE
0013 SLEEP 1
0014 CRT OCONV(TIME(), MTHS)
0015  END
0016   REPEAT
0017 *
0018   CRT OUT OF LOOP
0019   CRT 'BYE'

(Allen - Sent from my paperweight)

On Aug 9, 2013, at 4:04 PM, Bill Brutzman bi...@hkmetalcraft.com wrote:

 With Dynamic Connect... and UniBasic...
 
 I need a screen that continuously displays time... as we have an inspection
 screen where press operators enter fresh data each hour.  Something like...
 
  loop
 
call *timeOfDay
call *displayOtherStuff
 
 input thisKey, -1
 
  until (thisKey = '1')
 
 sleep
 
  repeat  
 
  gosub secondScreen
 
 
 
 The trouble with this thing is... when a key is pressed... it wants to
 display the key on asubsequent screen.
 
 I tried...inputclear... but it is not doing what I want.
 
 Suggestions would be appreciated.
 
 --Bill
 
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread McGowan, Ian
Assuming Unidata (because Unibasic) the IN() function is handy (a working 
example at http://www.pickwiki.com/cgi-bin/wiki.pl?GetLineStack )

Syntax
IN( )

Description
The UniBasic IN function captures raw data from an input queue or
from a terminal.
Tip: IN can capture function, arrow, and other special keys from the keyboard.

Example
In the following example, the program segment assigns the value y to ANSWER:
DATA y
ANSWER = IN()

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 1:04 PM
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection 
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to display 
the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
-
IMPORTANT NOTICE:   This message is intended only for the addressee
and may contain confidential, privileged information.  If you are
not the intended recipient, you may not use, copy or disclose any
information contained in the message.  If you have received this
message in error, please notify the sender by reply e-mail and
delete the message.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] KeyPressed

2013-08-09 Thread Bill Brutzman
Thanks to those who responded... especially Will... 

I could not get the hush to behave

With a Tiger note on inputIF before I saw Ian's and Allen's response... I
whipped up the following.

--Bill


  include BP BASELINE.R9

*---
---

  gosub mainLoop
  
  go theEnd

*---
---
*---
---
mainLoop:

  call *HEADER.CLEAR.R1
 *crt @(-1)
  
  crt @(0, 1) :  ' '
  crt @(0, 2) :  ' |  |'
  crt @(0, 3) :  ' |  HotKey  |  ' : Red : ' KeyBoard.Test ' : Grn
  crt @(0, 4) :  ' |__|'   
 
  crt @(0, 8) :  '  Press Any Key   ' :

  loop
   timeNow = time()
  timeNowF = oconv(timeNow, 'MTS')
  
  crt @(4,6) : timeNowF 

  INPUTIF @(4,10) keyFlag, -1  
  THEN   typeAheadEmpty = 1  
  ELSE   typeAheadEmpty = 0 
  
  until  typeAheadEmpty do 

  sleep 

  repeat

  gosub secondScreen

return

*---
---
secondScreen:

  call *HEADER.CLEAR.R1
 *crt @(-1)
  
  crt Red : 'first keyFlag ' : Grn : keyFlag 
  crt
  crt ' [#]  [X] ' :
  
  inputclear
  
  input ans, 1
ans = upcase(ans)

  crt '__'
  crt
  crt ans
  sleep

  begin case
case ans = 'X'  ;  go theEnd
case 1  ;  go secondScreen 
  end   case 

return

*---
---
theEnd:

  call *HEADER.CLEAR.R1
 *crt @(-1)
  
  END
  

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
Sent: Friday, August 9, 2013 4:35 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] KeyPressed

Bill you need to check the typeahead buffer to see if there is any key to
process

You can use the INPUTIF command, if the type ahead buffer is empty it will
take the ELSE clause You can then do this in a loop with a time display as
you wished

 

 Also look at the INPUT JUNK, -1
which will look at the typeahead buffer as well


 

-Original Message-
From: Bill Brutzman bi...@hkmetalcraft.com
To: 'U2 Users List' u2-users@listserver.u2ug.org
Sent: Fri, Aug 9, 2013 1:22 pm
Subject: Re: [U2] KeyPressed


Tom:

Thanks for writing... but...

Once I put in 

Input junk, 1:

The loop waits for a user input and thus stops updating time.

--Bill

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tom Whitmore
Sent: Friday, August 9, 2013 4:19 PM
To: U2 Users List
Subject: Re: [U2] KeyPressed

I do agree that INPUTCLEAR should work but since it doesn't, try
CLEARDATA.

Your example seems to be missing something that may help clarify things but
another thought is:
  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1
 input junk,1:

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen

The input junk,1 will take the first character entered and discard it but
it will clear the buffer,

Tom Whitmore
RATEX Business Solutions

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Brutzman
Sent: Friday, August 09, 2013 4:04 PM
To: 'U2 Users List'
Subject: [U2] KeyPressed

With Dynamic Connect... and UniBasic...

I need a screen that continuously displays time... as we have an inspection
screen where press operators enter fresh data each hour.  Something like...

  loop

call *timeOfDay
call *displayOtherStuff

 input thisKey, -1

  until (thisKey = '1')
  
 sleep
  
  repeat  

  gosub secondScreen



The trouble with this thing is... when a key is pressed... it wants to
display the key on asubsequent screen.

I tried...inputclear... but it is not doing what I want.

Suggestions would be appreciated.

--Bill

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2