Visual Basic - Abrir y editar un archivo txt

Life is soft - evento anual de software empresarial
 
Vista:

Abrir y editar un archivo txt

Publicado por carlos (50 intervenciones) el 03/07/2009 12:57:04
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!!!
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