marc@lakesys.UUCP (Marc Rassbach) (07/31/89)
A question for you all.... How does one detect the keypress of a control character in dBase. (Actual enviro is FoxBase under SCO) Using the WAIT ' ' TO <var_name> yeilds 0's for all control characters. (Want to use Wordstar style editing.....) Ideas anyone??? Please E-mail responces, as Lakesys's news dir is FULL. -- Marc Rassbach marc@lakesys If you take my advice, that "I can't C with my AI closed" is your problem, not mine! If it was said on UseNet, it must be true.
keithb@hpindda.HP.COM (Keith Broussard) (08/02/89)
In dbase, you can use the INKEY() function to get any key press. Look it up in the manual to find out what the return value for the control character you want to trap is. INKEY will wait indefinitely for a keypress if you use INKEY(0), or n seconds if you use INKEY(n).
timk@xenitec.uucp (Tim Kuehn) (08/02/89)
In article <914@lakesys.UUCP> marc@lakesys.lakesys.com (Marc Rassbach) writes: > >A question for you all.... > >How does one detect the keypress of a control character in dBase. >(Actual enviro is FoxBase under SCO) use the inkey() function. I've used something along the following for the applications I do when I want a character without making the user hit CR. i = 0 do while i = 0 i = inkey() enddo When called, I will contain the ASCII decimal equivalent of the character the user pressed. If you want the character value of the key the user pressed, convert it by: char_val = chr(i) or: char_val = chr(inkey()) if you don't want to bother with an intermediate step. I use this under DOS all the time, and when assisting with beta-testing I ported a DOS application over to the SCO platform, this part of the program had no problems at all. +-----------------------------------------------------------------------------+ |Timothy D. Kuehn timk@xenitec | |TDK Consulting Services !watmath!xenitec!timk | |871 Victoria St. North, Suite 217A | |Kitchener, Ontario, Canada N2B 3S4 (519)-741-3623 | |DOS/Xenix - SW/HW. uC, uP, DBMS. Satisfaction Gauranteed| +-----------------------------------------------------------------------------+ >-- >Marc Rassbach marc@lakesys If you take my advice, that >"I can't C with my AI closed" is your problem, not mine! > If it was said on UseNet, it must be true.
edwin.milne@canremote.uucp (EDWIN MILNE) (08/06/89)
>How does one detect the keypress of a control character in dBase. >(Actual enviro is FoxBase under SCO) tp>use the inkey() function. I've used something along the following tp>for the applications I do when I want a character without making the tp>user hit CR. tp>i = 0 tp>do while i = 0 tp> i = inkey() tp>enddo This may work fine under DOS where the CPU has nothing better to do than continually poll the keyboard, but in a Xenix environment, you have just created a totally process bound program which may degrade the performance for every other user on the system. Much better with Foxbase under either Xenix or DOS is i = inkey(0) The '0' tells Foxbase to wait for the next character to be typed. Under Xenix, Foxbase would stop using the CPU until Xenix got the interrupt caused by the operator pressing the key. --- * QDeLuxe 1.00 #606
jim@ic2020.UUCP (Jim Carter) (08/10/89)
in article <914@lakesys.UUCP>, marc@lakesys.UUCP (Marc Rassbach) says: > Posted: Mon Jul 31 09:25:14 1989 > > How does one detect the keypress of a control character in dBase. > (Actual enviro is FoxBase under SCO) > Using the WAIT ' ' TO <var_name> yeilds 0's for all control > characters. > -- > Marc Rassbach marc@lakesys If you take my advice, that > "I can't C with my AI closed" is your problem, not mine! > If it was said on UseNet, it must be true. How about using INKEY() instead of "Wait ' ' to ..." ?? It says in the manual that INKEY() will pick up non-printable characters as well as the other normal characters. Here is another question : FoxBase under SCO/386, How do you send output to a printer and not to the screen. For example, if you are producing a report via the "report ... to print" command, you have to wait and see all the same output on the screen. Rather iritating and I am sure much slower. Have any Ideas ?? -- Jim Carter (Sequoia Contact Lens,1355 11th Street,Reedley,CA,93654) {...!csufres!csuf3b!ic2020!jim} 209/638-3939, Fax 209/638-5433
thurm@shorty.CS.WISC.EDU (Matthew Thurmaier) (08/11/89)
The way to turn printing to the screen off during reports is to put the line: SET CONSOLE OFF before the report statement. However, don't forget to add the line: SET CONSOLE ON after your reports, otherwise you screen won't work again. Matthew. Snail Mail: E Mail: Matthew J. Thurmaier ...!{allegra,harvard,seismo}!shorty!matt The Computer Classroom matt@shorty.wisc.edu 6701 Seybold Road, Ste. 122 Madison, WI 53719 (608) 271-2171 "why am I ALWAYS going somewhere?" >>-matt-->
timk@xenitec.uucp (Tim Kuehn) (08/13/89)
In article <225@ic2020.UUCP> jim@ic2020.UUCP (Jim Carter) writes: >Here is another question : >FoxBase under SCO/386, How do you send output to a printer and not to the >screen. For example, if you are producing a report via the >"report ... to print" command, you have to wait and see all the same output >on the screen. Rather iritating and I am sure much slower. > >Have any Ideas ?? >-- >Jim Carter (Sequoia Contact Lens,1355 11th Street,Reedley,CA,93654) >{...!csufres!csuf3b!ic2020!jim} 209/638-3939, Fax 209/638-5433 Jim - your question is somewhat ambiguious as to what *Exactly* you're asking.Hopefully, one of the following will give you (and any other net.readers out there) an answer to your question: It depends on where the output is coming from. If you're using the @ x, y Say commands you'll need to include the statment SET DEVICE TO PRINTER in your code. (You won't see the output from the program though) If you're using the ? command, then SET PRINTER ON will give you a hard copy of what you see on the screen, and also you can see the output on the screen too. (IF you don't want anything coming up on the screen then SET CONSOLE OFF first, and then SET CONSOLE ON after the print run is done.) If you have something you want directed to a file then SET PRINTER TO <fname>. IF you want something to go to a *different* device printer, then SET PRINTER TO <fname>, output the info you want printed, then !cat <fname> > <dev-name> Of course, most of this is documented in the manuals... :-) +-----------------------------------------------------------------------------+ |Timothy D. Kuehn timk@xenitec | |TDK Consulting Services !watmath!xenitec!timk | |871 Victoria St. North, Suite 217A | |Kitchener, Ontario, Canada N2B 3S4 (519)-741-3623 | |DOS/Xenix - SW/HW. uC, uP, DBMS. Satisfaction Gauranteed| +-----------------------------------------------------------------------------+