icadea Posted February 28, 2008 Share Posted February 28, 2008 (edited) Hi all, I have around 3000 lines of verse which i have included into an array as per the code below. What i would like to know is the command that is needed to be used for [1]go forward and backward on the array 1 line at a time. I do not know how to use For next command which involves array [2]user can type in the verse number 1 in the input box and it will bring the array $avArray[1] and so on At the moment i'm doing manually as per the command below due to its dependancy on fonts $font = "trens" GUICtrlSetFont($myedit, 20, 400, "", $font) GUICtrlSetData($myedit,avArray[500]) Edited February 28, 2008 by icadea Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 28, 2008 Share Posted February 28, 2008 (edited) Hi all, I have around 3000 lines of verse which i have included into an array as per the code below. What i would like to know is the command that is needed to be used for [1]go forward and backward on the array 1 line at a time. I do not know how to use For next command which involves array [2]user can type in the verse number 1 in the input box and it will bring the array $avArray[1] and so on At the moment i'm doing manually as per the command below due to its dependancy on fonts Is this what you mean? ; Read verses forward For $iLine = 1 To UBound($avArray) - 1 GUICtrlSetData($myedit, $avArray[$iLine]) Sleep(1500) ; 1.5 sec delay to read each line Next ; Read verses in reverse For $iLine = UBound($avArray) - 1 To 1 Step -1 GUICtrlSetData($myedit, $avArray[$iLine]) Sleep(1500) ; 1.5 sec delay to read each line Next ; Read verses forward from variable start an stop points $iStart = 100 $iStop = 200 For $iLine = $iStart To $iStop GUICtrlSetData($myedit, $avArray[$iLine]) Sleep(1500) ; 1.5 sec delay to read each line Next Edit: Added missing step index to reverse For/Next loop Edited February 28, 2008 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 Link to comment Share on other sites More sharing options...
icadea Posted February 29, 2008 Author Share Posted February 29, 2008 (edited) Thanks PsaltyDS. It works like a charm. Thank you also for showing me the For/Next using UBound in this example. Edited February 29, 2008 by icadea Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 29, 2008 Share Posted February 29, 2008 Thanks PsaltyDS. It works like a charm. Thank you also for showing me the For/Next using UBound in this example. You're welcome... and you owe me a cookie... 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 More sharing options...
icadea Posted March 1, 2008 Author Share Posted March 1, 2008 i'll need to check on the cookie giving . Thanks again 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