On Mon, DEC 12, 2011 at 3:22 PM, Sven Bart wrote:


Am 12.12.2011 21:20 Schreiber "Sven Bart" < [email protected] <javascript:parent.wgMail.openComposeWindow('[email protected]')>
:

Am 12.12.2011 21:05 Schreiber "Chris Feeling" < [email protected] <javascript:parent.wgMail.openComposeWindow('[email protected]')> >:
That worked, but now, later in the code:
 Rowan := 1;  while Rowan <= stgInvOps.Row Count do        begin          read(inventory,stock);          stgInvOps.Cels[0,Rowan] := into(stockcars);          inc(Rowan);        end;   close file(inventory);

Replace the "<=" condition by "<". The row indices go from 0 to Row Count-1. And replace the "Rowan := 1" by "Rowan := 0" of course.

Row[0] is my header row and has fixed cells.

I do have more than one column, but I figured get one column working and adding the others will be the same. I do see a math error, though - I set the number of row to the number of records in the file, but I forgot to add in the header row, stgInvOps.RowCount needs to be one greater than the number of records.

That aside, I'm still having trouble getting the system to read from the file, and with the math error should get an out of range error not access denied or SIGSEGV. In fact, I replaced 'rowNum <= stgInvOps.count' with 'not eof(inventory)', and got the same error.

Thank you for your help thus far.
-Chris
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to