unit loadsave;
{Einstellungen laden und speichern}
interface
uses SMSH, SMSP, WinProcs, WinTypes;
function LoadSettings:Boolean;
function SaveSettings:Boolean;
implementation
function LoadSettings:Boolean;
begin
{$B+} {Vollständige Auswertung!}
BereichWarte:=GetPrivateProfileInt(
Section,'RangeWait',BereichWarte,Profile);
BereichSchrittCheck:=Boolean(GetPrivateProfileInt(
Section,'RangeStepCheck',Byte(BereichSchrittCheck),Profile));
BereichWarteCheck:=Boolean(GetPrivateProfileInt(
Section,'RangeWaitCheck',Byte(BereichWarteCheck),Profile));
UseDreieck:=Boolean(GetPrivateProfileInt(
Section,'UseTriangle',Byte(UseDreieck),Profile));
LoadSettings:=
GetProfileReal('RangeFrom',BereichVon)
and GetProfileReal('RangeTo',BereichBis)
and GetProfileReal('RangeStep',BereichSchritt)
and (BereichWarte>0)
and GetProfileReal('LeftBound',LeftBound)
and GetProfileReal('RightBound',RightBound)
and GetProfileReal('RefPos',RefPos)
and GetProfileReal('RefSpeed',RefSpeed)
and GetProfileReal('MoveSpeed',MoveSpeed)
and GetProfileReal('MoveAccel',MoveAccel)
and GetProfileReal('StepsPerRevolution',SchrittPU);
{$B-}
end;
function SaveSettings:Boolean;
var
S:TS31;
begin
Str(BereichWarte,S);
WritePrivateProfileString(Section,'RangeWait',S,Profile);
Str(Byte(BereichSchrittCheck),S);
WritePrivateProfileString(Section,'RangeStepCheck',S,Profile);
Str(Byte(BereichWarteCheck),S);
WritePrivateProfileString(Section,'RangeWaitCheck',S,Profile);
Str(Byte(UseDreieck),S);
WritePrivateProfileString(Section,'UseTriangle',S,Profile);
Str(UnitUsed,S);
WritePrivateProfileString(Section,'UnitUsed',S,Profile);
{$B+}
SaveSettings:=
WriteProfileReal('RangeFrom',BereichVon)
and WriteProfileReal('RangeTo',BereichBis)
and WriteProfileReal('RangeStep',BereichSchritt)
and WriteProfileReal('LeftBound',LeftBound)
and WriteProfileReal('RightBound',RightBound)
and WriteProfileReal('RefPos',RefPos)
and WriteProfileReal('RefSpeed',RefSpeed)
and WriteProfileReal('MoveSpeed',MoveSpeed)
and WriteProfileReal('MoveAccel',MoveAccel)
and WriteProfileReal('StepsPerRevolution',SchrittPU);
{$B-}
end;
end.
Detected encoding: OEM (CP437) | 1
|
|