Forum: GUI-Design mit VCL / FireMonkey / Common Controls
by Delphi.Narium,
26. Apr 2021
Eindeutig ja, MaxInt ginge aber auch ;-) (ok: Delphi 7 Hilfe sagt dazu: const MaxInt = High(Integer);)
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
by Delphi.Narium,
26. Apr 2021
procedure TfrmMain.reMainChange(Sender: TObject); // reMain = RichEdit
var
Len : Integer;
LenText : Integer;
begin
Len := StrToIntDef(edtPosition.Text,25); // edtPosition = Editfeld mit Positionsangabe
edtPosition.Text := IntToStr(Len);
LenText := Length(reMain.Text); // Wird (eventuell) mehrfach benötigt, ermitteln wir nur einmal.
if LenText >= Len then
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
by Delphi.Narium,
26. Apr 2021
SelLength := High(Integer); = Die Länge des auszuwählenden Textes wird auf die maximal mögliche Länge gesetzt. Das passiert ab der aktuellen Position.
Statt High(Integer) könnte man auch 2147483647 schreiben, muss aber, falls sich der Maximalwert für Integer mal ändern, den Quelltext anpassen ;-)
SelAttributes.Color := clIrgendwas; = Ab der aktuellen Position wird alles ab dieser...