Jump to content
Sign in to follow this  
zeroZshadow

array creating

Recommended Posts

zeroZshadow

just see my little axample and you know what the problem is

for $i=1 to $LIST

$TREE1&$i = GUICtrlCreateTreeViewitem($LSTprog[1],$TREE1)

Next

why doesn't this work ???

i meant the $TREE1&$1

in the first loop is woul be $TREE11 sec $TREE12

who do i do this??


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites
buzz44

Dim $TREE1[$LIST[0]]

For $i = 1 to $LIST[0]
   $TREE1[$i]  = GUICtrlCreateTreeViewitem($LSTprog[1],$TREE1)
Next

Try that? Im not sure what "$list" is, would help if you posted your code


qq

Share this post


Link to post
Share on other sites
Jos

just see my little axample and you know what the problem is

i meant the $TREE1&$1

<{POST_SNAPBACK}>

check out Assign() or use a Array like $TREE[$i]

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
zeroZshadow

i fixed the problem now, thank to the assign()

but i have another problem

the damn arrays won't dim correctly

i had this problem before, i'm don't know how i fixed it :)

pleas help me :D

Opt("trayicondebug",1)
Opt("GuiOnEventMode",1)

;==> MAKE DIRS
DirCreate("C:\AutoOS\Zips")
DirCreate("C:\AutoOS\Programs")
DirCreate("C:\AutoOS\Games")
DirCreate("C:\AutoOS\Icons")
;==> MAKE DIRS

;=====> FILEINSTALLS
FileInstall("C:\AutoOS\Programs\unzip.exe","C:\AutoOS\Programs\unzip.exe")
;======> FILEINSTALLS

