hardwarepower Posted January 23, 2011 Share Posted January 23, 2011 I am trying to write a script the switches moves text up and down like shown below with just running the script and have it loop back after switch 4 ==switch 1== [button] [button_1] [button_2] [button_3] ==switch 2== [button_1] [button] [button_2] [button_3] ==switch 3== [button_1] [button_2] [button] [button_3] ==switch 4== [button_1] [button_2] [button_3] [button] Link to comment Share on other sites More sharing options...
taietel Posted January 23, 2011 Share Posted January 23, 2011 Something like this? #include <Array.au3> Global $aArr[4]=["button","button_1","button_2","button_3"] _ArrayDisplay($aArr) For $i=0 To 3 $sTest=_Array_Rotate($aArr,1) _ArrayDisplay($sTest) Next Func _Array_Rotate(ByRef $aArray, $iRotate=0) ;0 - rotate right ;1 - rotate left Local $aTmp=$aArray Switch $iRotate Case 0 Local $x=$aTmp[0] For $i=0 To UBound($aArray)-2 $aTmp[$i]=$aArray[$i+1] Next $aTmp[UBound($aArray)-1]=$aArray[0] $x="" $aArray=$aTmp Case 1 Local $x=$aTmp[UBound($aArray)-1] For $i=1 To UBound($aArray)-1 $aTmp[$i]=$aArray[$i-1] Next $aTmp[0]=$x $x="" $aArray=$aTmp EndSwitch Return $aArray EndFunc Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
czardas Posted January 23, 2011 Share Posted January 23, 2011 The first function in my modal.au3 UDF also will do this: operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now