elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Ingresar Registrarse
11 Octubre 2008, 11:02  



+  Foro de elhacker.net
|-+  Programación
| |-+  Programación VB (Moderadores: ||MadAntrax||, E0N)
| | |-+  ayuda con 2 LISTAS
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Imprimir
Autor Tema: ayuda con 2 LISTAS  (Leído 73 veces)
forrestgump

Desconectado Desconectado

Mensajes: 5



Ver Perfil
ayuda con 2 LISTAS
« en: 04 Junio 2008, 22:25 »

El caso es  que cuando agrego nombres  a la lista   LIST2 y agregarlo a un archivo.TXT todo marcha muy bien pero  necesito que cuando regrese algun otro momento al FORM y vuelva a agregar mas nombres esten ahi los nombres agregados anteriormente asi que hice otra lista llamada LIST3 como un respaldo para que se agregue a LIST2 pero  al parecer mi problema son los INDEX.. como le puedo hacer ????

es este el codigo y desactive unas cosas porque estoy  atorado en esto...  ojo por favor  ayudenme  porfis..

 :-[



Private Sub Command1_Click()

'List2.AddItem List3


List2.AddItem Text1.Text                 'AGREGO A LA LISTA
'List3.AddItem Text1.Text
Text1.Text = ""                      'LIMPIO TEXTBOX
List2.AddItem List2
'List3.AddItem List3

If List2.ListIndex = -1 Then Exit Sub
List2.RemoveItem List2.ListIndex

'If List3.ListIndex = -1 Then Exit Sub
'List3.RemoveItem List3.ListIndex

Call GuardarArchivo
End Sub

Private Sub GuardarArchivo()

Dim i As Integer                                'AGREGO AL ARCHIVO NOMBRES1
Open "c:\malpica\nombres1.txt" For Output As #1
For i = 0 To List2.ListCount - 1
Print #1, List2.List(i)
Next i
Close #1

'Open "c:\malpica\nombres2.txt" For Output As #1  'AGREGO AL ARCHIVO NOMBRES2
'For i = 0 To List3.ListCount - 1
'Print #1, List3.List(i)
'Next i
'Close #1

End Sub

Private Sub Command2_Click()   ' BOTON PARA ORDENAR ALFABETICAMENTE
List1.Clear
For x = 0 To (List2.ListCount - 1)
    List1.AddItem List2.List(x)
Next
End Sub

Private Sub Command3_Click()    ' BOTON PARA ELIMINAR VARIOS
List2.RemoveItem List2.MultiSelect - 1

End Sub

Private Sub Command4_Click()     'BOOTON PARA MODIFICAR
List2.RemoveItem List2.ListIndex
List2.AddItem Text2.Text

End Sub

Private Sub Command5_Click()  ' BOTON PARA ELIMINAR UNO

List2.RemoveItem List2.ListIndex   'elimino de la lista2

Open "c:\malpica\nombres1.txt" For Output As #1 'elimino de archivo nombres1
For i = 0 To List2.ListCount - 1
Print #1, List2.List(i)
Next i
Close #1

List3.AddItem List2

'List3.RemoveItem List3.ListIndex   'elimino de la lista3
'Open "c:\malpica\nombres2.txt" For Output As #1   'elimino del archivo nombres2
'For i = 0 To List3.ListCount - 1
'Print #1, List3.List(i)
'Next i
'Close #1

End Sub

Private Sub Form_Load()

'Dim i As Integer
'Open "c:\malpica\nombres1.txt" For Output As #1
'For i = 0 To List3.ListCount - 1
'Print #1, List3.List(i)
'Next i
'Close #1
'List2.AddItem List3

End Sub

 
En línea
Páginas: [1] Ir Arriba Imprimir 
Ir a:  







Consolas     La Web de Goku     MilW0rm     MundoDivx

Hispabyte     Truzone     TodoReviews     ZonaPhotoshop

hard-h2o modding    Foros de ayuda    Yashira.org    Videojuegos    indetectables.net   

Noticias Informatica    Seguridad Informática    ADSL    Foros en español    eNYe Sec

Todas las webs afiliadas están libres de publicidad engañosa.

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
Free counter and web stats