Raised This Month: $ Target: $400
 0% 

While Loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode