bqp2 0 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 Share this post Link to post Share on other sites
JohnOne 1,603 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. Share this post Link to post Share on other sites
Fubarable 1 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? Share this post Link to post Share on other sites
JohnOne 1,603 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. Share this post Link to post Share on other sites
bqp2 0 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 Share this post Link to post Share on other sites