Visual Basic - CODIGOS DE BARRA

Life is soft - evento anual de software empresarial
 
Vista:

CODIGOS DE BARRA

Publicado por JULIOESCOBAR (98 intervenciones) el 01/01/2005 03:11:18
AL ESCANER CON EL CODIGO DE BARRAS ME LO PASA A UN TEXTBOX, COMO LO GUARDO EN ALGUN ARCHIVO QUE SEA EN .TXT ??? Y/O COMO LE HAGO PARA QUE ME SEPARA ESTE CODIGO POR CAMPOS ??, SI TIENEN ALGUNA DIRECCION EN DONDE PUEDA OBTENER CODIGOS FUENTES O EJEMPLOS SE LOS AGRADECERE...SALUDOS.....JULIO C. ESCOBAR
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:CODIGOS DE BARRA

Publicado por Cecilia Colalongo (3116 intervenciones) el 01/01/2005 13:56:52
Para guardar el código de barras en un archivo TXT puedes hacer:

StringToFile Text1.Text,"MiArchivo.txt"

Public Function StringToFile(StringText As String, FileName As String) As Long
Dim hlngFile As Long

hlngFile = FreeFile

Open FileName For Binary Access Write As hlngFile

Put hlngFile, , StringText

Close hlngFile

StringToFile = FileLen(FileName)

End Function

Y para el proceso inverso:

Text1.Text=FileToString("MiArchivo.txt")

Public Function FileToString(FileName As String) As String
Dim hlngFile As Long, strFile As String

hlngFile = FreeFile

Open FileName For Binary Access Read As hlngFile

FileToString = vbNullString

strFile = String(FileLen(FileName), " ")

Get hlngFile, , strFile

Close hlngFile

FileToString = strFile

End Function

La separación por campos -desconozco la estructura porque no la mencionas- la haces como con cualquier String con las funciones de VB.
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