This post sort of covers what I wanted to know:
http://www.vbdotnetforums.com/showthread.php?t=13167&highlight=function
However, I was wondering it it's possible to get multiple returns of the same type. Heres the block of code that I wanted to use it on.
I'd like to get it to return 3 byte size chunks. Kind of like this non-working code here.
The idea is that when it's called it looks like this.
I don't think it's possible, but last time I thought that, DirectCast jumped in and kicked my precognitions.
http://www.vbdotnetforums.com/showthread.php?t=13167&highlight=function
However, I was wondering it it's possible to get multiple returns of the same type. Heres the block of code that I wanted to use it on.
VB.NET:
#Region " I'd like to make this a function "
Dim bytProcess1 As Byte = 0
Dim bytProcess2 As Byte = 0
Dim bytProcess3 As Byte = 0
Private Sub ByteProcess(ByVal Value As Long)
bytProcess3 = Value \ 65536
Value = Value - bytProcess3 * 65536
bytProcess2 = Value \ 256
Value = Value - bytProcess2 * 256
bytProcess1 = Value
End Sub
#End Region
I'd like to get it to return 3 byte size chunks. Kind of like this non-working code here.
VB.NET:
#Region " I'd like to make this a function "
'Dim bytProcess1 As Byte = 0
'Dim bytProcess2 As Byte = 0
'Dim bytProcess3 As Byte = 0
Private Function ByteProcess(ByVal Value As Long) as bytProcess1 ,bytProcess2 ,bytProcess3 as Byte
bytProcess3 = Value \ 65536
Value = Value - bytProcess3 * 65536
bytProcess2 = Value \ 256
Value = Value - bytProcess2 * 256
bytProcess1 = Value
End Sub
#End Region
The idea is that when it's called it looks like this.
VB.NET:
Call ByteProcess(Original.Text, Byte1.Text, Byte2.Text, Byte3.Text)
I don't think it's possible, but last time I thought that, DirectCast jumped in and kicked my precognitions.