;====> Checking files
If NOT FileExists("C:\AutoOS\Zips\Icons.zip") then _Download("http://atlas.walagata.com/w/zerozshadow/Icon/Icons.zip","C:\AutoOS\Zips\Icons.zip","C:\AutoOS\Icons\")
$statusmenu=0
;====> Checking files

;====> STARTBAR
$GUI = GUICreate("sysbar",@desktopwidth,30,0,@DesktopHeight-65,0x80040000,0x00000808)
$START = GUICtrlCreateButton("START",1,1,60,28,0x0300)
GUISetState()
GuiCtrlSetOnEvent($START,"_Menu")
;====> STARTBAR
;====> MENU
    $MENU = GUICreate("MENU",150,400,0,@desktopHeight-470,0x80040000,0x00000808)
    $TREE = GUICtrlCreateTreeView(0,0,150,400,0x0007)
    GUICtrlSetImage($TREE,"C:\AutoOS\Icons\orangeico.ico")
;=====================>PROGRAMS
    $TREE1 = GUICtrlCreateTreeViewitem("Programs",$TREE)
    GUICtrlSetImage($TREE1,"C:\AutoOS\Icons\redico.ico")    
;====> MENU
_checklist()
while 1
WEnd

Func _Menu()
    If $statusmenu = 0 Then
    GUISetState(@SW_SHOW)
    $statusmenu=1
    Else
    GUISetState(@SW_HIDE)
    $statusmenu=0
    EndIf
EndFunc

Func _Download($file,$dest,$zipdest)
    $size = InetGetSize($file)
    ConsoleWrite($size&@CRLF)
    ConsoleWrite(InetGet ($file,$dest,1,1))
    ProgressOn("Download","Downloading")
    While @InetGetActive
        ProgressSet(@InetGetBytesRead/$size*100)
    WEnd
    ProgressOff()
    Runwait("C:\AutoOS\Programs\unzip.exe "&$dest&" -d "&$zipdest,"",@sw_hide)
EndFunc

Func _Start()
For $i=1 to $LSTnumber
    if @GUI_CtrlId = $LSTprog[$i][1] Then
        $prog = $LSTprog[$i][3]
        If Not FileExists($prog) Then _Download($LSTprog[$i][2],"C:\AutoOS\Zips\"&$name[$i]&".zip","C:\AutoOS\Programs\")
    EndIf
    Run($prog)
Next
EndFunc

Func _checklist()
    $LSTnumber = IniRead ( "Programs.ini", "List", "number","0")
    Dim $LSTprog[$LSTnumber][4]
    Dim $name[$LSTnumber]
    For $i=1 to $LSTnumber
        $precache = IniRead ( "Programs.ini", "List", "prog"&$i,"")
        $LSTprog[$i] = StringSplit($precache,"|")
        MsgBox(0,"debug",$LSTprog[$i][1])
        $name[$i] = $LSTprog[$i][1]
        $pre = GUICtrlCreateTreeViewitem($LSTprog[1],$TREE1)
        $LSTprog[$i][1] = GUICtrlCreateTreeViewitem("Start",$pre)
        GUICtrlSetImage($LSTprog[$i][1],"C:\AutoOS\Icons\blueico.ico")
        GuiCtrlSetOnEvent($LSTprog[$i][1],"_Start")
    Next
EndFunc

the problem is in the _checklist()

i know the sript aint neat, but i'll clean it up when the problem is fixed

Edited by zeroZshadow

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites
zeroZshadow

is there anyone who has this problem also??

because i'm kinda stuck with my Auto-OS now, because of this little problem.


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites
quick_sliver007

i fixed the problem now, thank to the assign()

but i have another problem

the damn arrays won't dim correctly

i had this problem before, i'm don't know how i fixed it :)

pleas help me :D

Opt("trayicondebug",1)
Opt("GuiOnEventMode",1)

;==> MAKE DIRS
DirCreate("C:\AutoOS\Zips")
DirCreate("C:\AutoOS\Programs")
DirCreate("C:\AutoOS\Games")
DirCreate("C:\AutoOS\Icons")
;==> MAKE DIRS

;=====> FILEINSTALLS
FileInstall("C:\AutoOS\Programs\unzip.exe","C:\AutoOS\Programs\unzip.exe")
;======> FILEINSTALLS

;====> Checking files
If NOT FileExists("C:\AutoOS\Zips\Icons.zip") then _Download("http://atlas.walagata.com/w/zerozshadow/Icon/Icons.zip","C:\AutoOS\Zips\Icons.zip","C:\AutoOS\Icons\")
$statusmenu=0
;====> Checking files

;====> STARTBAR
$GUI = GUICreate("sysbar",@desktopwidth,30,0,@DesktopHeight-65,0x80040000,0x00000808)
$START = GUICtrlCreateButton("START",1,1,60,28,0x0300)
GUISetState()
GuiCtrlSetOnEvent($START,"_Menu")
;====> STARTBAR
;====> MENU
    $MENU = GUICreate("MENU",150,400,0,@desktopHeight-470,0x80040000,0x00000808)
    $TREE = GUICtrlCreateTreeView(0,0,150,400,0x0007)
    GUICtrlSetImage($TREE,"C:\AutoOS\Icons\orangeico.ico")
;=====================>PROGRAMS
    $TREE1 = GUICtrlCreateTreeViewitem("Programs",$TREE)
    GUICtrlSetImage($TREE1,"C:\AutoOS\Icons\redico.ico")    
;====> MENU
_checklist()
while 1
WEnd

Func _Menu()
    If $statusmenu = 0 Then
    GUISetState(@SW_SHOW)
    $statusmenu=1
    Else
    GUISetState(@SW_HIDE)
    $statusmenu=0
    EndIf
EndFunc

Func _Download($file,$dest,$zipdest)
    $size = InetGetSize($file)
    ConsoleWrite($size&@CRLF)
    ConsoleWrite(InetGet ($file,$dest,1,1))
    ProgressOn("Download","Downloading")
    While @InetGetActive
        ProgressSet(@InetGetBytesRead/$size*100)
    WEnd
    ProgressOff()
    Runwait("C:\AutoOS\Programs\unzip.exe "&$dest&" -d "&$zipdest,"",@sw_hide)
EndFunc

Func _Start()
For $i=1 to $LSTnumber
    if @GUI_CtrlId = $LSTprog[$i][1] Then
        $prog = $LSTprog[$i][3]
        If Not FileExists($prog) Then _Download($LSTprog[$i][2],"C:\AutoOS\Zips\"&$name[$i]&".zip","C:\AutoOS\Programs\")
    EndIf
    Run($prog)
Next
EndFunc

Func _checklist()
    $LSTnumber = IniRead ( "Programs.ini", "List", "number","0")
    Dim $LSTprog[$LSTnumber][4]
    Dim $name[$LSTnumber]
    For $i=1 to $LSTnumber
        $precache = IniRead ( "Programs.ini", "List", "prog"&$i,"")
        $LSTprog[$i] = StringSplit($precache,"|")
        MsgBox(0,"debug",$LSTprog[$i][1])
        $name[$i] = $LSTprog[$i][1]
        $pre = GUICtrlCreateTreeViewitem($LSTprog[1],$TREE1)
        $LSTprog[$i][1] = GUICtrlCreateTreeViewitem("Start",$pre)
        GUICtrlSetImage($LSTprog[$i][1],"C:\AutoOS\Icons\blueico.ico")
        GuiCtrlSetOnEvent($LSTprog[$i][1],"_Start")
    Next
EndFunc

the problem is in the _checklist()

i know the sript aint neat, but i'll clean it up when the problem is fixed

<{POST_SNAPBACK}>

is there anyone who has this problem also??

because i'm kinda stuck with my Auto-OS now, because of this little problem.

<{POST_SNAPBACK}>

to start with, look at Dim $LSTprog[$LSTnumber][4] did you want

Dim $LSTprog[$LSTnumber[4]].

Next read up on StringSplit. You may want to redo the whole function but back it up first.

Edited by quick_sliver007

.

Share this post


Link to post
Share on other sites
zeroZshadow

i just made an GOAROUND trick :)

watch:

Func _checklist()
    $LSTnumber = IniRead ("C:\AutoOS\Programs.ini", "List", "number","0")
    Global $LSTprog[$LSTnumber+1][4]
    Global $name[$LSTnumber+1]
    For $i=1 to $LSTnumber
        $precache = IniRead ( "Programs.ini", "List", "prog"&$i,"")
        $between = StringSplit($precache,"|")
        $LSTprog[$i][0]=$between[0]
        $LSTprog[$i][1]=$between[1]
        $LSTprog[$i][2]=$between[2]
        $LSTprog[$i][3]=$between[3]
        $name[$i] = $LSTprog[$i][1]
        $pre = GUICtrlCreateTreeViewitem($LSTprog[$i][1],$TREE1)
        $LSTprog[$i][1] = GUICtrlCreateTreeViewitem("Start",$pre)
        GUICtrlSetImage($LSTprog[$i][1],"C:\AutoOS\Icons\blueico.ico")
        GuiCtrlSetOnEvent($LSTprog[$i][1],"_Start")
    Next
EndFunc

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites
zeroZshadow

all works perfect now, so i'll upload the latest version on the Auto-OS topic. be free to pm my about hosting ur script


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

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  

×