On 12/5/11, Chris Kelling <[email protected]> wrote:
> I'm trying to read from a file and populate a stringgrid, and keep
> getting 'Project spares.exe raised an exception class 'External error:
> SIGSEGV' when trying to convert an integer to string.
> var
> {stockItem type is a record with the following structure:
> recordID : longint;
> ClassNumber : integer;
> PartNumber : string;
> Make : String;
> TypeofEqip : string;
> Model : string;
> Description : string;
> quantity : integer;
> location : string;
> price : real; }
Depending on the current compiler directive {$H+} (default for any
lazarus program) type string will be ansistring.
If you write a record with a variable of type ansistring to file, it
will write the pointer to that string.
If you read that file, this poiter probably will point to something
you have no access to --> SIGSEV
Change all string explictely to ShortString in the definition of your record.
Bart
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus