Página 1 de 1

AddBytes Function

Publicado: 14 Feb 2013, 18:39
por Pink
Bueno les dejo esta función que acabo de hacer nada del otro mundo.
muy cortita y comoda. ahí el flag por defecto false para agregar bytes y si la ponen true agrega kb.
'---------------------------------------------
' Addbytes
' Autor: Pink
' Fecha: 14-02-2013
' Propósito: Agregar bytes a archivos
' Uso : Call AddBytes("C:\Users\CENTRAL\Desktop\1.txt", 1)
'---------------------------------------------


Private Function AddBytes(FilePath As String, NBytes As Long, Optional kb As Long = False)
If kb = True Then kb = 1024 Else kb = 1
Open FilePath For Binary As #1
Put #1, LOF(1) + NBytes * kb, CByte(&H0)
Close #1
End Function

saludos

Re: AddBytes Function

Publicado: 15 Feb 2013, 02:57
por potozilandia
Excelente, gracias por compartir, pink !