Jump to content

For..In..Next


Recommended Posts

... This functionality is also stated in wiki under Loops, section "For Each"

In short, I cannot get this to work, with either the example listed in the wiki, or the one listed in the online help file. Listed below is the example from the help file:

;Using an Array
Dim $aArray[4]

$aArray[0]="a"
$aArray[1]=0
$aArray[2]=1.3434
$aArray[3]="test"

$string = ""
FOR $element IN $aArray
    $string = $string & $element & @CRLF
NEXT

Msgbox(0,"For..IN Arraytest","Result is: " & @CRLF & $string)

Each time you run the code in this example, the interpreter halts at:

FOR $element IN $aArray

FOR $element ^ ERROR

Is iterating over Objects and Arrays in this manner not or no longer supported?
Link to comment
Share on other sites

That example worked just fine for me....running 3.2.12.1 under SciTE

Posted Image

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

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...