Autor Beitrag
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: So 29.10.06 22:23 
Hallo!

Wie leere ich einen normalen TStream? Einfach mit .Size := 0 oder wie :gruebel: ?

Danke für eure Mühe :)


greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: So 29.10.06 23:20 
Moin!

Abgesehen davon, dass du nicht mit TStream direkt arbeiten solltest, würde ich sagen: ja. :D Zumindest bei einem TMemoryStrean geht das so. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Born-to-Frag Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: So 29.10.06 23:44 
Arbeite ich auch nicht ;)

Ist ein TIdMultiPartFormDataStream ;)
Bei TMemoryStream gibts noch .Clear.. aber auch nur da..

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Born-to-Frag Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Mo 30.10.06 21:24 
Zu früh gefreut, bekomme leider immer "Unsupported operation" :(

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 30.10.06 22:29 
Moin!

Hmm... vielleicht so:
- .Position := 0;
- Daten schreiben
- .Size auf .Position setzen, wenn es nicht der Fall ist
:?:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 31.10.06 09:37 
Hallo,

hab mir mal die Source zu TMemoryStream angeschaut bzgl. .Clear und .Size

Clear aufrufen oder Size auf 0 setzen führt zum gleichen Ergebnis.

Clear >>
ausblenden Delphi-Quelltext
1:
2:
3:
  SetCapacity(0);
  FSize := 0;
  FPosition := 0;


Size auf 0 >>
SetSize(0) >>
SetSize(NewSize: Longint) >>
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  //gekürzt
  SetCapacity(Newsize);
  FSize := NewSize;
  Seek(0, soFromEnd);


Daher sollte TIdMultiPartFormDataStream.Size := 0; ausreichend sein. :?:

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Born-to-Frag Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Di 31.10.06 17:50 
Sorry es funktioniert doch mit .Size := 0;

Ich bin irgendwie verwirrt, gestern ging es nämlich nicht mehr :nixweiss:

EDIT: Ah, mit D7 funktioniert es, mit D10 nicht :rofl: Mal die Indys updaten..

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.