Jump to content
Sign in to follow this  
Pharo

StingSplit not working like I want

Recommended Posts

Pharo

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)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.