Autor Beitrag
mausi123
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 21.11.07 19:31 
Hallo,

ich möchte überprüfen, ob in edit1.text ein bestimmter string vorhanden ist.

auf die schnelle find ich da nüx.. bin auch noch anfänger, jeder hat mal angefangen :P


Moderiert von user profile iconChristian S.: Topic aus Dateizugriff verschoben am Mi 21.11.2007 um 18:56
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 21.11.07 19:51 
Da du jedoch selbst schon Posts geschrieben hast wo if und Strings vorkommen, habe ich das Gefühl, dass du die Frage falsch gestellt hast. Was hat das ganze mit Dateizugriff zu tun?
ausblenden Delphi-Quelltext
1:
if edit1.text = 'ein bestimmter String' then					

Wenn du ein Anfänger bist, solltest du vielleicht nach geeigneten Tutorials suchen.
mausi123 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 21.11.07 21:32 
so weit war ich auch schon, ich verdeutliche es mal kurz:

edit1.text:='\\server\bla1\bla2\alluser.bat';

if edit1.text:='alluser' then
edit1.text:=edit1.text + ' <- beachte!';
end;

wenn 'alluser' in edit1 gefunden wird, so soll ' <- beachte!' hinzugefügt werden.. die beispiel in inet sind viel zu komplex für mich,sry.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 21.11.07 21:34 
Pos()/StrScan()

_________________
Markus Kinzler.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 21.11.07 21:43 
So z.B.
ausblenden Delphi-Quelltext
1:
 if Pos('alluser',edit1.text) > 0 then					

oder vielleicht passender:
ausblenden Delphi-Quelltext
1:
if LowerCase(ChangeFileExt(ExtractFileName(edit1.text),'')) = 'alluser' then					
mausi123 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 21.11.07 22:05 
nice, besten dank! werds gleich mal testen, sieht aber ziemlich jut aus^^