0

I am trying to use some array functions like UBound, LBound. But the script doesn't seem to recognize them. Please see the below code:

             TestArray = Split(sourcePath,"\")
             MsgBox "size is " & UBound(TestArray)

I get the message box without the size. the value of source path is the path of the folder selected. even if the path is hard coded the Ubound doesn't seem to respond. Please point me where I am missing things.

-Arch

aksarc
  • 13
  • 8
  • if the function is directly used like MsgBox ubound(TestArray) its working. If I assign or concatenate n MsgBox function its not working. – aksarc Jun 13 '13 at 08:30

1 Answers1

0

I just tested it in HP ALM 11.50 and it works perfectly. If this is an issue specific to your verion of QC/ALM then you could look for a patch.

Other workarounds could be:

  1. Converting the Ubound value to string first before concatenating.

    MsgBox "size is " & CStr(UBound(TestArray))
    
  2. Store the value in a variable and then MsgBox it.

    ArraySize = CStr(UBound(TestArray))
    MyMessage = "size is " & ArraySize
    MsgBox MyMessage 
    

These are not the best programming practices but I'd be interested to know if any of these workarounds resolve this strange behaviour.

All the best,

S

shreyansp
  • 723
  • 1
  • 7
  • 16