[comp.databases] dBase: Using the arrow keys

traynor@bostech.com (Pat Traynor) (03/13/91)

Hello all --

Can I program dBase to accept the arrow keys as input?  My objective is
to have my menu selections highlighted, and if the user presses the up
or down arrow keys ( <esc>[A  and  <esc>[B ) the previous or next menu
item becomes highlighted.

In an unrelated item, my VGA color monitor supposedly has a palette of
256,000 colors.  Is there any way (in dBase) for me to tap into this,
or am I limited to the primaries?

--pat traynor--

grover@sonny-boy.cs.unlv.edu (Kevin Grover) (03/13/91)

In article <9103121653.AA13910@titanic.bostech.com>, traynor@bostech.com (Pat Traynor) writes:
) From: traynor@bostech.com (Pat Traynor)
) Subject: dBase: Using the arrow keys
) Date: Tue, 12 Mar 91 08:53:11 PST
) 
) 
) Hello all --
) 
) Can I program dBase to accept the arrow keys as input?  My objective is
) to have my menu selections highlighted, and if the user presses the up
) or down arrow keys ( <esc>[A  and  <esc>[B ) the previous or next menu
) item becomes highlighted.
) 
) In an unrelated item, my VGA color monitor supposedly has a palette of
) 256,000 colors.  Is there any way (in dBase) for me to tap into this,
) or am I limited to the primaries?
) 

I know FOXBASE can, so I assume dBase can.  I don't remember the exact names, 
but there is a command to read a key into an integer (returns the number of the
key pressed).  All of the Arrow keys have a number.  I wrote some code that
uses this and it works nicely.  It should work in dbase as well.  If this is not
enough to get you going, let me know and I'll dig up an example.

-- 
  +-------------------------------------------------+----------------------+
  | Kevin Grover             UNLV Computer Science  |     Home of the      |
  | grover@cs.unlv.edu       Las Vegas, Nevada      |    Running REBELS    |
  +-------------------------------------------------+----------------------+

timk@wynnds.xenitec.on.ca (Tim Kuehn) (03/13/91)

In article <9103121653.AA13910@titanic.bostech.com> traynor@bostech.com (Pat Traynor) writes:
>
>Can I program dBase to accept the arrow keys as input?  My objective is
>to have my menu selections highlighted, and if the user presses the up
>or down arrow keys ( <esc>[A  and  <esc>[B ) the previous or next menu
>item becomes highlighted.

Not having worked with dBase for _some_ time (I used Foxbase, FoxPro,
and Clipper), I can't definitively say this - but if dBase (whatever
version you're using) has an inkey() function, then you can use that
to grab arrow keys for deciding what to do next. 

Of course, if you had "@ x,y prompt" and "menu to" commands, you
wouldn't need to worry about these things :-) 

   ------------------------------------------------------------------------ 
   Tim Kuehn			    TDK Consulting Services  (519)-888-0766
   timk@wynnds.xenitec.on.ca  -or-  !{watmath|lsuc}!xenitec!wynnds!timk
   Valpo EE turned loose on unsuspecting world! News at 11!

mdb@abcom.ATT.COM (3030 ) (03/15/91)

From article <9103121653.AA13910@titanic.bostech.com>, by traynor@bostech.com (Pat Traynor):
> 
> Hello all --
> 
> Can I program dBase to accept the arrow keys as input?  My objective is
> to have my menu selections highlighted, and if the user presses the up
> or down arrow keys ( <esc>[A  and  <esc>[B ) the previous or next menu
> item becomes highlighted.
> 
> In an unrelated item, my VGA color monitor supposedly has a palette of
> 256,000 colors.  Is there any way (in dBase) for me to tap into this,
> or am I limited to the primaries?
> 
> --pat traynor--
Pat, 

	Yes, Xbase (dBase and its clones) can accept the arrow key as
	input.  If you are in a get field look for the value returned 
	by the readkey() function.  With menuing systems use the inkey()
	function.

	As far as I know your stuck with the 16 colors assigned by
	Xbase.


	Hope this helps.


Mike Barnes
415-224-3030