RE: [U2] Press any key to continue...

2008-04-30 Thread Dennis Bartlett
Well, the actual question asks why it occurs, not really how to fix it,

So...

In Universe Basic one doesn't have to define the length of an input value,
tho' one can, 
eg INPUT ANS,1

Instead it allows any length of input, so a space bar entry might just be
part of a string entered - as one could enter in response to a prompt for 

 Reason for discard 

 something like 

 the item was run over by a rampant forklift and is in a sorry state

 even if the prompt was masked as a 20 character prompt. You will see that
the input contains embedded spaces. If the system were to react to a single
space, as if to interpret the space as being 

SPACE : CR

the first space would end input of the string and you would end up with just
the

One way to beat this, and still allow you to use a single space as an exit
character, would be to create a loop that inputs a single character, then
tests if that character is a space. If so, exit the loop, if not, append
that character to the end of a string, eg

InputtedValue = ''
Loop
   Input Val,1:
   if Val=' ' then exit
   InputtedValue := Val
Repeat

On exit via the entry of a single space, the string InputtedValue will
contain all the inputted field. 

Note: the : at the end of the Input Val,1: statement makes the input prompt
wait at the end of the string already entered, giving the impression that
the program is actually accepting the whole string as a single entry, and
not just a character at a time.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Ferries
Sent: 29 April 2008 09:46 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Press any key to continue...

Hi All,

We were coding a standard INPUT ANS after asking a user to Press any key to
continue 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Unable to Compile

2008-04-30 Thread Dennis Bartlett
This would happen if someone replaced the BASIC command with either a
paragraph or cataloged proggie? I've been known to do this in the past -
when I wanted to know who had compiled what. If the proggie then failed to
compile, there would be nothing to run...

The VOC entry for BASIC on this site (just in case - I realise it's a long
shot :-)

BASIC
0001: V
0002: nbasic
0003: E
0004: SFG
0005: 
0006: INFORMATION.FORMAT

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Baruch Salamander
Sent: 30 April 2008 03:34 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Unable to Compile

   Greetings,
   Did anyone ever experience the following on Universe?
   BASIC BP TEST
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread Baker Hughes
If I could extend the question just a little ... would anyone like to share 
their Standard.Input.Sub that they call from all their input screens.  Its 
always illuminating to see how others do it.

-Baker
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread Bill Haskett
Allen:

I ran into a side-note recently.  I've used a character-parsing loop for years 
like:

****
MenuExit = 0; ** initialize menu-exit variable
DecStr   = NULL$; ** initialize decimal keypress
HexStr   = NULL$; ** initialize hex keypress
KeyStr   = NULL$; ** initialize ascii keypress
*
** Enter keypress capturing code
** U2 version block.  This code simply waits for all keypress events and
** returns the ASCII, HEX, and DECIMAL value(s) of that keypress by
** testing for anything else existing in the Type-Ahead variable.
*LOOP  ; ** UV 
version
*   AsciiChar = KEYIN()  ; ** get ascii value   UV 
version
*   DecChar   = SEQ(AsciiChar)   ; ** convert ascii to decimal  UV 
version
*   DecStr   := DecChar : SP1; ** build decimal keypressUV 
version
*   KeyStr   := AsciiChar; ** build ascii keypress  UV 
version
*   HexStr   := OCONV(AsciiChar, 'MX')   ; ** hex value UV 
version
*   INPUT TA.FULL,-1 ; ** TAhead full?  UV 
version
*UNTIL NOT(TA.FULL) DO REPEAT  ; ** UV 
version
*
** This code will wait for proper input and if no keypress event occurs then
** if this is called from a menu then the screen timer variable (WaitTime) is
** processed and navigation is routed to the previous menu.
LOOP  ; ** UD 
version
   IF NOT(WaitTime) THEN  ; ** UD 
version
  INPUT AsciiChar,1: UNFILTERED ; ** get a raw byteUD 
version
   END ELSE   ; ** UD 
version
  INPUT AsciiChar,1: FOR WaitTime UNFILTERED THEN ; ** UD 
version
 NULL ; ** UD 
version
  END ELSE; ** UD 
version
 IF I.VALUE = NULL$ THEN I.VALUE = WCHAR  ; ** UD 
version
 AsciiChar = CHAR(13) ; ** UD 
version
 MenuExit  = 1; ** UD 
version
  END ; ** UD 
version
   END; ** UD 
version
   DecChar  = SEQ(AsciiChar); ** convert to decimalUD 
version
   HexStr  := OCONV(AsciiChar, 'MX'); ** convert to hexUD 
version
   DecStr  := DecChar : SP1 ; ** build decimal string  UD 
