# Thread: Can someone explain what this means??

1. ## Can someone explain what this means??

Code:
`if(lines++%20==19)`

2. This is simply testing to see if the reamainder (modulous %) of dividing the value contained in lines by 20 is equal to 19. I imagine this statement is contained in a loop because the value of lines is then incremented by one. Hope that helps. Have a nice day.

3. Hi, dont fully understand that, but nearly..

How would I write a program that put certain lines of a text file onto a certain x,y on the screen.

4. Dont understand, I just don't understand what it means!..[IMG][/IMG]

Sorry http://www.rsownersclub.co.uk/ubb/confused.gif

5. ## Re: Can someone explain what this means??

Originally posted by JamMan
Code:
`if(lines++%20==19)`
lines++ // incremant the value contained in lines by 1. If lines == 16, lines++ sets lines to 17

lines++ % 20 // divide lines by 20 and find the remainder. If lines == 25, lines % 20 == 5.

lines++ % 20 == 19 // if that remainder == 19

There could be a problem with lines++ as to when it increments: before or after the modulus operation. This stuff causes weird problems, and there are threads on the board about this if you search. I think it's compiler dependant, but check first.

6. Cheers Brown Drake think I got it now.