Jump to content
Sign in to follow this  
formatmylife12

Need help for $array = StringSplit(StringReplace

Recommended Posts

formatmylife12

I had somethings like this:

Dim $aRecords

If Not _FileReadToArray($f, $aRecords) Then

MsgBox(4096, "Error", " Not found the File to Check: "&$f)

Exit

EndIf

;==============================================================================================

$f1="live_"&$f

$f40="die_"&$f

$file1 = FileOpen($f1, 1)

$file40 = FileOpen($f40, 1)

;==============================================================================================

For $x = 1 To $aRecords[0]

If StringLen($aRecords[$x])>24 Then

;==============================================================================================

$array = StringSplit(StringReplace($aRecords[$x], $d, @LF), @LF)

$str1 = StringReplace($array[$vstr1], " ", "")

$str2 = StringLeft(StringReplace($array[$vstr2], " ", ""), 2)

$str3 = StringRight(StringReplace($array[$vstr3], " ", ""), 2)

$str4= StringReplace($array[$vstr4], " ", "")

----------------

When I run , it met the errors, I think $array is not a string or empty, I dont know why, Please help!

Share this post


Link to post
Share on other sites
herewasplato

Welcome to the forum.

...When I run , it met the errors, I think $array is not a string or empty, I dont know why, Please help!

Test your assumption with _ArrayDisplay($array) or ConsoleWrite or MsgBox

#include <Array.au3>

...

...

...

$array = StringSplit(StringReplace($aRecords[$x], $d, @LF), @LF)

_ArrayDisplay($array)

...

...

...


[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×