Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Gambas class file
- Public Struct dato
- texto As String
- minimo As Integer
- maximo As Integer
- End Struct
- Private listadatos As New Dato[]
- Public Sub add(tipovaloracion As String, valorminimo As Integer, valormaximo As Integer)
- Dim datotemp As New Dato
- datotemp.texto = tipovaloracion
- datotemp.minimo = valorminimo
- datotemp.maximo = valormaximo
- listadatos.Add(datotemp)
- End
- Public Function responder(numero As Integer) As String
- Dim datotmp As Dato
- For Each datotmp In listadatos
- If datotmp.minimo <= numero And datotmp.maximo > numero Then Return datotmp.texto
- Next
- Return "Error: el valor no se encuentra entre los intervalos reconocidos"
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement