print

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Ralf.

Why does the following unfinished programm print on one printer and
doesn't print on another:

;Program start
Structure 15Strings
String.s[15]
EndStructure
Verwendungszweck.15Strings

If OpenFile(1,"LPT1")
OpenConsole()
Print ("Bitte, Dateiname eingeben: ") ; Ask for Filename
FileName$=Input()

Dateiart$ = Right(FileName$,3)
PrintN("")
Print("Dateiart = ")
Print (Dateiart$)
PrintN("")


If Dateiart$ = "ube" Or Dateiart$ = "Ube" Or Dateiart$ = "UBE"
PrintN("Euroueberweisung ............")
Else
If Dateiart$ = "lae" Or Dateiart$ = "Lae" Or Dateiart$ = "LAE"
PrintN("Euro-Lastschrift ............")
Else
Print("Nicht uebliche Dateiart (.ube, .lae) : .")
Print (Dateiart$)
EndIf
EndIf

StringToFind$ = "B51000"

If ReadFile(0, FileName$)

PrintN("")
PrintN("Starting...")

While Eof (0) = 0
UseFile(0)

Text$ = ReadString()
WieOft=Len(Text$) ;Länge des

BLZ$ = Mid(Text$,7,8)
KontoNr$ = Mid(Text$,15,10)
Empfaenger$ = Mid(Text$,25,53)
Betrag$ = Mid(Text$,79,10)
Verwendungszweck$ = Mid(Text$,90,27) ;is variable until 125 digits
Bankverbindung$ = Mid(Text$,171,30) ;is at the end of the string - 30 digits

WieOft - 117;
WieOft / 27;

If WieOft > 15
PrintN("Das Feld ist groesser als erlaubt !! ")
PrintN("Erlaubte grösse : Max. 15 ")
PrintN("Ist-Groesse:"+Str(WieOft)):PrintN("")
PrintN("Es werden nur der ersten 15 Felder bearbeitet !!")
WieOft=15
EndIf

If WieOft = 0
PrintN("Kein Verwendungszweck angegebn !")
Verwendungszweck\String[1]="- =keine Angaben=-"
WieOft = 1
Else
temp=90;Struckture Verwendungszweck fuellen
For a=1 To WieOft
Verwendungszweck\String[a]=Mid(Text$,temp,27)
PrintN(Space(20)+Verwendungszweck\String[a])
temp + 27
Next
EndIf

FoundPos = FindString(Text$, StringToFind$, 1)

If FoundPos 0
;PrintN (Text$)
UseFile(1)
;print 2 pages as an example
;If OpenFile(1,"LPT1:")
WriteStringN ("")
WriteStringN ("----------------------------------------------------------------------")
WriteString ("Dateiname : ")
WriteStringN (FileName$)
WriteStringN ("----------------------------------------------------------------------")
WriteStringN ("")
WriteString ("Empfaenger : ")
WriteStringN (Empfaenger$)
WriteString ("Bankleitzahl : ")
WriteStringN (BLZ$)
WriteString ("Konto-Nr. : ")
WriteStringN (KontoNr$)
WriteStringN ("")
WriteString ("Betrag : ")
WriteStringN (Betrag$)
WriteStringN ("")
WriteStringN ("Verwendungszweck : ")
;WriteStringN (Verwendungszweck$)

For a=1 To WieOft
WriteStringN(Space(20)+Verwendungszweck\String[a])
Next
WriteStringN("")
WriteString ("Bankverbindung : ")
WriteStringN (Bankverbindung$)
WriteStringN (Chr(12))
UseFile (0)

EndIf
;OpenFile(1,"LPT1:")
; PrintN ("")
; Print ("Bankleitzahl : ")
; PrintN (BLZ$)
; Print ("Konto-Nr. : ")
; PrintN (KontoNr$)
; Print ("Empfaenger : ")
; PrintN (Empfaenger$)
; Print ("Betrag : ")
; PrintN (Betrag$)
; Print ("Verwendungszweck : ")
;PrintN (Verwendungszweck$)
;Print ("Bankverbindung : ")
;PrintN (Bankverbindung$)
;CloseFile(1)
;ENDif

Wend
CloseFile(0)
CloseFile(1)
PrintN("")
PrintN("Fertig !")

Temp$ = Input();
CloseConsole();
EndIf
End ; EndIf
Else
MessageRequester("Error","Cant open LPT ",0)
EndIf
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Ralf.

two different PC's with two different Printers.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
two different PC's with two different Printers.
What is with the OS? Are both the same? Which one is it?


Have a nice day...
Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Ralf.

one is WIndows NT 4.0 with a network printer with i have to capture as lpt1
and it works.
one is windows 98 with a parallel printer on lpt1 (Lexmark z11) and doesn't
work.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Shawn.
one is WIndows NT 4.0 with a network printer with i have to capture as lpt1
and it works.
one is windows 98 with a parallel printer on lpt1 (Lexmark z11) and doesn't
work.


Hi.

I think that the z11 is a GDI printer and doesn't understand ascii.

Sorry, I don't have a solution for you.

Shawn
Post Reply