Sign in to follow this  
Followers 0
strate

Anyway To Recreate This Loop?

4 posts in this topic

#1 ·  Posted (edited)

I'd give you the rest of the GUI but it would contain alot of useless stuff. I'd like to eliminate the If - EndIf and have just one line if possible.

Dim $Image[5]
$Image[1] = 'G:\Packaging\Labels\Sato8400\Production\unit\136041.prv'
$Image[2] = 'H:\Main Dump (Everything to be sorted out)\Labels\1190 unit label.prv'
$Image[3] = 'H:\Main Dump (Everything to be sorted out)\Labels\Jag Date Code Automation.prv'
$Image[4] = 'H:\Main Dump (Everything to be sorted out)\Labels\Bulk ESD.prv'

Dim $PI[5]
$Pic_W = @DesktopWidth/4-40
;~ $PI[1]=GUICtrlCreatePic($Image[1],30,500, $Pic_W,150)
;~ $PI[2]=GUICtrlCreatePic($Image[2],$Pic_W+60,500, $Pic_W,150)
;~ $PI[3]=GUICtrlCreatePic($Image[3],$Pic_W+$Pic_W+90,500, $Pic_W,150)
;~ $PI[4]=GUICtrlCreatePic($Image[4],$Pic_W+$Pic_W+$Pic_W+120,500, $Pic_W,150)
For $i = 1 To 4
    If $i = 1 Then
        $PI[$i]=GUICtrlCreatePic($Image[$i],30*$i,500, $Pic_W,150)
    Else
        $PI[$i]=GUICtrlCreatePic($Image[$i],$Pic_W * ($i - 1) + (30 * $i),500, $Pic_W,150)
    EndIf
Next

EDIT: I need the Controls evenly spaced out like the commented part shows.

Edited by strate

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

nvm

Edited by pecloe

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I'd give you the rest of the GUI but it would contain alot of useless stuff. I'd like to eliminate the If - EndIf and have just one line if possible.

Dim $Image[5]
$Image[1] = 'G:\Packaging\Labels\Sato8400\Production\unit\136041.prv'
$Image[2] = 'H:\Main Dump (Everything to be sorted out)\Labels\1190 unit label.prv'
$Image[3] = 'H:\Main Dump (Everything to be sorted out)\Labels\Jag Date Code Automation.prv'
$Image[4] = 'H:\Main Dump (Everything to be sorted out)\Labels\Bulk ESD.prv'

Dim $PI[5]
$Pic_W = @DesktopWidth/4-40
;~ $PI[1]=GUICtrlCreatePic($Image[1],30,500, $Pic_W,150)
;~ $PI[2]=GUICtrlCreatePic($Image[2],$Pic_W+60,500, $Pic_W,150)
;~ $PI[3]=GUICtrlCreatePic($Image[3],$Pic_W+$Pic_W+90,500, $Pic_W,150)
;~ $PI[4]=GUICtrlCreatePic($Image[4],$Pic_W+$Pic_W+$Pic_W+120,500, $Pic_W,150)
For $i = 1 To 4
    If $i = 1 Then
        $PI[$i]=GUICtrlCreatePic($Image[$i],30*$i,500, $Pic_W,150)
    Else
        $PI[$i]=GUICtrlCreatePic($Image[$i],$Pic_W * ($i - 1) + (30 * $i),500, $Pic_W,150)
    EndIf
Next

EDIT: I need the Controls evenly spaced out like the commented part shows.

How about:

Dim $PI[5]
$Pic_W = @DesktopWidth/4-40
For $i = 1 To 4
    $PI[$i]=GUICtrlCreatePic($Image[$i],$Pic_W * ($i - 1) + (30 * $i),500, $Pic_W,150)
Next

:think:

Edit: Didn't need that seperate line for $i = 1 anyway...

Edited by PsaltyDS

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

How about:

Dim $PI[5]
$Pic_W = @DesktopWidth/4-40
For $i = 1 To 4
    $PI[$i]=GUICtrlCreatePic($Image[$i],$Pic_W * ($i - 1) + (30 * $i),500, $Pic_W,150)
Next

:think:

Edit: Didn't need that seperate line for $i = 1 anyway...

Wow, that makes me feel like an idiot, thanks a ton.

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

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