Results 1 to 2 of 2

Thread: BYVAL question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    singapore
    Posts
    16

    BYVAL question

    Hi there everyone!
    My question is whats the difference between

    CopyMemory ByVal VarPtr(a), ByVal VarPtr(b), 100

    and

    CopyMemory VarPtr(a), VarPtr(b), 100

    They give different results.

    Also, how do you get the address of an array? Thank you!!

  2. #2
    Hyperactive Member SjR's Avatar
    Join Date
    Jul 2001
    Location
    Birmingham, UK
    Posts
    336
    Omitting ByVal means that the values are passed 'ByRef' as default.

    ByVal means that the values of the variables can be used but not changed within the sub or function (or at least if they are, I believe they are passed back as the original value).

    ByRef (default) means that the values of the variable can be changed in the sub or function and the altered value is passed back to the calling sub or function.

    Hope I've explained that OK

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