Thread: While Loop
View Single Post
Author Message
Gior
Member
Join Date: Sep 2013
Location: Israel
Old 04-28-2015 , 15:09   While Loop
Reply With Quote #1

Hey,

I have a question about while loop.
Let's say I want to read from a file with a while loop:
PHP Code:
new Handle:File OpenFile("file.txt""r")
new 
String:buffer[128]
while(!
IsEndOfFile(File))
{
    
ReadFileLine(Filebuffersizeof(buffer))
    
PrintToServer("%s"buffer)

How the function "ReadFileLine" knows what line to read every time the loop start over?
I mean it starts from the top but how it knows how to read all the file?
I don't see here a option to set a line number or something like that, and yet, it is still reading the next line.

Any explanations?


Thanks in Advance

Last edited by Gior; 04-28-2015 at 15:10.
Gior is offline