Autor Beitrag
Delphicus
Hält's aus hier
Beiträge: 11



BeitragVerfasst: Mo 27.06.05 11:09 
Halllo Leute,

programmier ein bisschen mit Delphi 3 und möchte, wenn POS eine Zahl zwischen z.B. 10 - 100 in einer Listbox findet ein Reaktion!! :?:

Habt ihr ne Ahnung wie ich das formulieren soll? :?:

Bis jetzt sieht es so aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
 
procedure TForm1.Button1Click(Sender: TObject);
var i: integer;
begin
for i := 0 to (Form1.Listbox1.items.count - 1) do begin
  if pos('hier müsste irgendwie 10-100 hin', form1.Listbox1.items.strings[i]) <> 0 then   
   begin
   showmessage ('es funktioniert!!!');
   end;
end;
end;


Delphicus

P.S.: Save the programmers, eat more problems!!!

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 27.06.05 11:48 
Änder Zeile 6 mal in
ausblenden Delphi-Quelltext
1:
2:
if (IntToStrDef(form1.Listbox1.items.strings[i], 0) >= 10) and
    (IntToStrDef(form1.Listbox1.items.strings[i], 101) <= 100) Then

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Delphicus Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: Mo 27.06.05 12:12 
Danke,

aber leider meckert Delphi :cry:

Es heißt: Fehler:...:Undefinierter Bezeichner: 'IntTO StrDef'.
und : Fehler:...:Inkompatible Typen: 'String' und 'Boolean': :?:

Trotzdem Danke!!!

:(
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 27.06.05 12:21 
Autsch :oops: Die Funktion heißt ja auch StrToIntDef ... :oops:

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Delphicus Threadstarter
Hält's aus hier
Beiträge: 11



BeitragVerfasst: Mo 27.06.05 12:53 
:lol: :lol: Danke! Danke! Danke! :lol: :lol:

Es funktioniert!!!!!!!!! :dance:

Delphicus

P.S.: Save the programmers, eat more problems!!!