On May 23, 2006, at 10:52 AM, Norman Palardy wrote:
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.
OK - I'm being dense. The Byref is in the VirusScan method
definition. How do I get the VirusScan method to operate on one
element of the ScanQueue array? So are you saying that since
ScanQueue is an array of objects, I can just setup VirusScan without
Byref in the method definition and it will work like I want?
--
Chris Jett
[EMAIL PROTECTED]
_______________________________________________
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>