Visual Basic - Archivo txt = variable string

Life is soft - evento anual de software empresarial
 
Vista:

Archivo txt = variable string

Publicado por Juan (5 intervenciones) el 27/02/2002 19:55:34
Alguien sabe como sacar el contenido de un archivo txt a una variable de tipo cadena.

Gracias por su ayuda !!!!

ATTE: Juan
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:Archivo txt = variable string

Publicado por burkan (13 intervenciones) el 28/02/2002 05:50:51
sabes que las variables de tipo String puede contener hasta 2^31 caracteres
************************************************************************
\'declaramos la variable
dim strVariable as string
dim NumFichero as Integer
NumFichero = freefile
\'abrimos el archivo .txt para lectura
OPEN nombreFichero.txt FOR Input As freefile
\'asignamos a la variable el contenido del archivo
strVariable =Input(LOF(1), #NumFichero)
\'Cerramos el archivo
Close NumFichero
*******************************************************************
¡ojo! el tamaño del archivo debe ser menos de 64K

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:Archivo txt = variable string

Publicado por burkan (13 intervenciones) el 28/02/2002 05:50:58
sabes que las variables de tipo String puede contener hasta 2^31 caracteres
************************************************************************
'declaramos la variable
dim strVariable as string
dim NumFichero as Integer
NumFichero = freefile
\'abrimos el archivo .txt para lectura
OPEN nombreFichero.txt FOR Input As freefile
\'asignamos a la variable el contenido del archivo
strVariable =Input(LOF(1), #NumFichero)
\'Cerramos el archivo
Close NumFichero
*******************************************************************
¡ojo! el tamaño del archivo debe ser menos de 64K

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