problema con if...then...else...end if
Publicado por scorpionhack (120 intervenciones) el 03/12/2005 21:22:11
Buenas kiero hacer un programa k kntiene dos variables , y dos textbox. Pero tengo un problema lo k kiero hacer esk si la variable primera (x1) es "chatcnt" y si el text 1 tiene algo ya vacio haga esto(Form2.chat.Text = Form2.chat + vbCrLf + "Remoto: " + x2) y si no esta vacio haga esto(chat = "Remoto: " + x2)
y si la primera variable(x1) es "log" y el text2 tiene algo escrito haga ( txtlog.Text = txtlog.Text + vbCrLf + x2) y si esta vacio haga(txtlog.Text = x2).
Yo ya h escrito el codigo pero debe tener algun error pork no me hace la funcion k deberia tener.
aqui os dejo el kodigo aer si me lo pueden mirar.
If x1 = "chatcnt" Then
If Form2.chat.Text <> "" Then
Form2.chat.Text = Form2.chat + vbCrLf + "Remoto: " + x2
Else
chat = "Remoto: " + x2
End If
If x1 = "log" Then
If Form2.chat.Text <> "" Then
txtlog.Text = txtlog.Text + vbCrLf + x2
Else
txtlog.Text = x2
End If
End If
End If
y si la primera variable(x1) es "log" y el text2 tiene algo escrito haga ( txtlog.Text = txtlog.Text + vbCrLf + x2) y si esta vacio haga(txtlog.Text = x2).
Yo ya h escrito el codigo pero debe tener algun error pork no me hace la funcion k deberia tener.
aqui os dejo el kodigo aer si me lo pueden mirar.
If x1 = "chatcnt" Then
If Form2.chat.Text <> "" Then
Form2.chat.Text = Form2.chat + vbCrLf + "Remoto: " + x2
Else
chat = "Remoto: " + x2
End If
If x1 = "log" Then
If Form2.chat.Text <> "" Then
txtlog.Text = txtlog.Text + vbCrLf + x2
Else
txtlog.Text = x2
End If
End If
End If
Valora esta pregunta


0