Calling a method that returns a boolean

Results 1 to 3 of 3

Thread: Calling a method that returns a boolean

  1. #1
    Erin Richason Guest

    Default Calling a method that returns a boolean

    I am trying to call a method on a COM object which returns a boolean but I keep getting type mismatch errors.<BR><BR>compNameNeeded = CBool(oPWGenEng.ProductNeedsComputerNames())<BR><B R>Any ideas?<BR><BR>Thanks, Erin

  2. #2
    Danny Novo Guest

    Default RE: Calling a method that returns a boolean

    Erin, my guess (and it is just a guess, I&#039m newish at this and yet have been frustrated when nobody answers my questions) is that your variable compNameNeeded is a Variant (a VBScript variable) of subtype String and the result of the CBool is a Variant of subtype Boolean. I&#039ve had this problem with trying to get two numbers to match, where one was an integer, and the other a long integer or something. Maybe try:<BR><BR>compNameNeeded = CStr(CBool(etc.))<BR><BR>and see if that works? Boolean values come out as True or False, right? So I imagine a CStr would produce a string of "True" or "False"... is that what compNameNeeded is, either "True" or "False"?<BR><BR>Hope this helps. If not, let me know. dnovo@canine.dentistry.uiowa.edu<BR><BR>Danny.

  3. #3
    Erin Richason Guest

    Default RE: Calling a method that returns a boolean

    Thanks very much for your response Danny but still no luck. I did try a bunch of other combinations but to no avail. If you have other ideas please let me know. <BR><BR>Thanks again, Erin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •