Jump to content

Need help with 2D array


Recommended Posts

hey

i have made something like this

; this is an array that have 5000 rows and 5 columns

dim $cardsarray [5] [5000]

for $j = 1 to 5000

_ArrayInsert( $cardsarray [1],$j,$data1)

_ArrayInsert( $cardsarray [2],$j,$data2)

_ArrayInsert( $cardsarray [3],$j,$data3)

_ArrayInsert( $cardsarray [4],$j,$data4)

_ArrayInsert( $cardsarray [5],$j,$data5)

next

what am i doing wrong ?

Link to comment
Share on other sites

dim $cardsarray [6] [5001]

for $j = 1 to 5000
$cardsarray [1][$j]="data1";or $data1
$cardsarray [2][$j]="data2"
$cardsarray [3][$j]="data3"
$cardsarray [4][$j]="data4"
$cardsarray [5][$j]="data5"
next

MsgBox(0,"",$cardsarray[2][2456],0)

Link to comment
Share on other sites

after row 4000 i get weird results all the data is stored inside the row number and not inside the columns

something like this

(its like this columns are not working the data is like this

[3999]data1|data2|data3|data4|data5 ( and all of this is inside the row column)

[4000]data1|data2|data3|data4|data5

etc..

I hope i was clear. :D

Link to comment
Share on other sites

first of all thanks for all your help and time (randall and Aceguy)

i am looking in arraydisplay

my version is v3.2.10.0

running is on v3.2.11.2 (beta)

gave me only 4000 rows.

running this on beta 3.2.11.7 gave me also only 4000 rows..

Link to comment
Share on other sites

first of all thanks for all your help and time (randall and Aceguy)

i am looking in arraydisplay

my version is v3.2.10.0

running is on v3.2.11.2 (beta)

gave me only 4000 rows.

running this on beta 3.2.11.7 gave me also only 4000 rows..

oops,

not your array; probably arraydisplay, but not sure why it has bugged up..

maybe show your script..[though maybe arraydisplay has gone back to old version..]

Randall

Edited by randallc
Link to comment
Share on other sites

oops,

not your array; probably arraydisplay, but not sure why it has bugged up..

maybe show your script..[though maybe arraydisplay has gone back to old version..]

Randall

here is the script

it reads a fle with lots of lines every line have a data like this

data1@data2@data3@data4@data5

what i want to do is compare 2 files like that so i thought putting all the data into an array and sort it out and then compare (becouse there are about 8000 lines in each of the files -and i want to compare not a full line but a data inside that line

if you know on a better way i will be more then happy to hear..

func compare_nova_and_cardbot_price ()
while 1
$cardbot_card_name=""
$cardbot_card_edition=""
$cardbot_card_number=""
$cardbot_card_price=""
            for $i=1 to 70
                    $charC =FileRead($file_cardbot, 1)
                    if $charC=='@' then ExitLoop
                    $cardbot_card_name= $cardbot_card_name &$charC
                next
        ;MsgBox (0 ,"card name is",$cardbot_card_name)
            for $i=1 to 4
                    $charC = FileRead($file_cardbot, 1)
                    if $charC=='@' then ExitLoop
                    $cardbot_card_edition=$cardbot_card_edition&$charC
            next
        ;   MsgBox (0 ,"card edition is",$cardbot_card_edition)
            for $i=1 to 4
                    $charC = FileRead($file_cardbot, 1)
                    if $charC=='@' then ExitLoop
                    $cardbot_card_number=$cardbot_card_number&$charC
            next

            
            for $i=1 to 5
                    $charC = FileRead($file_cardbot, 1)
                    if $charC=='@' then ExitLoop
                    $cardbot_card_price=$cardbot_card_price&$charC
            next
        ;MsgBox (0 ,"card price is",$cardbot_card_price)        
            for $i=1 to 5
                    $charC = FileRead($file_cardbot, 1)
                    if $charC=='@' then ExitLoop
            next            
                $charC = FileRead($file_cardbot, 1)
                    $cardbot_card_rarity=$charC
                If @error = -1 Then ExitLoop                
                $cardsarray [0][$j]=$cardbot_card_name
                $cardsarray [1][$j]=$cardbot_card_edition
                $cardsarray [2][$j]=$cardbot_card_number
                $cardsarray [3][$j]=$cardbot_card_price
                $cardsarray [4][$j]=$cardbot_card_rarity
                $j =$j+ 1
                ConsoleWrite ($j)
                
        WEnd
        _ArrayDisplay($cardsarray, "_ArrayDisplay() 2D Test", 1, 1); [2D, transposed]   
        ;MsgBox (0 ,"card rarity is",$cardbot_card_rarity)      
EndFunc
Link to comment
Share on other sites

Hi,

_ArrayDisplay($cardsarray, "_ArrayDisplay() 2D Test", 1, 1); [2D, transposed]oÝ÷ Úf²m殶­seô'&F7Æb33c¶6&G6'&ÂgV÷Cµô'&F7Æ$BFW7BgV÷C²ÂÓ²³$BÂG&ç7÷6VE
, or make the itemnumber how many you want?

Best, Randall

Link to comment
Share on other sites

Fixed in the Betas. The following script fails as described at row 4000 with Prod 3.2.10.0, but works fine in Beta 3.2.11.5:

#include <Array.au3>
Global $avBigArray[5000][5]
For $r = 0 To 4999
    For $c = 0 To 4
        $avBigArray[$r][$c] = $r & "," & $c
    Next
Next
_ArrayDisplay($avBigArray, "$avBigArray")

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...