Page 1 of 1 1
Topic Options
#80635 - 2002-01-18 02:39 PM Extending Get
Leon Mol Offline
Fresh Scripter

Registered: 2002-01-18
Posts: 11
Loc: Netherlands
I use Kix in a combination with an ini-file to logon my users on the network with the right settings and mappings. This works great, but sometimes to fast.

As administrator i want to see my screen output of the kixscript, but i do not want that my users must press any key to continue or have some sleep moments.

In TBasic ( yes that's old ) was a statement like : A$=Inkey$. If a key is pressed then it is in 'A$'. If no key is pressed, the program continues. If i want the script to be paused i press a key, otherwise it continues.

Is there a solution in Kix to do this ?
Thanks in advance.

Top
#80636 - 2002-01-18 02:55 PM Re: Extending Get
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Leon,

Check out the new KBHIT() function in KiXtart 4.01. Slightly different than INKEY() but should serve your purpose. KBHIT() will return true if there is a keyboard code waiting in the keyboard buffer. But unlike INKEY(), one has to actually fetch the code using the GET command.

-Shawn

Top
#80637 - 2002-01-18 02:57 PM Re: Extending Get
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
code:

get $
if not ingroup("Domain Admins")
$ = sendkeys("A")
endif


[edit: This was post # Donald Duck ]

[ 18 January 2002: Message edited by: jpols ]

_________________________



Top
#80638 - 2002-01-18 03:24 PM Re: Extending Get
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Here you go...
code:
Function udfPause()
Dim $null
; If a keyboard character is struck...
If KbHit()
; Drain the keyboard buffer...
While KbHit() Get $null Loop
; Prompt for a key to continue
"PAUSED: Hit a key to continue: " Get $null
?
EndFunction


Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.057 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org