View Issue Details

IDProjectCategoryView StatusLast Update
0002355JEDI VCL00 JVCL Componentspublic2005-02-11 20:44
ReporterZioNemoAssigned Towapostma 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.00 
Summary0002355: TJvCsvDataSet: inconsistent use of Separator
DescriptionSeparator is used also when parsing CsvFieldDef, but the property editor always uses a comma.
This can be very confusing.
I have a semicolon-separated file and I had to manually change all the commas to semicolons in CsvFieldDef; not a big deal, but it took me some time to uderstand why my headers were not parsed correctly.
IMHO it would be better to instruct the component to ignore Separator settings while parsing CsvFieldDef (what happens if I have a colon-separated file??).

Regards
ZioNemo
Additional InformationI'm using CVS (about 2 weeks old) and Delphi7.
TagsNo tags attached.

Activities

ZioNemo

2004-12-03 02:43

reporter   ~0005817

A few more things:
After I manually changed CsvFieldDef separtor by hand the property editor is utterly unusable (as expected).
Also the Sort(string, boolean) method uses Separator to parse the fields to sort upon. This should be consistent with CsvFieldDef usage (so, if You decide to always use a comma, this should follow suit)

Regards
ZioNemo

wapostma

2005-02-02 07:15

developer   ~0006333

R.Marquardt's fix to CVS, rev 1.22 of JvCsvDataForm.pas actually broke the normal designtime operation of the form. I am going to try to fix it without reversing any progress made in this issue so far.

Here is the problem:

This is what there WAS in cvs rev 1.21 I think:

procedure TJvCsvDefStrDialog.UpdateCsvStr;
var
  I: Integer;
  S: string;
begin
  S := '';
  for I := 0 to ListBoxFields.Items.Count - 1 do
    if S = '' then
      S := ListBoxFields.Items[I]
    else
      S := S + ',' + ListBoxFields.Items[I]; // <---
  EditCsvStr.Text := S;
end;


here is what it got changed to:

procedure TJvCsvDefStrDialog.UpdateCsvStr;
var
  I: Integer;
  S: string;
begin
  S := '';
  for I := 0 to ListBoxFields.Items.Count - 1 do
    if S = '' then
      S := ListBoxFields.Items[I]
    else
      S := S + FSeparator + '"' + ListBoxFields.Items[I] + '"'; // <--
  EditCsvStr.Text := S;
end;

So my question is for Robert, why did you put the quotes in there? It breaks stuff.

I suggest taking the quotes out. I agree with the FSeparator change, that's fine, but what about those quotes?

wapostma

2005-02-11 20:40

developer   ~0006459

a patch has been put in to make it use the customized separator in the CsvFieldDef. Personally I thought CsvFieldDef should always have commas even if the file didn't, but this decision has already been made, and is probably not going to be a big deal anymore. i think this issue can be closed.

wapostma

2005-02-11 20:44

developer   ~0006460

Fixed in CVS.

Issue History

Date Modified Username Field Change
2004-12-02 05:55 ZioNemo New Issue
2004-12-03 02:43 ZioNemo Note Added: 0005817
2005-01-04 10:47 robert_marquardt Status new => resolved
2005-01-04 10:47 robert_marquardt Resolution open => fixed
2005-01-04 10:47 robert_marquardt Assigned To => robert_marquardt
2005-01-04 10:47 robert_marquardt Assigned To robert_marquardt =>
2005-02-02 07:15 wapostma Assigned To => wapostma
2005-02-02 07:15 wapostma Status resolved => feedback
2005-02-02 07:15 wapostma Resolution fixed => reopened
2005-02-02 07:15 wapostma Note Added: 0006333
2005-02-11 20:40 wapostma Note Added: 0006459
2005-02-11 20:44 wapostma Status feedback => resolved
2005-02-11 20:44 wapostma Resolution reopened => fixed
2005-02-11 20:44 wapostma Note Added: 0006460