Results 1 to 2 of 2

Thread: ByVal and ByRef

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Location
    y
    Posts
    141
    Hi My Friends

    I have a big big Problem .

    In ASP page i have ..CreatObject(Dllname )..

    In VB I have function
    private Function ppSet(InputMap As Map, OutputMap As Map) As Boolean

    When i try that its fail i got TYPE MISMATCH

    But if i change it to rivate Function ppSet(ByValInputMap As Map,ByVal OutputMap As Map) As Boolean ...its work ...

    Why whaen i use ByRef its fail and when im use ByVal its work..
    What the difference ? (In Object)

    Thnsk
    Efrat


  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    It's not because of ByRef or ByVal, but because of the parameter type. In VBScript, everything is VARIANT, so before you send the parameter, you have to convert it to a specific data type. In your case (I assume) you have a User Defined Type that works as a parameter and that's what causing the problem. Also, bare in mind that VBScript doesn't support User Defined Types.

    The reason it works with ByVal is because DLL is working with the parameter that is not a reference, therefore, it treats it as a local variable (well sort of).

    [Edited by Serge on 11-13-2000 at 10:09 AM]

Posting Permissions

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



Click Here to Expand Forum to Full Width