Jump to content

array browser/input help


icadea
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...