Matt123 Posted October 11, 2012 Share Posted October 11, 2012 I have a file that lists info about different categories, and the categories are separated by lines and info by "|" (this symbol), getting the info seems to work, but when I split it into an array thats where the trouble comes in. I'm getting this error "Array variable has incorrect number of subscripts or subscript dimension range exceeded.:" This is sorta what my code looks like, I'm getting the error first where you see " *** ". Please Help. Thanks! $x = 2 ;to skip the line talking about the info $file_cards = FileOpen("file.txt", 0);0 = Read mode While $x <= 8 $contents = FileReadLine("file.txt", $x) $INFO = StringSplit(StringStripWS($contents,8),"|") *** $name = $INFO[0] *** $type = $INFO[1] $time1 = $INFO[2] $time2 = $INFO[3] $check1 = $INFO[4] $check2 = $INFO[5] $x = $x + 1 Wend Link to comment Share on other sites More sharing options...
JohnOne Posted October 11, 2012 Share Posted October 11, 2012 Please create a runnable example with .txt file example that reproduces the problem. 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...
Matt123 Posted October 11, 2012 Author Share Posted October 11, 2012 TEXT FILETYPE | TIME1 | TIME2 | CHECK1 | CHECK2 TEST1 | 25 | 50 | NO | YES TEST2 | 12 | 20 | YES | NO TEST3 | 16 | 70 | NO | NO TEST4 | 29 | 15 | YES | NO Link to comment Share on other sites More sharing options...
JohnOne Posted October 11, 2012 Share Posted October 11, 2012 (edited) look and add $contents = FileReadLine("file.txt", $x) If @error Then ExitLoop ; if no more lines to read exit the loop Edited October 11, 2012 by JohnOne 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...
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