If you select a field in a dialog so that you can type over the current information, how do you make it so that when you hit the enter key, it automatically acts as if the ok button has been selected. I'm trying my hand at writing a tool that will allow me to update a record field attached to an object just by selecting the object and running the script. That part works. I've fed the field with the old information as a reference, then selected the field so that all you have to do is type the new value. But you have to click ok, which is much slower than just hitting return. It would be great if you typed the new number, then could hit enter to send the info. Here is the code I've started from for the dialog:
PROCEDURE Dialogstart;
VAR
item: Integer;
cancel, done : Boolean;
BEGIN
BeginDialog(1,1,100,100,300,300);
AddButton('OK',1,1,110,175,180,190);
AddButton('Cancel',2,1,20,175,90,190);
AddField('test',3,1,15,20,180,40);
AddField('test',4,2,15,60,180,80);
EndDialog;
GetDialog(1);
SetTitle('Test');
cancel := False;
done := False;
SelField (4);
REPEAT DialogEvent(item);
IF item = 2 THEN cancel := True;
IF item = 1 THEN done := True;
UNTIL cancel | done;
END;
RUN(Dialogstart);
Any Ideas? Thanks for any help.