View Issue Details

IDProjectCategoryView StatusLast Update
0004051JEDI VCL00 JVCL Componentspublic2007-03-13 04:37
ReporterZENsanAssigned Toivan_ra 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.34 
Summary0004051: JvIterpreter record type problems
DescriptionWhen 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 Informationunit 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.
TagsNo tags attached.

Activities

ivan_ra

2007-02-06 02:13

developer   ~0010698

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)

2007-02-19 05:30

 

Sample.zip (8,286 bytes)

ZENsan

2007-02-19 05:31

reporter   ~0011091

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.

ivan_ra

2007-02-23 04:06

developer   ~0011149

Last edited: 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);

ZENsan

2007-02-27 10:12

reporter   ~0011203

o! Its good. Thats ok.

ivan_ra

2007-03-13 04:37

developer   ~0011305

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