Hallo,
ich habe folgenden C-Code (ganz frech geklaut aus der Newsgroup :P) :
C
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <conio.h>
- #include <ctype.h>
- #include <fcntl.h>
- #include <dbg.h>
- #include <cbm.h>
- #define F_PRT 4 // logical FileNr Printer
- #define P_DVN 4 // Device Nr Printer
- typedef unsigned char BYTE;
- extern BYTE _oserror;
- void waitKey(void){
- cprintf("\r\n... weiter mit Taste ...\r\n\n");
- cgetc();
- }
- void DispError(int rc,char *s){
- cprintf("\r\n%d:%s\r\n",rc,s);
- cprintf("OS-error code %d\r\n",_oserror);
- waitKey();
- }
- int OpenPrinter(void){
- BYTE rc;
- rc=cbm_open((BYTE)F_PRT,(BYTE)P_DVN,(BYTE)1,NULL);
- if(rc){
- DispError(rc,"Open-Fehler Printer");
- return 1;
- }
- return 0;
- }
- void Print(char *s){
- BYTE rc;
- rc=cbm_write((BYTE)F_PRT,s,strlen(s));
- if(rc!=strlen(s)) DispError(rc,"Fehler beim Drucken");
- }
- void PrintNl(char *s){
- Print(s);
- Print("\r\n");
- }
- void PrintText (void){
- int i;
- if(OpenPrinter())return;
- PrintNl("Hallo.");
- cbm_close(F_PRT);
- }
- void main(void)
- {
- PrintText();
- }
Was ist versuche ist,
auf meinem StarLC10 C Farbdrucker das Hallo. auszudrucken.
Was herauskommt ist folgendes:
http://datenmuellkippe.tbspace.de/printshit.jpg
Kann mir jemand sagen, wo dran das liegt?
Ein einfaches BASIC- open 3,4,7,"Hallo":close3 funktioniert gut
Danke,
Tobias