Sign in to follow this  
Followers 0
vkrisz81

array and iniread

3 posts in this topic

this is a HACK :DDDDD (how to cheat multidimensionalarrayintootherarray hack)

-just because you see only hack in everything:D

so here is an ini where i store records with 5 key-value pairs

if i read it with inireadsection its ok, i prsent it with arraydispley, it shows there is an 5*2 array

but, i cant attach it to an other array where i would like to store in a bigger array

there are names, these are sectionnames

in names there are datas, like age, address, etc etc

how can i make a big array which store these data all? section name and key-value pairs in common array?

tipically hacker/cheater questions.. isnt it?:D

Share this post


Link to post
Share on other sites



again the "cheaterhackerpro guy" :D

here is an example of this site:

Local $arr[3]
Local $a1[3] = [2, "a1-1","a1-2"]
Local $a2[3] = [2, "a2-1","a2-2"]
$arr[1] = $a1
$arr[2] = $a2
$arr[0] = 2
Local $dumy
 
For $i = 1 to $arr[0]
$dumy = $arr[$i]
 
  For $j = 1 to $dumy[0]
    ConsoleWrite("$i:=" & $i & ", $dumy[" & $j & "]:=" & $dumy[$j] & @LF)
  Next
Next

so i want to type out the arr[1][1][1] but i cant.. why?

arr[1] had been a multidimensional array by a1 what is a 2 dimensional array.. why or how can i call those values?

Share this post


Link to post
Share on other sites

vkrisz81,

Enough of the (very badly-done) sarcasm - and if you send me another PM such as the one I have just received you will get a posting holiday. :mad:

As to this perfectly acceptable question - why not store the section data as arrays within a larger array? You can quite easily access the internal data: :)

#include <Array.au3>

; Declare arrays holding the section data
Local $aSection_1_Data[5][2] = [ _
            ["Section_1_Key_1", "Section_1_Val_1"], _
            ["Section_1_Key_2", "Section_1_Val_2"], _
            ["Section_1_Key_3", "Section_1_Val_3"], _
            ["Section_1_Key_4", "Section_1_Val_4"], _
            ["Section_1_Key_5", "Section_1_Val_5"]]
Local $aSection_2_Data[5][2] = [ _
            ["Section_2_Key_1", "Section_2_Val_1"], _
            ["Section_2_Key_2", "Section_2_Val_2"], _
            ["Section_2_Key_3", "Section_2_Val_3"], _
            ["Section_2_Key_4", "Section_2_Val_4"], _
            ["Section_2_Key_5", "Section_2_Val_5"]]

; Declare a constainer array which contains the section arrays
Local $aContainer[2] = [$aSection_1_Data, $aSection_2_Data]

; Then access the internal section arrays like this

; Entire array
_ArrayDisplay($aContainer[0], "Section 1", Default, 8)

; Single elements - note () around $aContainer[#] part of the syntax
MsgBox($MB_SYSTEMMODAL, "Section 2 - Pair 3", ($aContainer[1])[2][0] & " - " & ($aContainer[1])[2][1])
However, if you wanted to modify the section data I would recommend extracting the internal array, changing the data and then reloading into the container. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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  
Followers 0