Let's say I have a variables from name1 to name6 and they are keeping file names. And I have a different code with different labels to download them, like download1 to download 6. To download all I do gosub download for each file, file 2 should be latest as it always biggest.
Code: Select all
Gui, Add, Button, -Wrap Default w100 h30 gDownload1, Download file 1
Gui, Add, Button, -Wrap Default w100 h30 gDownload2, Download file 2
Gui, Add, Button, -Wrap Default w100 h30 gDownload3, Download file 3
Gui, Add, Button, -Wrap Default w100 h30 gDownload4, Download file 4
Gui, Add, Button, -Wrap Default w100 h30 gDownload5, Download file 5
Gui, Add, Button, -Wrap Default w100 h30 gDownload6, Download file 6
Gui, Add, Button, -Wrap Default w100 h30 gDownloadall, Download all
Gui, Show, w200 h300, Some junk
name1 = filename1
name2 = filename1
name3 = filename1
name4 = filename4
name5 = filename5
name6 = filename6
return
download1:
Currentname = %name1%
goto, downloader
download2:
Currentname = %name2%
goto, downloader
download3:
Currentname = %name3%
goto, downloader
download4:
Currentname = %name4%
goto, downloader
download5:
Currentname = %name5%
goto, downloader
download6:
Currentname = %name6%
goto, downloader
downloader:
msgbox, Downloading %currentname%!
return
downloadall:
gosub, download1
gosub, download3
gosub, download4
gosub, download5
gosub, download6
gosub, download2 ;should be latest as it almost always the biggest file
GuiClose:
ExitApp
1) Sometimes there could be same files in different positions, how could I compare them all between each other and then skip duplicates without a lot of if name1 = %name2%, etc.?
2) Could I optimise somehow this download1 - download6 section, because only difference between them is in the numbers? Loop would not work as I am assigning variable there.