[fpc-pascal]Strings vs. Ansistrings

XHajT03 at mbox.vol.cz XHajT03 at mbox.vol.cz
Wed Sep 20 22:09:22 CEST 2000


From:           	James_Wilson at i2.com
Subject:        	Re: [fpc-pascal]Strings vs. Ansistrings
To:             	fpc-pascal at deadlock.et.tudelft.nl
Date sent:      	Wed, 20 Sep 2000 10:29:20 -0400
Send reply to:  	fpc-pascal at deadlock.et.tudelft.nl

> BTW; do you know of another way to send text to the screen (for go32
> targets) then write and writeln? One of the functions of the file
> viewer is to be able to read/display binary files. When you try to use
> write to display data from a binary file (which was read from the file
> using blockread) everything after a cr/lf pair is ignored. Would
> assigncrt help at all?

 No, it wouldn't. What you have to do depends on your idea how 
results should look like. If you want to write contents of the buffer 
directly to the screen, you have to parse it as individual lines 
(ending with CR/LF) and output these instead. If you want something 
like a hex dump (i.e. one column with hexadecimal values and another 
with their character representations, you have to filter special 
values (like #13 and #10) out and replace them with your chosen 
representation of non-printable characters. The same should be done 
_at_least_ for #7 (bell) and #8 (backspace) as well, otherwise you 
might quickly get a terrible beeping monster that hides (eats) many 
regularly printable characters after viewing a "well-chosen" binary 
file. Should you want to display semi-graphics characters assigned to 
those special characters as well, then your only possibility is 
direct memory access (or video memory buffers on non-DOS platforms). 
For DOS (GO32v2) it means e.g. using the TP-compatible mem[] array. 
However, this cannot be done in a portable manner, every platform has 
its special tools for doing such special things.

                       Have a nice day


                              Tomas Hajny, XHajT03 at mbox.vol.cz on Internet
                                           tom.sms at axon.cz in urgent cases




More information about the fpc-pascal mailing list