Hallo,
ich habe folgenden C-Code (ganz frech geklaut aus der Newsgroup

) :
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#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