Autor Beitrag
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Fr 13.12.02 12:53 
Sers Leute ....
also ich glaub ich steh auf dem Schlauch ... zu meinem Problem

ich habe so einen string
2002- 8-30 11:10:41;2002- 8-30 13:32: 3

filtere mit copy diese beiden werte raus 11:10:41,13:32: 3
so diese setz ich als variable TDateTime...
jetzt zu meinem problem wenn da son sche*** leerzeichen ist dann sacht er das das keine zeitangabe ist ich habsch schon so versucht

ausblenden Quelltext
1:
2:
Strtime:=(copy(zeilenliste.Strings[j],12,8));
gefZeit1:=StrToTime(stringz.deleteFirstLastLZ(StrTime));

aber es will einfach nicht gehn .... :( ich verstehs nicht .... :roll:

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 13.12.02 13:02 
Hi,

dann wandle doch vorher alle Leerzeichen in 0 um. Also ungefähr so:
ausblenden Quelltext
1:
2:
While Pos (' ', Str) > 0 Do
  Str [Pos (' ', Str)] := '0';

Gruß
TINO
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Fr 13.12.02 13:13 
das iss ne idee danke
aber was du als Str. dahingeschrieben hast das iss doch mein StrTime oder iss das noch ein andere wert den ich verwenden muss??

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 13.12.02 13:24 
ohne Worte :-D
ausblenden Quelltext
1:
Str := '11:10:41,13:32: 3';					


Gruß
TINO
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Fr 13.12.02 13:51 
hehe jo thx =) habs scho gelöst ... musste noch ne schleife reinmachen
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
 strTime1:=(copy(zeilenliste.Strings[j],31,8));
             while Pos(' ',strtime1)>0 do
               begin
                 StrTime1:=(copy(Zeilenliste.Strings[j],32,8));
                 while Pos(' ',strtime1)>0 do
                 begin
                   StrTime1[Pos(' ',StrTime1)]:='0';
                 end;
               end;
             gefZeit2:=StrToDateTime(StrTime1);

habs nu so ... geht wunderbar ... aber trotzdem THX :D :D

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Fr 13.12.02 16:49 
Hallo,

es geht auch Schleife:

ausblenden Quelltext
1:
2:
strTime1:=(copy(zeilenliste.Strings[j],31,8));
StringReplace(strTime1, ' ', '0', [rfReplaceAll, rfIgnoreCase]);

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)