Sign in to follow this  
Followers 0
icadea

array browser/input help

5 posts in this topic

#1 ·  Posted (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 by icadea

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 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

#3 ·  Posted (edited)

Thanks PsaltyDS. It works like a charm. Thank you also for showing me the For/Next using UBound in this example. :)

Edited by icadea

Share this post


Link to post
Share on other sites

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

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