Sign in to follow this  
Followers 0
Aceguy

merging 2x 2D arrays

5 posts in this topic




yea, ( or a hint on how to do it. PLEEEEEASE).

$var_open=IniReadSection($IniFile,GUICtrlRead($Char_combo))
$t=_GUICtrlListView_GetItemCount($ListView)

dim $temp[1][2]
for $a= 1 to $var_open[0][0]
    if StringInStr($var_open[$a][1],$where)=0 then
ConsoleWrite("where NO match"&@lf)
if $var_open[$a][1]<>"0" Then
ReDim $temp[$a+1][2]

$temp[$a][0]=$a-1
$temp[$a][1]=$var_open[$a][1]

EndIf
EndIf
Next
IniDelete($IniFile,GUICtrlRead($Char_combo))

Dim $data[$t+1][2]
for $k=1 to $t
$data[$k][0]=($k-1)
$data[$k][1]=_GUICtrlListView_GetItemTextString($ListView,$k-1)
Next

;_ArrayDisplay($temp,"Inifile");from Inifile
;_ArrayDisplay($data,"Listview");from listview

;***************** would like to merge $data and $temp to = $data

IniWriteSection($IniFile,GUICtrlRead($Char_combo),$data,1)

Share this post


Link to post
Share on other sites

Ok this is my attempt.... and its not working. PLEASE HELP

$z=$temp[0][0]
$z2=$data[0][0]
for $aw=1 to $z

$data2[$aw][0]=$aw-1
$data2[$aw][1]=$temp[$aw][1]
Next
for $aw=1+$z to $z2+$z
$data2[$aw][0]=$aw-1
$data2[$aw][1]=$temp[$aw-$z][1]
Next
_ArrayDisplay($data2)

Share this post


Link to post
Share on other sites

Ok this is my attempt.... and its not working. PLEASE HELP

$z=$temp[0][0]
$z2=$data[0][0]
for $aw=1 to $z

$data2[$aw][0]=$aw-1
$data2[$aw][1]=$temp[$aw][1]
Next
for $aw=1+$z to $z2+$z
$data2[$aw][0]=$aw-1
$data2[$aw][1]=$temp[$aw-$z][1]
Next
_ArrayDisplay($data2)
Both of your For/Next loops are sourcing data from the same array, $temp. Seems like you should be getting data from $temp in the first loop, and from $data in the second loop.

:)


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

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