Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

VBScript collections accessor

I am analyzing some Excel VBA script and I want to turn it into a QV VBScript code.

First there is this method

'--------------------------------------------

Public Function cGetDomainClassification() As Collection

'--------------------------------------------

Dim DomainClassification(0 To 10) As String

Dim cDomainClassifications As New Collection

  DomainClassification(0) = "AT": DomainClassification(1) = "Base": DomainClassification(2) = "Platform": DomainClassification(3) = "Platform": DomainClassification(4) = "Base": cDomainClassifications.Add Key:="AT", Item:=DomainClassification

  DomainClassification(0) = "ATP": DomainClassification(1) = "Python": DomainClassification(2) = "Utilities": DomainClassification(3) = "Extensibility": DomainClassification(4) = "Extensibility": cDomainClassifications.Add Key:="ATP", Item:=DomainClassification

Set cGetDomainClassification = cDomainClassifications

   

End Function

Is it possible to use same syntax in QV macro ?

Second, I am using this method in this call:

Set cDomainClassifications = cGetDomainClassification()

           

        lI = 1

        Do

            sType = cDomainClassifications(lI)(0)

           ' do things

            lI = lI + 1

        Loop While ('some condition)

   

in line  sType = cDomainClassifications(lI)(0) is it correct that we look for the element (a list) of the collection with key II, and take the first element of this list ? Is it the same in QV VBScript ?