Board index » delphi » Constants don't show up in Auto complete

Constants don't show up in Auto complete


2004-09-14 07:11:20 AM
delphi178
Hello all,
I added a bunch of constants to a unit. Compiles ok, but when I try to
use autocomplete,the constants don't show up. Code listing below. The
spot where I try to autocomplete is marked (about 3/4 the way down)
TIA!
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, fraInputType_base, fraInputType_Fillin, StdCtrls, ExtCtrls,
fraInputType_MultipeChoice;
type
TForm1 = class(TForm)
FrameInputType_FILLIN1: TFrameInputType_FILLIN;
RadioGroup1: TRadioGroup;
frameInputType_MultipleChoice1: TframeInputType_MultipleChoice;
procedure FormActivate(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure TestResult (Sender:TObject; Msg: string);
end;
var
Form1: TForm1;
oInputBox: TframeInputType_BASE;
{** Keyboard Constant Codes **}
CONST
K_LEFT = #75; K_RIGHT = #77;
K_UP = #72; K_DOWN = #80;
K_HOME = #71; K_END = #79;
K_PGUP = #73; K_PGDN = #81;
K_DEL = #83; K_INS = #82;
K_ENTER = #13; K_ESC = #27;
K_BACKSPACE = #8; K_TAB = #9;
K_SPACE = #32; K_SHIFT_TAB = #15;
K_CTRL_LEFT = #115; K_CTRL_RIGHT = #116;
K_CTRL_PGUP = #132; K_CTRL_PGDN = #118;
K_CTRL_HOME = #119; K_CTRL_END = #117;
K_CTRL_ENTER = #10;
K_F1 = #59; K_F2 = #60;
K_F3 = #61; K_F4 = #62;
K_F5 = #63; K_F6 = #64;
K_F7 = #65; K_F8 = #66;
K_F9 = #67; K_F10 = #68;
implementation
{$R *.dfm}
procedure TForm1.FormActivate(Sender: TObject);
begin
//FrameInputType_FILLIN1.OnAnswered:= TestResult;
end;
procedure TForm1.TestResult(Sender: TObject; Msg: string);
var
ikey:integer;
begin
if iKey=k_ then <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<------
-------------------------------------------------------------------
when I bring up autocomplete after "k_", it doesn't give any of the
constants from above. It gives no choices. But 'K' would give
autocomplete choices like "KEY..." (builtin possibilities for
autocomplete)
-------------------------------------------------------------------
--
email me at : I am cnichols_1999
@yahoo.com
Do not use the following email (it's for SP*m tracking)
XXXX@XXXXX.COM
 
 

Re:Constants don't show up in Auto complete

Clay Nichols writes:
Quote
CONST
K_LEFT = #75; K_RIGHT = #77;
K_UP = #72; K_DOWN = #80;
Most of the virtual key codes are already defined in the Windows unit.
Look for the constants with names starting with "VK_". And they should
be integers, not characters. Not all keys generate characters, and some
characters are generated by multiple keys simultaneously.
Quote
procedure TForm1.TestResult(Sender: TObject; Msg: string);
var
ikey:integer;

begin
if iKey=k_ then <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<------

-------------------------------------------------------------------
when I bring up autocomplete after "k_", it doesn't give any of the
constants from above.
Why should it? Those constants are of type Char, but iKey is of type
Integer. The "#" prefix is used to indicate character constants, the "$"
prefix denotes hexadecimal values, and the "#$" prefix signifies
character constants in hexadecimal.
--
Rob