version
   KeyStr  := AsciiChar ; ** build ascii   UD 
version
UNTIL NOT(SYSTEM(14)) DO REPEAT   ; ** UD 
version
*
** End of Include
****

From within other BASIC code, where I want to manage data input, as opposed to
character input, I'd do something like:

****
ECHO OFF; ** turn echo off to control output
DataInputStr$ = NULL$
LOOP
   WaitTime = 0
   INCLUDE DTABP,INCLUDES DATA.INPUT
   ...place some character test code here (e.g CR$ / LF$ / TAB$ / ESC$ / etc)
UNTIL LastHex = '0A' OR LastHex = '0D' DO
   ...place processing code here...
*
** Update the Data Input here (non screen-editor input)
   DataInputStr$ := KeyStr
   CRT KeyStr :
REPEAT
ECHO ON; ** turn echo back on
****

In D3 we had no problem with this code.  However, in UniData, we were having 
some
problems with slow network connections, in that characters would seem to be 
dropped
or merged within the character-processing loop.  So I'm guessing UD's version 
of this
process is a little less robust (but maybe not).  I never tested the UV code to 
see
if this this latency problem occured.  Also, terminal types never made any 
difference
because we'd define page and arrow keys in common like:

...in Include
NULL$   = ''
PgUpField   = 15
PgDnField   = 16
PageUpKey   = TermInfoRecPgUpField
PageDownKey = TermInfoRecPgDnField

...in main program key processing loop we might do
IF DataInputStr$ = NULL$ THEN
   IF KeyStr = PageUpKey   THEN ...do something
   IF KeyStr = PageDownKey THEN ...do something else
   ...etc...
END

Now it doesn't matter what terminal type people are using, as long as it's 
defined at
login.

Bill

