procedure InitMyVariable(Value: T); function MyVariable: T; implementation var PrivateMyVariable: T; PrivateMyVariableSet: Boolean; procedure InitMyVariable(Value: T); begin if not PrivateMyVariableSet then PrivateMyVariable := Value; PrivateMyVariableSet := True; end; function MyVariable: T; begin Result := PrivateMyVariable; end;