با اجازه استاد من یه مثال ساده از type نوشتم :


Type sp

x As Integer
y As String
z As Boolean


End Type


Function sl(a As Integer, b As Integer, c As String) As sp

sl.x = a - b
If a > b Then
sl.z = True
sl.y = c & ": is true"
ElseIf a < b Then
sl.z = False
sl.y = c & ": is false"
Else
sl.z = zero
sl.y = c & ":is zero"
End If

End Function
w=sl(5,3,"result").x '2

v=sl(5,3,"result").y 'result: is true

u= sl(5,3,"result").z 'True