M
Miro
Hi,
(vb.net vs2008)
I understand the significance between memory pointers with a function using
byVal and byRef.
However I have code that I want to do something like this:
Dim UsMailmsg As MailMessage = EmailOrderClass.createEmailOrder(False,
cartOrderID)
For nI As Integer = 0 To SendToEmailAddresses.Count - 1
EmailOrderClass.sendEmailOrder(CustomerAddress,
ToEmailAddress, UsMailmsg) <------- this line
Now When I am using the UsMailmsg, even though the function is specified as
"byVal" it will always pass in as a reference to a memory pointer.
How do I pass it in as a 'Direct Copy' of the variable.
So basically I can create an 'orig' version of the UsMailmsg, then it passes
a copy of it into a function where that function changes parameters left and
right.
But on the next "for next loop" it will send in the orig for the next run of
something else.
Hope that makes sense.
Thanks,
Miro
(vb.net vs2008)
I understand the significance between memory pointers with a function using
byVal and byRef.
However I have code that I want to do something like this:
Dim UsMailmsg As MailMessage = EmailOrderClass.createEmailOrder(False,
cartOrderID)
For nI As Integer = 0 To SendToEmailAddresses.Count - 1
EmailOrderClass.sendEmailOrder(CustomerAddress,
ToEmailAddress, UsMailmsg) <------- this line
Now When I am using the UsMailmsg, even though the function is specified as
"byVal" it will always pass in as a reference to a memory pointer.
How do I pass it in as a 'Direct Copy' of the variable.
So basically I can create an 'orig' version of the UsMailmsg, then it passes
a copy of it into a function where that function changes parameters left and
right.
But on the next "for next loop" it will send in the orig for the next run of
something else.
Hope that makes sense.
Thanks,
Miro