hey all,
Im new to creating components, and Im having a problem
getting rid of an error in one of my components. The
exception is an EAccessViolation whenever I quit my
test application that used one my components. And I
know it has to do with the TStrings that Im using
inside the component. Im freeing the TStrings when the
component is destroyed but the error still persists.
here is some code from the parsing component:
TWTParse = class(TComponent)
private
FRowCount: integer;
FCellCount: integer;
FHeadersCount: integer;
FRemoveHeaders: boolean;
FRawTable : TStrings;
FSortedTable: TStrings;
FDelimitedTable: TStrings;
FTableHeaders: TStrings;
FCellDelimiter: char;
FRowDelimiter: char;
// etc .......
protected
procedure SetRawTable(newValue: TStrings);
virtual;
function GetRawTable: TStrings; virtual;
procedure SetCellDelimiter(newValue: char);
virtual;
procedure SetRowDelimiter(newValue: char);
virtual;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ParseData;
procedure ThreadParseData;
function Execute: Boolean;
function TableRowCount: Integer;
function TableCellCount: Integer;
function TableHeadersCount: Integer;
function RawTable: TStrings;
function SortedTable: TStrings;
function DelimitedTable: TStrings;
function HeadersTable: TStrings;
function SortTable(tstr: TStrings): TStrings;
published
property CellDelimiter: char read FCellDelimiter
write SetCellDelimiter default #127;
property RowDelimiter: char read FRowDelimiter
write SetRowDelimiter default #127;
property RemoveHeaders: boolean read
FRemoveHeaders write FRemoveHeaders default true;
property Data: TStrings read GetRawTable write
SetRawTable;
// - events etc...
end;
constructor TWTParse.Create(AOwner: TComponent);
begin
inherited Create(aOwner);
FSortedTable := TStringlist.Create;
FRawTable := TStringlist.Create;
FDelimitedTable := TStringlist.Create;
FTableHeaders := TStringlist.Create;
FTableRowCount := 0;
FTableCellCount := 0;
end;
destructor TWTParse.Destroy;
begin
FDelimitedTable.Free;
FRawTable.Free;
FSortedTable.Free;
FTableHeaders.Free;
inherited Destroy;
end;
I know Im probably missing something simple, so can
someone please open my eyes :)
Thank you for your time....
Frank
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/