0
어떤 메신저 뭘하려고 : 편집 상자에문자열을 메모 상자 줄에 추가 한 다음 빈 줄을 추가하고 다음 줄에 새 입력을 추가하십시오 - delphi 2010 - help!
입력 버튼 클릭에 메모 상자 라인에 기록 할 때 0 또는 -1 편집 상자
코드의 다음 행으로 이동을 입력 :
procedure TForm1.btnReadClick(Sender: TObject);
var
c, i, j : integer;
ch2 : Char;
txt1, txt2 : string;
begin
c := StrToInt(edt2.Text); //input
ch2 := Converteer(c); //input gets converted to Char
if memC.Lines.Count = 0 then //start value when memo box empty
begin
i := 0;
j := 0;
txt1 :='';
txt2 :='';
end;
if c = 0 then //text naar memo
begin
i := i + 1; // next line ?!? these two seem not to work
txt1 := ''; // empty string ?!? these two seem not to work
txt2 := memT.Lines[j] + ch2;
end
else if c = -1 then //same, it appears 'i' is maybe reset everytime button is pressed
begin
i := i + 1;
j := j + 1;
txt1 := '';
txt2 := '';
end
else if c >= 0 then // a t/m z
begin
txt1 := memC.Lines[i] + IntToStr(c);
txt2 := memT.Lines[j] + ch2;
end;
memC.Lines[i] := txt1; //write string to line , [i] should specify the wich line
memT.Lines[j] := txt2; // same
end.
내가 어디에서/어떻게 잘못되는지 알 수는 있지만, 누군가가 나를 도와 줄 수 있다면 정말 멋지다.
greetz 피터
괜찮습니다. 시작시 memC는 항상 비어 있지만 내 생각에 로컬이 아닌 (글로벌?) 내 문제를 해결할 수 있습니다. 아픈 구글 어떻게 작동, 바로 돌아올 :) – peter
좋아, 꽤 많이 그랬어. 한 부분은 비록 작동하지 않습니다. – peter
나는 2 개의 메모 박스를 가지고 있는데, 하나는 직접 입력 ('i'는 변수)을, 다른 하나는 변환 후에 입력을 얻는다. 어쨌든 'i'메모 만 제대로 작동하지 않습니다. 다음 줄로 이동 한 후에 'i'메모에 입력 내용이 더 이상 표시되지 않습니다. 다른 하나는 완벽하게 작동합니다. 어떤 아이디어? – peter