2. Writing Scripts and Procedures : Scripts : Field and Menu Item Scripts : Example—Field and Menu Item Event Blocks
 
Share this page                  
Example—Field and Menu Item Event Blocks
The following event block for the salary field checks that the value in the field is below a specified maximum when the user leaves the field:
on setvalue =
begin
   if salary > 100000 then
      CurFrame.InfoPopup
         (messagetext = 'Salary too high.',
          messagetype = MT_ERROR);
      resume;
   endif;
end;
The following sample event block executes when the user selects Close from the File menu:
on click =
begin
   return;
end;