Subject Re: [IBO] Re: SemiAuto inserting text into gridcell
Author Rita Lavoie
Aage,

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

So your MACRO3 looks like this?

var MACRO3: array [65..90] of String = ('AA','BB','CC','DD',
'EE','FF','GG','HH',
'II','JJ','KK','LL',
'MM','NN','OO','PP',
'QQ','RR','SS','TT',etc.);


procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var S,cKey:String;
nPos: Integer;
begin
// you could verify if in [dssEdit,dssInsert] and Exit if not
{from A(65) to Z(90) }
if Shift = [ssCtrl] then
begin
if Key in [65..90] then
begin
S := Edit1.Text; // or your query.....AsString
cKey := MACRO3[Key];
nPos := Edit1.SelStart;
Insert(cKey,S,nPos+1);
Edit1.Text := S;
Edit1.SelStart := nPos+Length(cKey);
end;
end;
end;

Hope it helps.

Regards,

Rita