[comp.databases] dBase / FoxBase Problem with producing NUL

jbrown@herron.uucp (Jordan Brown) (04/05/90)

Many dBASE variants use C-style strings, which are terminated by
nulls.  CHR(0) is almost meaningless to them.  (Rather, it's almost
equivalent to "".)  Clipper uses length-based strings and can handle
nulls.  I don't know about dBASE IV and FoxPro.

Depending on the application, CHR(128) might be an acceptable substitute.
(If it's going out a 7-bit link to a printer, for instance, 128 will be
trimmed to 0.)
-- 
Jordan Brown
jbrown@jato.jpl.nasa.gov

awd@dbase.A-T.COM (Alastair Dallas) (04/11/90)

I'm not sure what dBASE III's behavior is--I haven't tried it, but
generally CHR(0) is not recommended practice.  Just so you know your
options, however:  dBASE IV has a new '???' command that is there
specifically to write unmodified output to printers and other
peripherals.  We don't have a Unix version (yet) but dBASE IV
will make programming this particular problem a lot more pleasant.

/alastair/

jbrown@herron.uucp (Jordan Brown) (04/11/90)

timk@xenitec.on.ca (Tim Kuehn) writes:
> For DOS:
> <write translated output to an aux file>
> type <aux file> | trans > lpt1:

> For Xenix:
> <Write translated output to an aux file> 
> cat <aux file> | trans | lp

I don't understand why people keep wanting a "cat" step in commands like
this.  The shell will do input redirection, even under DOS...

for some file "auxfile"...

DOS:
trans <auxfile >lpt1

XENIX:
trans <auxfile | lp

(incidentally, under DOS don't name your aux file "aux" or you'll
be in trouble...)
-- 
Jordan Brown
jbrown@jato.jpl.nasa.gov

jbrown@herron.uucp (Jordan Brown) (04/11/90)

Of course, if you just want to send a null to a printer from FoxBase,
dBASE, Vulcan, or probably any of the variants, you could always write
a LOADed routine that sends a null to the printer.  It'd be tedious to
use, but it'd certainly work as long as the printer drivers didn't do
anything *terribly* complicated.
-- 
Jordan Brown
jbrown@jato.jpl.nasa.gov