Jump to content

Trouble with array, variables and File Content


Matt123
 Share

Recommended Posts

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...