Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
435 views
by
edited by
I am getting below error while trying to use below code:

Function loadCursor(cursorID)
  Dim dDLL, dProc, lib
  If cursorID > UBound(global_cache) Then
    Call VarArrayRedim(global_cache, cursorID)
  End If
  If IsEmpty(global_cache(cursorID)) Then
    Set dDLL = DLL.DefineDLL("USER32")
    dProc = dDLL.DefineProc("LoadCursorW", vt_i4, vt_ui2, vt_i4)
    Set lib = DLL.Load("USER32.DLL", "USER32")
    global_cache(cursorID) = lib.LoadCursorW(0, cursorID)
  End If
  loadCursor = global_cache(cursorID)
End Function

Error message:

---------------------------
TestComplete
---------------------------
VBScript runtime error.

Type mismatch: 'UBound'

Error location:
Unit: "ProjectSuite1\Admin\Script\Common"
Line: 279 Column: 3.
---------------------------
OK  
---------------------------

1 Answer

0 like 0 dislike
by Expert (572 points)
 
Best answer
Have you defined and declared global_cache? Define it and it should resolve your problem.

Dim global_cache,new_expected_path,expected_path

global_cache = CreateVariantArray(0,32515)


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...