After hours of digging, I understood that the code, just created an automatic variable, which was incremented each time and kept storing its value in each new record. After that, I tried my own tiny experiment. I created a simple array of data from 1 to 100 with one column and 100 records. I implemented a simple 'if' statement that did the trick.
With tired fingers, I hit F3 to run. It worked. You can only imagine how happy I was, the internal satisfaction that I received was more than any thing else. It brought a big smile in my face and in my heart. phew!! I said and looked at the code. Its was only 4 lines. It was neither a joke nor any love message. It was an expression my intelligence.
That was my little happiness. Don't know why we all get so satisfied with these things. But I cannot deny the amount of satisfaction we get.