Forum Discussion

sastowe's avatar
sastowe
Super Contributor
14 years ago

table variables in TC 7.2

I want to use a table variable to store my expected results for later doing some comparison with.





  ' Populate the table variable based on the above values

  Project.Variables.SEC_VAL_0002_08_ExpectedResults.User_ID(0) = Project.Variables.LogonUser

  Project.Variables.SEC_VAL_0002_08_ExpectedResults.User_ID(1) = Project.Variables.LogonUser

  Project.Variables.SEC_VAL_0002_08_ExpectedResults.User_ID(2) = Project.Variables.LogonUser       

  Project.Variables.SEC_VAL_0002_08_ExpectedResults.User_ID(9) = Project.Variables.LogonUser

  For j = 3 to 7

    Project.Variables.SEC_VAL_0002_08_ExpectedResults.User_ID(j) = Project.Variables.NewUser

  Next





In the for loop, I get a type mismatch for the integer j. I can see in the debugger that it is type integer as are the literal values indicated above. This is where I am setting values. Later I need to be able to iterate in a for loop. What data type is expected here??

1 Reply

  • sastowe's avatar
    sastowe
    Super Contributor
    I figured it. I have to issue a cast right in the method call. Cast an integer to an integer... But whatever works.