On May 23, 2006, at 9:47 AM, Chris Jett wrote:
Let me see if I can break down this Byref issue I'm having as
simply as possible.
I have an array called ScanQueue. This is an array of a custom
class named "Message" which has a FolderItem property called
MessageFile. I have a method (called VirusScan) that I want to
pass the first element of the array to Byref so that it operates on
that element of the array directly. The VirusScan method returns
true if the Message object it was passed is not infected with a
virus, but it also needs to change some properties of the Message
object it is passed.
Here's my code where I get an error on compile:
if VirusScan(ScanQueue(0)) then
ScanQueue(0).MessageFile.MoveFileTo IncomingMailFolder
ScanQueue.Remove(0)
else
Here's the error message I get on compile: "You can't pass an
expression as a parameter that is defined as ByRef."
Um... OK. Why not?
Because ... you never could
And FWIW you do not need to pass an Object reference by ref
Just change the byref in ScanQueue and it will work
What you have in ScanQueue is an object reference, not an object.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>