Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!cernvax!chx400!ugun2b!ugsc2a!fisher From: fisher@sc2a.unige.ch (Markus Fischer) Newsgroups: comp.os.msdos.apps Subject: Re: DBASE refuses to send CHR(0) to printer. Message-ID: <271@sc2a.unige.ch> Date: 18 Oct 90 13:40:17 GMT References: <2292@wn1.sci.kun.nl> Distribution: comp Organization: University of Geneva, Switzerland Lines: 54 In article <2292@wn1.sci.kun.nl>, vlsi3@erato.cs.kun.nl (vlsi cursus) writes: > Hi readers, > > I'm writing a small database program using Dbase, which uses the printer. > Therefore I need to send the null character, because it is part of a > printer control code. It is used in the following context: > SET PRINT ON > ?? ....+CHR(0)+.. > | > SET PRINT OFF > > The problem is, the printer doesn't receive the null character (I checked > it with a hex-dump). Does anyone know what how to do it in another way?? > > BTW: it is dbase 3+. > I just tried it myself, and it really doesn't work! One way around this would be to use an external program to send the null character, or even better, any control code to the printer. Example (TC): #include main() { FILE *prn = fopen("PRN","wb"); /* open DOS' PRN */ fprintf(prn, "\0"); /* send the code */ } something more technical like #include main() { _write(4, "\0", 1); /* (binary) write one byte to file handle 4 (prn?) */ } works also. In dBASE, you call the external program with run [parameters] If your dBASE program uses the external very often, you could try to convert it to a "binary" (a *.BIN produced by EXE2BIN, same format as a *.COM), and use it as: load call [with ] but to tell the truth, I couldn't get it to work, even with the mose elementary program like "printf("Hello dBASE!\n")". I guess I'm missing some point, and as I don't have any technical docs... Sorry for the sketchy information, hope it helps some. Markus Fischer, Dpt. of Anthropology.