Conversor de Numeros Romanos

Otro Programilla made in Nino para el personal, el conversor que hice en visual basic version 6 y version 10 ahora lo traigo en Gambas para ubuntu, que me sobra el tiempo libre...

CARCASA

 y para que no os canseis tambien os dejo el codigo, pero ya sabeis, si sois tan señoritos que ni siquiera los escribis, cuidado con el copu/paste que cambia las comillas, en fin, ya sois grandes...

CODIGO:

' Gambas class file
PUBLIC SUB btnSalir_Click()
    DIM mensaje AS String
 
    mensaje = Message.Warning("¿Seguro que quieres salir?", "Si", "No", "Cancelar")
    IF mensaje = 1 THEN
      Message.Info("Gracias por usar mi segundo programa en gambas", "Aceptar")
      ME.Close
    ELSE
      Message.Info("Tas tonta", "Aceptar")
    END IF
  END
PUBLIC SUB btnTransformador_Click()
    DIM num, col AS Integer
   
      Label3.Caption = ""
      TextBox1.SetFocus
      'num = Val(TextBox1.Text) aqui no se puede asignar el valor a la variable
     
      col = 15
      IF IsNumber(Val(TextBox1.Text)) = FALSE THEN
         Message.Info("Debe ser un numero del 1 al 5000", "Aceptar")
         ME.Close
      ELSE
      num = Val(TextBox1.Text) 'mucho cuidado, esta linea debe ir aqui
      WHILE num >= 1000
         Label3.Caption = Label3.Caption & "M"
               num = num - 1000
               col = col + 1
      WEND
      WHILE num >= 900
              Label3.Caption = Label3.Caption & "CM"
              num = num - 900
              col = col + 2
      WEND
      WHILE num >= 500
             Label3.Caption = Label3.Caption & "D"
             num = num - 500
             col = col + 1
      WEND
      WHILE num >= 100
            Label3.Caption = Label3.Caption & "C"
            num = num - 100
            col = col + 1
      WEND
      WHILE num >= 90
           Label3.Caption = Label3.Caption & "XC"
           num = num - 90
           col = col + 2
      WEND
      WHILE num >= 50
           Label3.Caption = Label3.Caption & "L"
           num = num - 50
           col = col + 1
      WEND
      WHILE num >= 40
          Label3.Caption = Label3.Caption & "XL"
          num = num - 40
          col = col + 2
      WEND
      WHILE num >= 10
          Label3.Caption = Label3.Caption & "X"
          num = num - 10
          col = col + 1
      WEND
      WHILE num >= 9
          Label3.Caption = Label3.Caption & "IX"
          num = num - 9
          col = col + 2
      WEND
      WHILE num >= 5
          Label3.Caption = Label3.Caption & "V"
          num = num - 5
          col = col + 1
      WEND
      WHILE num >= 4
          Label3.Caption = Label3.Caption & "IV"
          num = num - 4
          col = col + 2
      WEND
      WHILE num > 0
          Label3.Caption = Label3.Caption & "I"
          num = num - 1
          col = col + 1
      WEND
      END IF
END
PUBLIC SUB opc_rojo_Click()
  FMain.BackColor = &C10A41&
  TextBox1.BackColor = &062805&
  TextBox1.ForeColor = &EBE7E9&
END
PUBLIC SUB opc_azul_Click()
  FMain.Refresh
  FMain.BackColor = &1C33FF&
END
PUBLIC SUB opc_verde_Click()
  FMain.BackColor = &1FBF19&
END
 

Queridos seguidores, voy a seguir con mis cosillas, me voy a poner un poquito de Eric Clapton y algo de Kansas y a crear programillas. Me acabo de acordar de la calculadora que hice en visual y voy a ver si es muy dificil hacerla en gambas... ya os dire.

No hay comentarios: