Forum Discussion

ArmandsBruns's avatar
ArmandsBruns
Frequent Contributor
13 years ago
Solved

Project.Variables.var as Array

Hi, Maybe someone will know. Is it possible such a method -> Project.Variables.var=Array regards Armands
  • ebodien's avatar
    13 years ago
    I've done something of this sort using the ProjectSuite.Variable so I see no reason it shouldn't work as a Project.Variable.

    1) Add ODT to the project

    2) Define the ProjectSuite.Variable as an Object



    Test code, read local array to Project.Variable



    sub testArray

      Dim myArray(3)

      for i = 0 to 3

        myArray(i) = i + 10

      Next

     

      for k = 0 to ubound(myArray)

        log.message(myArray(k))

      Next



      Project.Variables.Var1 = ODT.Classes.NewArray()

     

      for l = 0 to ubound(myArray)

        Project.Variables.Var1.AddItem(myArray(l))

      Next



      for j = 0 to ubound(myArray)

        log.Message(Project.Variables.Var1.Items(j).value)

      Next



    End Sub



    I hope this will help.