Jump to content
Sign in to follow this  

Array use

Recommended Posts


I have a script in a global multi-dimensional array that every interaction has to be reset.

use this code in the while loop:

Global $retDati[1][1]
Global  $DatiStampa [1][6]
Global $ListView1
func StartLoad()
Dim $riga[5]
Dim $Conta = 1
$cartella = @ScriptDir
$search = FileFindFirstFile($cartella & "\*.xml")
While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
              $riga = LoadDati($cartella, $file)   ; Load Data from XML file
      if $conta > 1 then
                ; append new empty row
                Redim $retDati[Ubound($retDati)+1][1]
                Redim $DatiStampa[Ubound($retDati)+1][6]
                 ;clear the array
                 Redim $retDati [1][1]
                 Redim $DatiStampa [1][6]
     $conta += 1
    LoadArrayGlobale($riga) ; append the Data to global array
_GUICtrlListView_AddArray($ListView1, $retDati)
Func LoadArrayGlobale($riga)
  $retDati[Ubound($retDati)-1][0] = $riga[$CRagioneSociale]
  $DatiStampa[Ubound($retDati)-1][$CRagioneSociale] = $riga[$CRagioneSociale]
  $DatiStampa[Ubound($retDati)-1][$CIndirizzo] = $riga[$CIndirizzo]
  $DatiStampa[Ubound($retDati)-1][$CCodiceFiscale] = $riga[$CCodiceFiscale]
  $DatiStampa[Ubound($retDati)-1][$CDataIncarico] = $riga[$CDataIncarico]
  $DatiStampa[Ubound($retDati)-1][$CAmminstratore] = $riga[$CAmminstratore]
  $DatiStampa[ubound($retDati)-1][$CCaricaAmministratore] = $riga[$CCaricaAmministratore]

But it does not work as I thought, in fact I ended with an array of multiple lines due to (n * x line interactions)

Edited by Virgilio1

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...