Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004051 [JEDI VCL] 00 JVCL Components major always 2007-02-02 16:48 2007-03-13 04:37
Reporter ZENsan View Status public  
Assigned To ivan_ra
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0004051: JvIterpreter record type problems
Description When I am trying to use FIndFirst and FindNext - JvInterpreter return empty string for TSearchRec.Name for every found file.
Below is the sample of code. TjvSelectDirectory is added by me manualy and all is working excluding that in form's memo are added empty strings, not filenames...
Additional Information unit Sample;

function Main: string;
var
  Dlg: TjvSelectDirectory;
  Frm: TForm;
  Memo: TMemo;
  Dir: TSearchRec;
begin
  Dlg := TjvSelectDirectory.Create(nil);
  Dlg.ClassicDialog := False;
  Dlg.InitialDir := 'C:\';
  Dlg.Title := 'Select folder to list';
  if Dlg.Execute then
    if DirectoryExists(Dlg.Directory) then
      begin
        Frm := TForm.Create(nil);
        Memo := TMemo.Create(Frm);
        Memo.Align := alClient;
        Memo.Parent := Frm;
        Memo.ScrollBars := 3;
        Memo.Lines.Add('Listing for directory');
        Memo.Lines.Add(Dlg.Directory);
        Memo.Lines.Add('-----------------------');
        if FindFirst('*.*', faAnyFile, Dir) = 0 then
          begin
            ShowMessage(Dir.Name);
            Memo.Lines.Add(Dir.Name);
            while FindNext(Dir) = 0 do
              Memo.Lines.Add(Dir.Name);
          end;
        Memo.Show;
        Frm.ShowModal;
      end;
  Frm.Free;
  Dlg.Free;
end;

end.
Tags No tags attached.
Attached Files zip file icon Sample.zip [^] (8,286 bytes) 2007-02-19 05:30

- Relationships

-  Notes
(0010698)
ivan_ra (developer)
2007-02-06 02:13

What SVN version You use?
Record with strings issue was fixed in rev.11102

You can check this example with JVCL 3.30 - it works fine (dont forget FindClose call in the end of loop)
(0011091)
ZENsan (reporter)
2007-02-19 05:31

This sample is compiled with the todays build of JCL and JVCL.
So FindFirst and FindNext function don;t works properly. Because if you copy this code in real environment - then it works.
(0011149)
ivan_ra (developer)
2007-02-23 04:06
edited on: 2007-02-23 08:43

The problem is the difference betwen TSearchRec structure
Your code works fine in D5 but does not work in D10. Now I cant chek from what version new type was introduced (maybe D6), so, You must wait until monday or try to apply temp code for JvInterpreter_Sysutils (line 2088):

    AddRec(cSysUtils, 'TSearchRec', SizeOf(TSearchRec), [
      RFD('Time', 0, varInteger),
      RFD('Size', 8, varInteger), //It was integer, but now is INT64!!!
      RFD('Attr', 16, varInteger),
      RFD('Name', 20, varString),
      RFD('ExcludeAttr', 24, varInteger),
      RFD('FindHandle', 28, varInteger)],
      JvInterpreter_NewTSearchRec, JvInterpreter_DisposeTSearchRec, nil);

(0011203)
ZENsan (reporter)
2007-02-27 10:12

o! Its good. Thats ok.
(0011305)
ivan_ra (developer)
2007-03-13 04:37

fixed in SVN
New TSearchRecord type was introduced in D10 with Int64 file size (integer - before D10). Current solution supports up to 2^31 bytes files because interpreter does not support int64

- Issue History
Date Modified Username Field Change
2007-02-02 16:48 ZENsan New Issue
2007-02-06 02:13 ivan_ra Note Added: 0010698
2007-02-06 02:13 ivan_ra Status new => feedback
2007-02-19 05:30 ZENsan File Added: Sample.zip
2007-02-19 05:31 ZENsan Note Added: 0011091
2007-02-23 04:06 ivan_ra Note Added: 0011149
2007-02-23 04:12 ivan_ra Note Edited: 0011149
2007-02-23 08:43 ivan_ra Note Edited: 0011149
2007-02-27 10:12 ZENsan Note Added: 0011203
2007-03-13 04:37 ivan_ra Status feedback => resolved
2007-03-13 04:37 ivan_ra Fixed in Version => Daily / SVN
2007-03-13 04:37 ivan_ra Resolution open => fixed
2007-03-13 04:37 ivan_ra Assigned To => ivan_ra
2007-03-13 04:37 ivan_ra Note Added: 0011305


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker