Function calcula_header(ByVal texto As String, ByVal longbytes As Integer, ByVal confir As Boolean) As Byte
Try
Dim byteconst As Byte = Nothing
byteconst = Convert.ToByte(CDec(0))
If confir Then
byteconst = Convert.ToByte(CDec(64))
End If
Dim longitud As Decimal = 0
longitud = texto.Length + longbytes
Dim bytelong As Byte = 0
bytelong = Convert.ToByte(longitud)
calcula_header = byteconst Or bytelong
Catch ex As Exception
Errores(ex.Message & " " & ex.StackTrace)
End Try
End Function