bqp2 Posted November 21, 2010 Share Posted November 21, 2010 #include <Process.au3> #include <File.au3> $test = 63901 $handle = FileOpen("C:\Zip.txt", 1) $zip = FileReadLine($handle, Random(1, 42021, 1)) FileClose($handle) MsgBox(4096, "Test", "zip Code is" & $zip , 10) why is this not working, if i use $test it works so its obviously not reading the file Link to comment Share on other sites More sharing options...
JohnOne Posted November 21, 2010 Share Posted November 21, 2010 Well for a start you are opening the file in write mode. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Fubarable Posted November 21, 2010 Share Posted November 21, 2010 What do you mean by if you use $test it works? Also, have you checked that the file is being open correctly, that $handle is not -1? Link to comment Share on other sites More sharing options...
JohnOne Posted November 21, 2010 Share Posted November 21, 2010 And that your text file really does have 42000 lines in it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
bqp2 Posted November 21, 2010 Author Share Posted November 21, 2010 (edited) And that your text file really does have 42000 lines in it.lol yes its a zip code reader and i got them all, i set $test to 63901 and when i use MsgBox(4096, "Test", "zip Code is" & $test , 10) it says zip Code is63901but when i use the $zip it just returnszip Code iswhat would be the proper code to get it to show the zip on that random line?edit nevermind $handle = FileOpen("C:\Zip.txt", 1) the 1 should be a zero Edited November 21, 2010 by bqp2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now