[Gambas-user] Bad Row Index
Richard Terry
rterry at ...1823...
Fri Oct 26 02:12:08 CEST 2012
Keith Clark wrote:
> I am getting a bad row index in the following code.
>
> iProductRows = 1
> fProducts = Open "products.dat" For Input
> While Not Eof(fProducts)
> gvProducts.Rows.Count = iProductRows
> Line Input #fProducts, sName
> Line Input #fProducts, iLargePrice
> Line Input #fProducts, iSmallPrice
> Line Input #fProducts, iESMeatPrice
> Line Input #fProducts, iELMeatPrice
> Print iProductRows
> gvProducts[iProductRows, 0].text = sName
> gvProducts[iProductRows, 1].Text = iLargePrice
> gvProducts[iProductRows, 2].Text = iSmallPrice
> gvProducts[iProductRows, 3].Text = iESMeatPrice
> gvProducts[iProductRows, 4].Text = iELMeatPrice
> iProductRows = iProductRows + 1
>
> Wend
>
> Any idea why?
>
>
The first gridrow = 0 so will always be 1 less than your row count,
your code is trying in the first instance to write to grid row number 2
which dosn't exist.
Regards
richard
More information about the User
mailing list