Ver Mensaje Individual
  #15 (permalink)  
Antiguo 04/06/2008, 15:37
pradejon
 
Fecha de Ingreso: abril-2008
Mensajes: 20
Antigüedad: 16 años, 1 mes
Puntos: 0
Respuesta: Problemas con espacios para fichero txt

file = FreeFile

numcliente = 430000000 + cliente

vLen = GetLen(Round(baseimpo + iva, 2) & " D", Round(iva, 2) & " H", CDbl(baseimpo) & " H")
Open App.path & "\contable.txt" For Append As #file
Print #file, numcliente & "Factura " & "nº:" & bdempresa("ult_num_fac") & "/" & Right(Date, 2) & Right(String(vLen + 1, " ") & Round(baseimpo + iva, 2) & " D", vLen + 1)
Print #file, Tab(1), "477000000" & "Factura " & "nº:" & bdempresa("ult_num_fac") & "/" & Right(Date, 2) & Right(String(vLen + 1, " ") & Round(iva, 2) & " H", vLen + 1)
Print #file, Tab(1); "700000000" & "Factura " & "nº:" & bdempresa("ult_num_fac") & "/" & Right(Date, 2) & Right(String(vLen + 1, " ") & CDbl(baseimpo) & " H", vLen + 1)
Close #file




Function GetLen(ParamArray Text() As Variant) As Integer
Dim Looping As Integer
Dim vLen As Integer
For Looping = 0 To UBound(Text)
If Len(Text(Looping)) > vLen Then vLen = Len(Text(Looping))
Next Looping
GetLen = vLen
End Function