Subject Re: SemiAuto inserting text into gridcell
Author Aage Johansen
Hi Rita !

>I better understand what you want to accommplish;
>Use SendKeys(s:String) with F8 our F... to whrite a constant string to
>your edit box

Yes. Writing to an TIB_Edit (or a TIB_Memo) works fine. My approach with
these is close to your suggestion. However, the method fails when it comes
to cells in a TIB_Grid - and there's my problem.



>So your MACRO3 looks like this?
>var MACRO3: array [65..90] of String = ('AA','BB','CC','DD',
> 'EE','FF','GG','HH',

Yes, in principle. The strings are read from an INI-file at startup.
var
MACRO3 : array [Ord('A')..Ord('Z')] of String;
and selected by Ctrl+<letter>

The following works fine:
if (Sender is TIB_Edit) then
begin
if Shift = [ssCtrl] then
begin
if Key in [Ord('A')..Ord('Z')] then (Sender as
TIB_Edit).SelText:=MACRO3[Key];
Key:=000;
end;
end;

But ...
What's so special about the cell in the grid. Will I have to find the
fieldname and use:
ibqrKINO.FieldByName(FIELDNAME).AsString:=MACRO3[...];
Is there a straightforward way to get the fieldname for the current cell in
the grid?

Why did the previous test work when run in the IDE with a breakpoint, and
otherwise fail?

Regards,
Aage J.