Ver Mensaje Individual
  #9 (permalink)  
Antiguo 10/07/2009, 11:45
Avatar de FTech
FTech
 
Fecha de Ingreso: julio-2009
Mensajes: 88
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: Ayuda Como puedo Pasar Valores de texto a numero

Te dejo un ejemplo:

Código vb:
Ver original
  1. Private Sub Command1_Click()
  2. Dim a(4) As String
  3. Dim i As Integer
  4. Dim e As Boolean
  5. a(0) = "A"
  6. a(1) = "B"
  7. a(2) = "C"
  8. a(3) = "D"
  9. i = 0
  10. e = False
  11. While i < 4 And Not e
  12.     If a(i) = Text1.Text Then
  13.         e = True
  14.     End If
  15.     i = i + 1
  16. Wend
  17. If e Then
  18.     Label1.Caption = Label1.Caption & "Encontrado: " & Text1.Text & " =" & i
  19. End If
  20. End Sub
  21.  
  22. Private Sub Form_Load()
  23. Text1.Text = ""
  24. Label1.Caption = ""
  25. Command1.Caption = "Traducir"
  26. End Sub

Un saludo!