Visual Basic - duda

Life is soft - evento anual de software empresarial
 
Vista:

duda

Publicado por andrea (1 intervención) el 23/02/2005 22:46:51
si en un texbox tengo este texto
33:66:90 utiliznafo len,ints algien me puede dividir 33,66,90 y guardarlos en 3 textos,nose si me espliko
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:duda

Publicado por ChaRLinux (60 intervenciones) el 24/02/2005 00:08:25
mira pon esto y si te funciona
pon 4 textbox y un boton
Private Sub Command1_Click()
Text2.Text = Left$(Val(Text1.Text), 2)
Text3.Text = Left$(Text1.Text, 5)
Text3.Text = Right(Text3.Text, 2)
Text4.Text = Right(Text1.Text, 5)
Text4.Text = Right(Text4.Text, 2)
End Sub
espero te sirva
ChaRLinux Corporation
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:duda

Publicado por Benjo (679 intervenciones) el 24/02/2005 02:03:24
Andrea, no se porque sería importante hacerlo con len() e instr(), pero si ello no fuera condiconal, la instrucción split(...), sería más conveneniente

Private Sub Command2_Click()
Dim divfrase
Dim tutexto As String
tutexto = "30:12:90"
'Sólo con esta función hacés la separaciónde los valores, lo demás es de muestra
divfrase = Split(tutexto, ":")

Debug.Print divfrase(0)
Debug.Print divfrase(1)
Debug.Print divfrase(2)

End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar