Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/07/2009, 16:22
carlosanpy
 
Fecha de Ingreso: mayo-2009
Mensajes: 19
Antigüedad: 15 años
Puntos: 0
Abrir y editar un archivo txt

hola a todos

tengo el siguiente problema
en un archivo txt tengo alojados dos lineas de texto, la primera se refiere al nombre del tipo de moneda (ej: dolar), en la segunda el simbolo (ej: $)
deseo abrir ese archivo y a la vez poder editar para modificar esos datos
no logro corregir el error que esta en algun lugar del codigo
el codigo es el siguiente
Option Explicit
Dim intCtr As String
Dim IntNumAr As Integer
Dim IntVal As Integer
Dim str_Linea As String
Dim mivariable As String

Private Sub cmdAceptar_Click()
IntNumAr = FreeFile
Open App.Path & "\moneda.txt" For Output As #IntNumAr
intCtr = txtMoneda.Text
Print #IntNumAr, str_Linea
Print #IntNumAr, mivariable
Close #IntNumAr
cmdCancelar.Caption = "Salir"
End Sub

Private Sub Form_Load()
Dim Lineas As Long
IntNumAr = FreeFile
Open App.Path & "\moneda.txt" For Input As #IntNumAr
Do
Line Input #IntNumAr, str_Linea
Lineas = Lineas + 1
If Lineas = 1 Then
Line Input #1, mivariable
txtMoneda.Text = str_Linea
End If
Loop While Not EOF(IntNumAr)
txtSimbolo.Text = mivariable
Close #IntNumAr
End Sub


gracias!!!