Posted: Thu Dec 13, 2001 10:04 pm
Restored from previous forum. Originally posted by Ralf.
Finally i got it to work to find text and print it.
But now i still have some questions:
1.) how can i print each line that starts with B51000 on a separat page ?
2.) how can i print everything that comes before B51000 as a header on each page ?
3.) and last how can i print the item "Verwendungszweck" (it is a variable text
field and it can be from 1 * 27 alphanumeric positions to 15 * 27 alphanumeric
positions. If it is only once 27 alphanumeric pos. the next item "Bankverbindung" comes after it. When it's 2 * 27 pos. long the item "
Bankverbindung: " comes behind it. and so on until 15 * 27 positions.
That's the program i have until now:
f OpenFile(1,"LPT1:")
OpenConsole()
Print ("Bitte, Dateiname eingeben: ") ; Ask for Filename
FileName$=Input()
StringToFind$ = "B51000"
If ReadFile(0, FileName$)
PrintN("")
PrintN("Starting...")
While Eof (0) = 0
UseFile(0)
Text$ = ReadString()
BLZ$ = Mid(Text$,7,8)
KontoNr$ = Mid(Text$,15,10)
Empfaenger$ = Mid(Text$,25,53)
Betrag$ = Mid(Text$,79,10)
Verwendungszweck$ = Mid(Text$,90,60) ;is variable 27 until 15*27 positions
Bankverbindung$ = Right(Text$,30) ;is at the end of the string : 30 positions
FoundPos = FindString(Text$, StringToFind$, 1)
If FoundPos 0
UseFile(1)
WriteStringN ("")
WriteStringN ("----------------------------------------")
WriteString ("Dateiname : ")
WriteStringN (FileName$)
WriteStringN ("----------------------------------------")
WriteStringN ("")
WriteString ("Bankleitzahl : ")
WriteStringN (BLZ$)
WriteString ("Konto-Nr. : ")
WriteStringN (KontoNr$)
WriteString ("Empfaenger : ")
WriteStringN (Empfaenger$)
WriteString ("Betrag : ")
WriteStringN (Betrag$)
WriteString ("Verwendungszweck : ")
WriteStringN (Verwendungszweck$)
WriteString ("Bankverbindung : ")
WriteStringN (Bankverbindung$)
UseFile (0)
EndIf
Wend
CloseFile(0)
CloseFile(1)
PrintN("")
PrintN("Fertig !")
Temp$ = Input();
CloseConsole();
EndIf
End
Else
MessageRequester("Error","Cant open LPT ",0)
EndIf
Finally i got it to work to find text and print it.
But now i still have some questions:
1.) how can i print each line that starts with B51000 on a separat page ?
2.) how can i print everything that comes before B51000 as a header on each page ?
3.) and last how can i print the item "Verwendungszweck" (it is a variable text
field and it can be from 1 * 27 alphanumeric positions to 15 * 27 alphanumeric
positions. If it is only once 27 alphanumeric pos. the next item "Bankverbindung" comes after it. When it's 2 * 27 pos. long the item "
Bankverbindung: " comes behind it. and so on until 15 * 27 positions.
That's the program i have until now:
f OpenFile(1,"LPT1:")
OpenConsole()
Print ("Bitte, Dateiname eingeben: ") ; Ask for Filename
FileName$=Input()
StringToFind$ = "B51000"
If ReadFile(0, FileName$)
PrintN("")
PrintN("Starting...")
While Eof (0) = 0
UseFile(0)
Text$ = ReadString()
BLZ$ = Mid(Text$,7,8)
KontoNr$ = Mid(Text$,15,10)
Empfaenger$ = Mid(Text$,25,53)
Betrag$ = Mid(Text$,79,10)
Verwendungszweck$ = Mid(Text$,90,60) ;is variable 27 until 15*27 positions
Bankverbindung$ = Right(Text$,30) ;is at the end of the string : 30 positions
FoundPos = FindString(Text$, StringToFind$, 1)
If FoundPos 0
UseFile(1)
WriteStringN ("")
WriteStringN ("----------------------------------------")
WriteString ("Dateiname : ")
WriteStringN (FileName$)
WriteStringN ("----------------------------------------")
WriteStringN ("")
WriteString ("Bankleitzahl : ")
WriteStringN (BLZ$)
WriteString ("Konto-Nr. : ")
WriteStringN (KontoNr$)
WriteString ("Empfaenger : ")
WriteStringN (Empfaenger$)
WriteString ("Betrag : ")
WriteStringN (Betrag$)
WriteString ("Verwendungszweck : ")
WriteStringN (Verwendungszweck$)
WriteString ("Bankverbindung : ")
WriteStringN (Bankverbindung$)
UseFile (0)
EndIf
Wend
CloseFile(0)
CloseFile(1)
PrintN("")
PrintN("Fertig !")
Temp$ = Input();
CloseConsole();
EndIf
End
Else
MessageRequester("Error","Cant open LPT ",0)
EndIf