Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.pascal.delphi.misc > #373
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!.POSTED!not-for-mail |
|---|---|
| From | Marco van de Voort <marcov@toad.stack.nl> |
| Newsgroups | comp.lang.pascal.delphi.misc |
| Subject | Re: xpost (Sorry) Can someone show me the fix for this please? |
| Date | Thu, 19 Jul 2012 19:45:05 +0000 (UTC) |
| Organization | Stack Usenet News Service |
| Lines | 30 |
| Message-ID | <slrnk0gou1.99o.marcov@toad.stack.nl> (permalink) |
| References | <c0df65a9-11ec-4a22-accc-cb05042612ce@googlegroups.com> |
| NNTP-Posting-Host | toad.stack.nl |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Trace | mud.stack.nl 1342727105 38015 2001:610:1108:5010::135 (19 Jul 2012 19:45:05 GMT) |
| X-Complaints-To | abuse@stack.nl |
| NNTP-Posting-Date | Thu, 19 Jul 2012 19:45:05 +0000 (UTC) |
| User-Agent | slrn/0.9.9p1 (FreeBSD) |
| Xref | csiph.com comp.lang.pascal.delphi.misc:373 |
Show key headers only | View raw
On 2012-07-19, bok <bok.globule@gmail.com> wrote:
>
> The line below of "S:=Reversestring(S)" causes a file full of "nul" to be written instead of S. How do I manipulate S and then correctly write the altered
> string to n2.exe.
An empty string might be NIL. Dereferencing NIL might cause an exception.
> Thanks,
> DBM
>=========================================================
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
> readit,writeit: TFileStream;
> s: string;
> x:integer;
> begin
> readit := TFileStream.Create('n1.exe', fmOpenread);
> writeit := TFileStream.Create('n2.exe', fmCreate or fmOpenWrite);
> try
> SetLength(s,readit.Size);
if length(s)>0
> readit.Read(PChar(s)^, Length(s));
> s:=reversestring(s); //<<<<<<-This line is incorrect
> writeit.Write(PChar(s)^, Length(s));
> finally
> readit.Free;
> writeit.Free;
> end;
> end;
Back to comp.lang.pascal.delphi.misc | Previous | Next — Previous in thread | Next in thread | Find similar
xpost (Sorry) Can someone show me the fix for this please? bok <bok.globule@gmail.com> - 2012-07-19 11:45 -0700
Re: xpost (Sorry) Can someone show me the fix for this please? Marco van de Voort <marcov@toad.stack.nl> - 2012-07-19 19:45 +0000
Re: xpost (Sorry) Can someone show me the fix for this please? bok <bok.globule@gmail.com> - 2012-07-19 16:26 -0700
Solution Found !!! bok <bok.globule@gmail.com> - 2012-07-19 17:54 -0700
Re: Solution Found !!! Marco van de Voort <marcov@toad.stack.nl> - 2012-07-20 12:27 +0000
csiph-web