Jump to content

StingSplit not working like I want


Recommended Posts

I'm trying to write a line to a file then get that line and split it for later use. It writes and reads the information name,1,2,3,4,5,6,7,8,9,10 into $line but then when I stringsplit it doesn't work.

CODE
#include <file.au3>

#include <Array.au3>

$file = FileOpen("activity.txt", 1)

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

_FileWriteToLine("activity.txt",1, "name,1,2,3,4,5,6,7,8,9,10",1)

fileClose($file)

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

While 1

$line = FileReadLine($file)

If @error = -1 Then ExitLoop

MsgBox(0, "Line read:", $line)

Wend

$avArray = StringSplit($line,",")

_ArrayDisplay( $avArray, "_ArrayToString() Test" )

FileClose($file)

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...