-Original Message-
From: [EMAIL PROTECTED] [mailto:owner-u2-
[EMAIL PROTECTED] On Behalf Of Allen Egerton
Sent: Wednesday, April 30, 2008 2:32 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Press any key to continue...

Dennis Bartlett 

Re: [U2] Unable to Compile

2008-04-30 Thread john reid
A cruel trick using a no-op and VOCLIB?

On 4/30/08, Baruch Salamander [EMAIL PROTECTED] wrote:
   Greetings,
   Did anyone ever experience the following on Universe?
   BASIC BP TEST
   
   The program didn't compile in TCL and no error messages appeared after
   pressing return. The same occurred in multiple accounts using multiple
   programs. It worked after several tries. We are trying to find out what
   would prevent a program from being compiled?
   Baruch
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/



-- 
john
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Unable to Compile

2008-04-30 Thread Mark Eastwood
Check Permissions on BP (and BP.O)?

Mark


-Original Message-

   Did anyone ever experience the following on Universe?
   BASIC BP TEST
   
   The program didn't compile in TCL and no error messages appeared
after
   pressing return. The same occurred in multiple accounts using
multiple
   programs. It worked after several tries. We are trying to find out
what
   would prevent a program from being compiled?
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread Tim Stokes
You can also try ANS = KEYIN()


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Ferries
Sent: Tuesday, April 29, 2008 2:46 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Press any key to continue...

Hi All,

We were coding a standard INPUT ANS after asking a user to Press any
key to continue We noticed that the program would not accept a
Space Bar as a valid key; it only moves the cursor to the right.

However, the Press any key to continue... message from UniVerse accepts
the Space Bar as a valid key.
Can someone shed any light on how this prompt works? We know the magic
command to suppress the message: UDUMY = @(0), but we are more
interested in why the INPUT command does not treat the space as the
UniVerse message does.

Thanks

Steve

Steve Ferries
Vice President Information Technologies
Total Credit Recovery Limited
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


[U2] re: set timeout for KEYIN()

2008-04-30 Thread Irina Lissok
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread roy
You might want to look at CINPUT.SUB.B in the APP.PROGS file in the UV
account.

Roy

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Baker Hughes
Sent: Wednesday, April 30, 2008 10:53 AM
To: 'u2-users@listserver.u2ug.org'
Subject: RE: [U2] Press any key to continue...

If I could extend the question just a little ... would anyone like to share
their Standard.Input.Sub that they call from all their input screens.  Its
always illuminating to see how others do it.

-Baker
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread Colin Alfke
We had one user (a lawyer - go figure) complain, quite vigorously, that the
Shift key wouldn't be accepted as ANY key. 

Colin Alfke
Calgary, Canada

-Original Message-
From: Steve Ferries

Hi All,

We were coding a standard INPUT ANS after asking a user to Press any
key to continue We noticed that the program would not accept a
Space Bar as a valid key; it only moves the cursor to the right.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread Marc Harbeson
In this case, simply re-labeling the Enter key as Any would be the
best way to proceed


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Colin Alfke
Sent: Wednesday, April 30, 2008 4:13 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Press any key to continue...

We had one user (a lawyer - go figure) complain, quite vigorously, that
the
Shift key wouldn't be accepted as ANY key. 

Colin Alfke
Calgary, Canada

-Original Message-
From: Steve Ferries

Hi All,

We were coding a standard INPUT ANS after asking a user to Press any
key to continue We noticed that the program would not accept a
Space Bar as a valid key; it only moves the cursor to the right.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread Baker Hughes
Ah. a new product line  MS Keyboard, esquire


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Harbeson
Sent: Wednesday, April 30, 2008 3:50 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Press any key to continue...

In this case, simply re-labeling the Enter key as Any would be the best way 
to proceed


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Colin Alfke
Sent: Wednesday, April 30, 2008 4:13 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Press any key to continue...

We had one user (a lawyer - go figure) complain, quite vigorously, that the 
Shift key wouldn't be accepted as ANY key.

Colin Alfke
Calgary, Canada

-Original Message-
From: Steve Ferries

Hi All,

We were coding a standard INPUT ANS after asking a user to Press any key to 
continue We noticed that the program would not accept a Space Bar as a 
valid key; it only moves the cursor to the right.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Press any key to continue...

2008-04-30 Thread Allen E. Elwood
I think you could just get away using the IN() form of input.

CH.IN = SEQ(IN())

This is from the word processor I wrote where it returns the numeric value
of any key pressed *including* the space bar.  You wouldn't need to evaluate
the response for your purpose though

hth

Allen

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Marc Harbeson
Sent: Wednesday, April 30, 2008 13:50
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Press any key to continue...


In this case, simply re-labeling the Enter key as Any would be the
best way to proceed


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Colin Alfke
Sent: Wednesday, April 30, 2008 4:13 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Press any key to continue...

We had one user (a lawyer - go figure) complain, quite vigorously, that
the
Shift key wouldn't be accepted as ANY key.

Colin Alfke
Calgary, Canada

-Original Message-
From: Steve Ferries

Hi All,

We were coding a standard INPUT ANS after asking a user to Press any
key to continue We noticed that the program would not accept a
Space Bar as a valid key; it only moves the cursor to the right.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Guaranteed unique sequential keys

2008-04-30 Thread Anthony W. Youngman
In message [EMAIL PROTECTED], Glen Batchelor 
[EMAIL PROTECTED] writes

-Original Message-
From: [EMAIL PROTECTED] [mailto:owner-u2-
[EMAIL PROTECTED] On Behalf Of Anthony W. Youngman
Sent: Saturday, April 26, 2008 9:14 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Guaranteed unique sequential keys

In message [EMAIL PROTECTED], Glen B
[EMAIL PROTECTED] writes
 It's not overkill if you need a multi-app/multi-process service that
offers
a single source for sequential keys. The other option is disk file
locking.
Any way you look at it, you have to go to one place for the key. Don't
relay
on O/S random numbers either. Even those are flawed at high resolution.

Ummm

My first reaction to this was linux has a guaranteed true random number
generator - the only problem is that if it runs out of randomness it
simply stops generating and anything asking for a number has to wait.

Oh - and what do you mean by high resolution? I think that, if you
have a true random number generator, the chances of having a collision
approach 50% when you've used only 10% of the number space. (The classic
question about this is how many people do you need in a room to have
even odds that two of them will share a birthday?. I think the answer
is about 20.)



 That is true and what I mean by high resolution is extremely frequent
requests. The scale of that is dependant on the hardware and the application
making the requests. When the entropy pool runs out, you get a function
block until more hardware data is available to generate a new value. That is
what I mean by flawed. If you have a tiny box with a small entropy pool,
you could exhaust the entropy pool often which could lead to performance
issues. Of course, the new pseudo generators don't block at all. That is
what you are referring to below. The problem there is that entropy pool is
reused to generate pseudo bits to regenerate new keys from, which increases
the chance of repeated keys.


Except that there, the whole point is you DON'T WANT the entropy pool 
used at all, because then you can't guarantee unique keys ... :-)



But then, if you want unique, pseudo-random keys, I think there are
generators that are guaranteed to return every possible number, only
once, each cycle through the number space.

None of this, however, solves the OP's original problem, I don't
think...

Cheers,
Wol


 That's true. Random keys can not be sorted by order of creation.


Nor can they guarantee uniqueness.



Cheers,
Wol
--
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/