In delphi I keep looping through tables to read data and a common mistake is this:
While not TheTable.EOF do
begin
read some data
end;
It gets stuck in an infinite loop because I forgot TheTable.Next inside the begin end!
I quite often try to code a full structure before adding the contents so when I do the while loop above, I put the Next in before writing all the read code. Same if I declare a new type variable (or sound/image) in blitz, I like to put in the Delete variable straight away before I do the other code just so it isn't forgotten. Also when I write something using brackets I make the set of brackets and then fill out the contents, if I have to add sub brackets, I add them, then the contents, then at the end it works straight away and I don't have to count all the open ones and close them all in the correct places. Of yeah and of course with functions, if/end if, and while/wend it's best to make the structure then fill it, Protean IDE does this for you.
While not TheTable.EOF do
begin
read some data
end;
It gets stuck in an infinite loop because I forgot TheTable.Next inside the begin end!
I quite often try to code a full structure before adding the contents so when I do the while loop above, I put the Next in before writing all the read code. Same if I declare a new type variable (or sound/image) in blitz, I like to put in the Delete variable straight away before I do the other code just so it isn't forgotten. Also when I write something using brackets I make the set of brackets and then fill out the contents, if I have to add sub brackets, I add them, then the contents, then at the end it works straight away and I don't have to count all the open ones and close them all in the correct places. Of yeah and of course with functions, if/end if, and while/wend it's best to make the structure then fill it, Protean IDE does this for you.