Advertisement
jsbsan

persona

Nov 2nd, 2013
1,737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 1.09 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Property nombre As String
  4. Private hnombre As String
  5.  
  6. Property SueldoMensual As String
  7. Private hsueldoMensual As Single
  8.  
  9. '------------------- lectura y escritura de valores de propiedades -------------
  10. Private Function nombre_Read() As String
  11.  
  12.   Return hnombre
  13.  
  14. End
  15.  
  16. Private Sub nombre_Write(Value As String)
  17.  
  18.   hnombre = value
  19.  
  20. End
  21.  
  22. Private Function SueldoMensual_Read() As String
  23.  
  24.   Return hsueldoMensual
  25.  
  26. End
  27.  
  28. Private Sub SueldoMensual_Write(Value As String)
  29.  
  30.   hsueldoMensual = value
  31.  
  32. End
  33.  
  34. '------------------- Metodos -------------
  35.  
  36. Public Sub Consultar()
  37.  
  38.   Print "Consultar datos...."
  39.   Print "Nombre: " & hnombre
  40.   Print "Sueldo: "; sueldo()
  41.   Print "----------------------------"
  42.  
  43. End
  44.  
  45. Public Function Sueldo() As String
  46.  
  47.   Return "El sueldo de una persona es de " & Str$(hsueldoMensual) & " €."
  48.  
  49. End
  50.  
  51. Public Sub Registrar(nombre As String, sueldo As Single, Optional valor1 As Variant, Optional valor2 As Variant) 'nombre As String, sueldo As Single)
  52.  
  53.   hnombre = nombre
  54.   hsueldoMensual = sueldo
  55.  
  56. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement