Forum Discussion

Morgan's avatar
Morgan
Frequent Contributor
9 years ago

Type Mismatch Error

I'll preface this with "I'm sure I'm doing something dumb"....  ;)

 

I am just trying to feed in multiple variables from one script to another and am receiving a "Type Mismatch" error when I run RunMod below... They are in two different scripts but I have 'Useunit set up on both.

 

Sub RunMod

Join("EPA, EPB") <----- I'm not sure the quotes are correct but TC will only compile if in this format... 

End Sub

 

Sub Join(xMeth,yMeth)
Sys.Keys(xMeth)
Sys.Keys("[Enter]")
Sys.Keys(yMeth)

 

Thank you... 

Spoiler
 
  • In VBScript, to call procedures with multiple parameters, you need to use the Call keyword OR omit the parentheses around the parameter list:

     

    Call Join("a", "b")

    Join "a", "b"
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    In VBScript, to call procedures with multiple parameters, you need to use the Call keyword OR omit the parentheses around the parameter list:

     

    Call Join("a", "b")

    Join "a", "b"
    • Morgan's avatar
      Morgan
      Frequent Contributor

      *headsmack*  THANK YOU.  I don't usually work in VBscript.  

  • I wonder if you need:

     

    Join("EPA", "EPB")

     

    You may have missed some of the quotes looking at your code?

    • Morgan's avatar
      Morgan
      Frequent Contributor

      I tried that but it won't let me save - error on the line but no message when I hover over it.  :(