Hello everyone,
I have a function that returns boolean when I can it. In some cases I want to return a byte too. So I declared a structure like that
Public Structure DblOutInfos
Dim i As Byte
Dim played As Boolean
End Structure
And my function is like that
Public Function SetPcChckr2ExcludedGate(ByVal Rd As Integer, ByRef chckr As Checker) As DblOutInfos
Dim DblOutInfos As New DblOutInfos
.
.
.
return DblOutInfos
My problem is that in some cases when I call the function I want to return only the boolean type and in some others I want to return DblOutInfos. Is there a way to declare the function so that to return even the one type (boolean) even the other (DblOutInfos) similtaneously and how can I do that?
I mean something like that:
Dim DblPl, Played as boolean
if DblPl then Played = SetPcChckr2ExcludedGate(rd, chckr)
if DblPl = False then DblOutInfos = SetPcChckr2ExcludedGate(rd, chckr)
Any help will be much appreciated. Thank you so much in advanced.
I have a function that returns boolean when I can it. In some cases I want to return a byte too. So I declared a structure like that
Public Structure DblOutInfos
Dim i As Byte
Dim played As Boolean
End Structure
And my function is like that
Public Function SetPcChckr2ExcludedGate(ByVal Rd As Integer, ByRef chckr As Checker) As DblOutInfos
Dim DblOutInfos As New DblOutInfos
.
.
.
return DblOutInfos
My problem is that in some cases when I call the function I want to return only the boolean type and in some others I want to return DblOutInfos. Is there a way to declare the function so that to return even the one type (boolean) even the other (DblOutInfos) similtaneously and how can I do that?
I mean something like that:
Dim DblPl, Played as boolean
if DblPl then Played = SetPcChckr2ExcludedGate(rd, chckr)
if DblPl = False then DblOutInfos = SetPcChckr2ExcludedGate(rd, chckr)
Any help will be much appreciated. Thank you so much in advanced.