Jump to content
Sign in to follow this  
19alex95

Doppel array

Recommended Posts

19alex95

hi

I need a Doppel indexed array or so.

I need this for my Databank with acsv data.

please help my

(I need a exsample)

thx

That have I programer

Opt('MustDeclareVars', 1)

Local $j,$line,$file,$datensatz,$array
$file = FileOpen("test.csv", 0)


If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf


$j = 0
While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    $array = StringSplit($line, ';')
    For $i = 1 to 7
        Dim $array[$i]=$datensatz [$j] [$i]
    next
   
    $j=$j+1
Wend

FileClose($file)
MsgBox(0,"Hi",$datensatz[1] [4])

Share this post


Link to post
Share on other sites
Andreik

Maybe $datensatz[$j][$i] = $array[$i], it make sense.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
19alex95

it show

C:\Dokumente und Einstellungen\Alexander\Desktop\test4.au3 (19) : ==> Array variable subscript badly formatted.:

Dim $Datensatz [$j] [$i] = $array [$i]

Dim $Datensatz [^ ERROR

what is wrong??

Edited by 19alex95

Share this post


Link to post
Share on other sites
Andreik

it show

C:\Dokumente und Einstellungen\Alexander\Desktop\test4.au3 (19) : ==> Array variable subscript badly formatted.:

Dim $Datensatz [$j] [$i] = $array [$i]

Dim $Datensatz [^ ERROR

what is wrong??

I don't understand what you want to do. You need to declare an array
Dim $Datensatz[number][number]

and then populate the array with data from file

$Datensatz[$j][$i] = $array[$i]

When the words fail... music speaks

Share this post


Link to post
Share on other sites
19alex95

I want make a Programm that is a adress databank with a csv data.

The Program shall read the data and split it.

exemble:

$daten[column][line]

Msgbox(0,"",column&line)

Edited by 19alex95

Share this post


Link to post
Share on other sites
Andreik

I want make a Programm that is a adress databank with a csv data.

The Program shall read the data and split it.

exemble:

$daten[column][line]

Msgbox(0,"",column&line)

Maybe is more easy with Excel. Look at functions in help file.

Upload an example of this file type.


When the words fail... music speaks

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  

×