Sub CheckVehicle(code As String) As Boolean
' try to match the input code to a registration number
If VehicleList.IsInitialized Then
For Each V As Vehicle In VehicleList
' see if we have a match
If V.RegistrationNumber.ToUpperCase = code.ToUpperCase Then
' match found
Return True
End If
Next
End If
' no match found so fail the method
Return False
End Sub