Autor Beitrag
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Sa 06.09.03 19:05 
Wie setzte ich das Teil ? In der VCL ist das ja vom Typ Point , aber in Kylix CLX wohl nicht.
Also geht
ausblenden Quelltext
1:
memo.caretpos := Point(x,y);					


leider nicht
und

ausblenden Quelltext
1:
memo.caretpos.line := x;					


geht auch nicht, weil man nix zuweisen darf, wie geht es also überhaupt ?

_________________
mfg. Joel
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: So 07.09.03 08:46 
Du musst das folgend machen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  Position: TCaretPos;
begin
  Position.Line := 3;  //Zeilennummer, z.B. 3. Zeile
  Position.Col := 10; //Zeichennummer, z.B. 10. Zeichen
  Memo1.CaretPos := Position;
end;

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
JoelH Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: So 07.09.03 15:47 
Titel: hmm,
warum funktioniert dies ?
Ich meine ich lege eine Var an, die aber keine Var ist, warum muss ich das dind nicht mit
xy := TCaretPos.Create;
erst erzeugen ? Das hab ich nämlich versucht, mag der Comiler aber nicht. Ich sehe hier irgendwie das System als nonkonsistent an. Denn eine Stringlist miuss mann via Create erst erzeugen obwohl vorher klar ist was sie mach da man bein Create nix beeinflussen kann.

Wo ist da die KlassenKonsistenz ?

_________________
mfg. Joel
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 07.09.03 19:17 
Hallo

mit der CLX arbeite ich nicht und ich hab auch die CLX-Hilfe deaktiviert, kann also nicht nachguggn.

TCaretpos ist wie Tpoint keine Klasse, sondern nur ein Record. Du hast doch die Sourcen, Strg+Maus auf TCaretpos und schon stehts da.
Erstell dir doch einfach eine Funktion Caretpos (wenn es die nicht evtl schon gibt). Point ist auch nur eine Funktion
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
Function Caretpos(x,y:integer):Tcaretpos;
  begin
    result.Col:=x;
    result.Line:=y;
  end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  memo1.CaretPos:=CaretPos(2,3);
  memo1.SetFocus;
end;


Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
JoelH Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Mo 08.09.03 09:21 
Titel: hmm,
joo danke,
hab es auch gemerkt :( Gelesen aber ignoriert ;)

_________________
mfg. Joel