Jump to content

merging 2x 2D arrays


Recommended Posts

  • Developers

..and the question is ? (don't tell me you want the code for it.) :)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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)
Link to comment
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)
Link to comment
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
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...