Jump to content
Sign in to follow this  
res2cpu

problems with arraydelete

Recommended Posts

res2cpu

Hey,

I have looked over the forums and help files for the last 2 hours and am going to go crazy!

I am trying to remove data from an array which has more then one dimension.

CODE
Func _process_data ()

$datafile = IniRead ( $inifile, "file", "datafile", "")

$tempfile = IniRead ( $inifile, "file", "tempfile", "")

;MsgBox(4096, "returned data from dialog (if any)", $datafile)

;MsgBox(4096, "returned data from dialog (if any)", $tempfile)

$evedata = _CSVReadFile( $tempfile, "," )

_ArrayDisplay ( $evedata )

For $i = Ubound($evedata)-1 to 1 step -1

;MsgBox(4096, "", $i )

$type = StringInStr ( $evedata[$i][2], "donation",0, 1 )

;MsgBox(4096, "", $i & " - " & $type )

if $type > 0 Then

_ArrayDelete ( $evedata, $i )

MsgBox(4096, "", $i & " - " & $type & " removed" )

EndIf

Next

_ArrayDisplay ( $evedata )

EndFunc

I end up with the error "Array variable has incorrect number of subscripts or subscript dimension range exceeded."

Here is a sample of the data im working with in csv format

CODE
2007-10-30 22:10:00,542613580,Player Dnation,user1,user2,,-567000000.00,1056201337.00,lotto win

2007-10-30 22:09:00,542608771,Player Donation,user1,user2,,-567000000.00,1623201337.00,lotto win

Can anyone help or give me any pointers please?

Res2cpu

Edited by res2cpu

Share this post


Link to post
Share on other sites
res2cpu

cool,

thanks randallc

the only other way i could think todo it was to remake the array and copy the stuff to it.

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.