Menu

#7 XE7 demo

v1.0_(example)
open
nobody
None
1
2015-08-21
2015-08-21
No

In XE7, the demo initially didn't work.

I guess this code doesn't work with all sorts of string types, because S only contained some garbage when I inspected via the debugger.

F := TFileStream.Create(FileNameEdit.Text, fmOpenRead);
try
  SetLength(S, F.Size);
  F.ReadBuffer(S[1], F.Size)
finally
  F.Free
end;

My fix was to replace this code with by this code (won't work in ancient Delphi versions):

uses System.IoUtils;
...
S := TFile.ReadAllText(FileNameEdit.Text);

Now everything seems to work.
Nice job by the way.It's especially cool that there are no external dependencies whatsoever, and it's written using proper pascal constructs.

Discussion


Log in to post a comment.