Skip to content

Possible bug in "FOR EACH item IN list" loop ? #594

@juan-nxlevel

Description

@juan-nxlevel

Dear ClearScript,

I have this VBS:
dim allPages
set allPages = page.getElementsByTagName("page[@Listed='true']")
Console.Log "Count: " & allPages.length
for each p in allPages
Console.Write p.toString()
next

Which results in this:

"Count: 41"
"Error: The object is not enumerable"

Note that the "page" object was instantiated via CreateObject("Microsoft.XMLDOM") with 41 nodes, so it's not a .NET object that inherited Enumerable. It appears that your FOR EACH x IN y cannot handle lists/objects that came from vbs? Is this something you need to implement or perhaps is there a switch to allow the "for each" loops for this type of lists to work?

Thanks any advice!

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions