Examples Delphi

procedure TMainForm.SnapToVertexSubMenuClick(Sender: TObject);
{set up the Boolean global snap variable and check or uncheck the menu}
var
yesWeHaveSnap: Boolean;
begin
if (userPrefs.snap = True) then yesWeHaveSnap := True
else yesWeHaveSnap := False;
if (yesWeHaveSnap = True) then
begin
userPrefs.snap := False;
SnapToVertexSubMenu.Checked := False;
end
else
begin
userPrefs.snap := True;
SnapToVertexSubMenu.Checked := True;
end;
end;