Sign in to follow this  
Followers 0
MazeMiami

increase the value of a number by one HOW?

3 posts in this topic

#1 ·  Posted (edited)

Ok so been reading the help me file and the forum for over an hour it's seem like it should be so easy yet i think i'm completely off

Here is what i have i dont think i'm on the right track

I would like the x value to increased by one each time the loop is ran

do
$x= 1;need to be  increased by one
$file = FileOpen("test.txt", 0)

$Number = FileReadline($file, $x) 


$x = $x +1

MsgBox(0, "The Number is", $Number)

Until $x=5

FileClose($file)

thank you in advance for any help

Edited by MazeMiami

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$x= 1
do

$file = FileOpen("test.txt", 0)

$Number = FileReadline($file, $x) 

MsgBox(0, "Line "&$x, $Number)
$x +=1
Until $x=5

FileClose($file)

everytime the loop start your delcaring it as being 1 again, so it cant move on.

Edited by Aceguy

Share this post


Link to post
Share on other sites

thanks for the reply yet I just realized that I just had to move some of the things outside of the loop

so it works!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0