VB collections as LotusScript collections

This sample will go ok using VB's For Each statement).  Why does LotusScript return error: Not a collection object !?

Dim coll As Variant
Set coll = CreateObject( "Scripting.Dictionary" )
     
coll.Add "a",1
coll.Add "b",2
     
Forall x In coll
  Print x
End Forall
LVL 3
GunsenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ArunkumarCommented:
Try Forall x in coll.Values

-Arun.
0
ZvonkoSystems architectCommented:
Try this:


Sub Click(Source As Button)
     Dim coll As Variant
     Set coll = CreateObject( "Scripting.Dictionary" )
     
     coll.Add "a",1
     coll.Add "b",2
     
     Forall x In coll.Items()
          Print x
     End Forall
     Forall x In coll.Keys()
          Print x
     End Forall
End Sub

Good luck,
Zvonko

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GunsenAuthor Commented:
Forgot the ()  :(
Thx :)
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

GunsenAuthor Commented:
BTW: Do you know why the Forall wont enumerate coll ?

Forall x In coll
0
ArunkumarCommented:
Good one Zvo. I just wanted to post some comments to see how this question goes...

Hee Hee Hee !

:-)
Arun.
0
ZvonkoSystems architectCommented:
At the moment I get no notifications from EE. I just sow on the ranking that you granted me points :-)

So the answer to this coll question is: you defined coll as an Object. This object does have several properties and methods.
The methods Keys() and Items() yield enumeration of values.

Good luck,
Zvonko

0
GunsenAuthor Commented:
Me neither, and nice answer.
The methods get the job done.
But, why dont the Forall do the job ?
I cant figure out, seems to me that LS or the Domino client is forcing me to use other (unknow to me) libraries for accessing COM/OLE object /s*uck) ...
0
GunsenAuthor Commented:
Arun ur in the mood i guess, cheers!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.