1

Topic: Check of the last line in StringGrid

At me the table (44, on 1 fix is made. To a line and a column) into which the data is entered, after filling, I push the button and in the table there is a line "Total" with the totals of these 3 columns, then I should transfer this line to other table - with it problems are not present. The problem that that spanning button, throws off the last line independently because, whether is in 0th column a word "Total" or not - and throws off, I wrote  the code, but an error that the line "Total" is not present, appears anyway.
The check code on presence of a line "Total":
for i: = stringgrid1.RowCount downto stringgrid1.RowCount-1 do
if stringgrid1.Cells [0, i] <> ' the Total ' then begin showmessage (' There are no cycle totals '); exit; end;

Help please with the given dilemma = /

2

Re: Check of the last line in StringGrid

knight11 wrote:

Help please with the given dilemma = /

The debugger with an output of values of all variables helps. To find a place, where yours enough
Representations about code operation start to disperse from a reality.

3

Re: Check of the last line in StringGrid

1. Show all code, and not just "the check Code". And that was to - and that that was after.
http://sscce.org/
2. Open for itself tags "spoiler" and "source codes" - http://www.sql.ru/faq/faq_topic.aspx?fid=202
3. The idea "to check presence of a line the Total" the unsuccessful. a  a variable "SozdanaStrokaItog: boolean;" also use it. Visual components - only for show  to the user, not for storage and not for calculations.
4. An individual question - as you think, how the program of should move at attempt to read value from

stringgrid1.Cells [0, stringgrid1.RowCount]

???

4

Re: Check of the last line in StringGrid

Thanks, I simply fool to create a variable , all is much easier = _ ="

5

Re: Check of the last line in StringGrid

knight11;
Generally  provokes to binding "data", "behavior" and "a picture for the user"
If on it to give in - that then comes an ass when already it is literally in a week of anything in  it is impossible to touch and change even small nonsense
that such spaghetti code
Also esteem type articles http://habrahabr.ru/post/147133/
Not mandatory to do "correct MVC" or later MV ** - but idea that it is necessary to force to divide itself levels realize and remember