In Windows, is there a way to query pending keyboard input beforeThe LINES() function will tell you if there are any lines in the input
issuing the PULL or LINEIN function so the program does not wait on
input?
On 1/5/2018 6:33 PM, Steve DuBow wrote:
In Windows, is there a way to query pending keyboard input beforeThe LINES() function will tell you if there are any lines in the input buffer. It can't tell you how *many* lines; it just returns 1 if there
issuing the PULL or LINEIN function so the program does not wait on
input?
are any. Similarly, CHARS() will tell you if there are any characters in
the buffer.
¬R
I've tried LINES() before and it didn't work. I have a SLEEP timerWeird, I just tried it with ooRexx on Windows and had the opposite
that runs for 15 seconds. During that period I enter data but when I
come out of SLEEP and test LINES(), it's 0.
Reads and returns the next key from the keyboard buffer. If the
keyboard buffer is empty, SysGetKey waits until a key is pressed.
Unlike the CHARIN built-in function, SysGetKey does not wait until
the Enter key is pressed.
On 1/9/2018 4:04 PM, Steve DuBow wrote:
I've tried LINES() before and it didn't work. I have a SLEEP timerWeird, I just tried it with ooRexx on Windows and had the opposite
that runs for 15 seconds. During that period I enter data but when I
come out of SLEEP and test LINES(), it's 0.
problem: If I type any characters but don't press ENTER, I still get
LINES() = 1, where I expected LINES() = 0 and CHARS() = 1.
I also lose the rest of the last line after reading the start of it with CHARIN(), and can't read it at all until I hit ENTER:
1 *-* Trace A
2 *-* say syssleep(1)
0
3 *-* say chars() lines()
1 1
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
as
1 61 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
2 73 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
3 0D 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
4 0A 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
df
--- pauses here until I hit ENTER again ---
5 64 0 0
6 *-* end
4 *-* do i = 1 while chars()
7 *-* say i
6
Oh, I see, for input without ENTER there's SysGetKey:
Reads and returns the next key from the keyboard buffer. If the
keyboard buffer is empty, SysGetKey waits until a key is pressed.
Unlike the CHARIN built-in function, SysGetKey does not wait until
the Enter key is pressed.
But since that waits for a key to be pressed, it's no good for testing
for input without a wait.
¬R
Perhaps you could get the first character with SysGetKey and then start
the Do While to get the rest of them?
HelloWould appreciate any insight. Thank you.
In Windows, is there a way to query pending keyboard input before issuing the PULL or LINEIN function so the program does not wait on input? I cannot find a REXX function that allows this. Do you have to use a Windows interface to accomplish this?
On 1/9/2018 4:04 PM, Steve DuBow wrote:
I've tried LINES() before and it didn't work. I have a SLEEP timerWeird, I just tried it with ooRexx on Windows and had the opposite
that runs for 15 seconds. During that period I enter data but when I
come out of SLEEP and test LINES(), it's 0.
problem: If I type any characters but don't press ENTER, I still get
LINES() = 1, where I expected LINES() = 0 and CHARS() = 1.
I also lose the rest of the last line after reading the start of it with CHARIN(), and can't read it at all until I hit ENTER:
1 *-* Trace A
2 *-* say syssleep(1)
0
3 *-* say chars() lines()
1 1
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
as
1 61 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
2 73 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
3 0D 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
4 0A 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
df
--- pauses here until I hit ENTER again ---
5 64 0 0
6 *-* end
4 *-* do i = 1 while chars()
7 *-* say i
6
Oh, I see, for input without ENTER there's SysGetKey:
Reads and returns the next key from the keyboard buffer. If the
keyboard buffer is empty, SysGetKey waits until a key is pressed.
Unlike the CHARIN built-in function, SysGetKey does not wait until
the Enter key is pressed.
But since that waits for a key to be pressed, it's no good for testing
for input without a wait.
¬R
On Friday, January 5, 2018 at 6:33:16 PM UTC-5, Steve DuBow wrote:Would appreciate any insight. Thank you.
Hello
In Windows, is there a way to query pending keyboard input before issuing the PULL or LINEIN function so the program does not wait on input? I cannot find a REXX function that allows this. Do you have to use a Windows interface to accomplish this?
Put the Syskeyget in a separate rexx exec. When Syskeyget shows the data has come in put it in a .local variable. In another exec use RXWINEXEC to start the first exec and check the .local variable.
On 1/9/2018 9:24 PM, Glenn Knickerbocker wrote:
On 1/9/2018 4:04 PM, Steve DuBow wrote:
I've tried LINES() before and it didn't work. I have a SLEEP timerWeird, I just tried it with ooRexx on Windows and had the opposite
that runs for 15 seconds. During that period I enter data but when I
come out of SLEEP and test LINES(), it's 0.
problem: If I type any characters but don't press ENTER, I still get LINES() = 1, where I expected LINES() = 0 and CHARS() = 1.
I also lose the rest of the last line after reading the start of it with CHARIN(), and can't read it at all until I hit ENTER:
1 *-* Trace A
2 *-* say syssleep(1)
0
3 *-* say chars() lines()
1 1
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
as
1 61 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
2 73 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
3 0D 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
4 0A 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
df
--- pauses here until I hit ENTER again ---
5 64 0 0
6 *-* end
4 *-* do i = 1 while chars()
7 *-* say i
6
Oh, I see, for input without ENTER there's SysGetKey:
Reads and returns the next key from the keyboard buffer. If the
keyboard buffer is empty, SysGetKey waits until a key is pressed.
Unlike the CHARIN built-in function, SysGetKey does not wait until
the Enter key is pressed.
But since that waits for a key to be pressed, it's no good for testing
for input without a wait.
¬R
Perhaps you could get the first character with SysGetKey and then start
the Do While to get the rest of them?
This is vaguely familiar from my micro-processor days in RAS.
--
Les (Change Arabic to Roman to email me)
On 1/9/2018 4:04 PM, Steve DuBow wrote:
I've tried LINES() before and it didn't work. I have a SLEEP timerWeird, I just tried it with ooRexx on Windows and had the opposite
that runs for 15 seconds. During that period I enter data but when I
come out of SLEEP and test LINES(), it's 0.
problem: If I type any characters but don't press ENTER, I still get
LINES() = 1, where I expected LINES() = 0 and CHARS() = 1.
I also lose the rest of the last line after reading the start of it with CHARIN(), and can't read it at all until I hit ENTER:
1 *-* Trace A
2 *-* say syssleep(1)
0
3 *-* say chars() lines()
1 1
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
as
1 61 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
2 73 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
3 0D 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
4 0A 1 1
6 *-* end
4 *-* do i = 1 while chars()
5 *-* say i charin()~c2x chars() lines()
df
--- pauses here until I hit ENTER again ---
5 64 0 0
6 *-* end
4 *-* do i = 1 while chars()
7 *-* say i
6
Oh, I see, for input without ENTER there's SysGetKey:
Reads and returns the next key from the keyboard buffer. If the
keyboard buffer is empty, SysGetKey waits until a key is pressed.
Unlike the CHARIN built-in function, SysGetKey does not wait until
the Enter key is pressed.
But since that waits for a key to be pressed, it's no good for testing
for input without a wait.
¬R
On Thursday, January 11, 2018 at 5:15:49 AM UTC-8, Garry Smithwick wrote:Would appreciate any insight. Thank you.
On Friday, January 5, 2018 at 6:33:16 PM UTC-5, Steve DuBow wrote:
Hello
In Windows, is there a way to query pending keyboard input before issuing the PULL or LINEIN function so the program does not wait on input? I cannot find a REXX function that allows this. Do you have to use a Windows interface to accomplish this?
Put the Syskeyget in a separate rexx exec. When Syskeyget shows the data has come in put it in a .local variable. In another exec use RXWINEXEC to start the first exec and check the .local variable.
Interesting Tack. I'll try this. Many thanks.
On Thursday, January 11, 2018 at 10:56:52 AM UTC-5, Steve DuBow wrote:this? Would appreciate any insight. Thank you.
On Thursday, January 11, 2018 at 5:15:49 AM UTC-8, Garry Smithwick wrote:
On Friday, January 5, 2018 at 6:33:16 PM UTC-5, Steve DuBow wrote:
Hello
In Windows, is there a way to query pending keyboard input before issuing the PULL or LINEIN function so the program does not wait on input? I cannot find a REXX function that allows this. Do you have to use a Windows interface to accomplish
Put the Syskeyget in a separate rexx exec. When Syskeyget shows the data has come in put it in a .local variable. In another exec use RXWINEXEC to start the first exec and check the .local variable.
Interesting Tack. I'll try this. Many thanks.
I have used this approach for other things. Let me know if it works for you. Hey, I might need to check input like this someday. :-)
On Thursday, January 11, 2018 at 10:56:52 AM UTC-5, Steve DuBow wrote:this? Would appreciate any insight. Thank you.
On Thursday, January 11, 2018 at 5:15:49 AM UTC-8, Garry Smithwick wrote:
On Friday, January 5, 2018 at 6:33:16 PM UTC-5, Steve DuBow wrote:
Hello
In Windows, is there a way to query pending keyboard input before issuing the PULL or LINEIN function so the program does not wait on input? I cannot find a REXX function that allows this. Do you have to use a Windows interface to accomplish
Put the Syskeyget in a separate rexx exec. When Syskeyget shows the data has come in put it in a .local variable. In another exec use RXWINEXEC to start the first exec and check the .local variable.
Interesting Tack. I'll try this. Many thanks.
I have used this approach for other things. Let me know if it works for you. Hey, I might need to check input like this someday. :-)
This might help.
Exec 1:
----------------------------------------------------------------------------- folder = Directory()'\'Time('T')
Call SysRmDir folder
Call SysMkDir folder
file = folder'\KeyData'
program = 'C:\Rexx\My Tools\ReadKeys.rex'
rexx = 'C:\Program Files\oorexx\rexxpaws.exe'
pid = RxWinExec(rexx '"'program'"' '"'file'"')
crlf = '0d0a'x
WaitTime = 5
Say '--> Monitor folder:' Folder crlf
objWMIService = .oleObject~GetObject("winmgmts:\\.\root\cimv2")
wmipath = Folder~changestr('\','\\\\')
colMonitoredEvents = objWMIService~ExecNotificationQuery("SELECT * FROM",
"__InstanceOperationEvent",
"WITHIN" WaitTime "WHERE Targetinstance ISA 'CIM_DirectoryContainsFile' and ",
"TargetInstance.GroupComponent= 'Win32_Directory.Name="""wmipath"""'")
Do Forever
Say Date('S') Time('C') '- Waiting Up To' WaitTime 'Seconds For The Next Event'crlf
objEventObject = colMonitoredEvents~NextEvent()
result = objEventObject~GetObjectText_
target = objEventObject~TargetInstance~PartComponent
Parse Var target .'='target
target = target~changestr('\\','\')~strip(,'"')
Select
When result~pos("__InstanceCreationEvent") > 0 Then Do
Say Date('S') Time('C') '--> New file created:' target crlf
Keydata = Linein(target)
Call Lineout target
Call Sysfiledelete target
Say 'Key data:' Keydata crlf
End
When result~pos("__InstanceDeletionEvent") > 0 Then Say Date('S') Time() '--> File deleted:' target crlf
Otherwise Say Date('S') Time('C') '--> Unknown event:' target crlf
End
End
Call SysRmDir folder
Exit
--------------------------------------------------------------------------
Exec 2 (started by exec 1 using rxwinexec):
--------------------------------------------------------------------------
path = Arg(1)
If path = '' Then Exit
if rxfuncquery('SYSLoadFuncs')=1 then ,
if rxfuncadd('SYSLoadFuncs','regutil','SYSLoadFuncs') > 0 then exit
call sysloadfuncs
Do n = 1 to 100
Say Date('S') Time('C') 'Waiting for keyboard input...' '0d0a'x
data = Sysgetkey()
file = path'-'n'.dat'
Call Sysfiledelete file
Call Lineout file, data
Call Lineout file
End
Exit
---------------------------------------------------------------------------
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 67:20:23 |
Calls: | 6,654 |
Files: | 12,200 |
Messages: | 5,331,951 |