Unprintable characters

Chris Sharman chris.sharman@ccagroup.co.uk
Wed, 10 Nov 2004 08:57:09 +0000


Jonas Rosell wrote:
> We do like this when adding a carriage return to the end of a file, 
> probably you could do the same for TAB.
>  
> define tab-code integer = 09
> define tab-char cha*01 = char(tab-code)[2:1]

This is architecture dependent, of course - you don't mention your 
architecture.

Simplest is simply to embed the necessary character into the source, but 
that can cause problems if editors etc can't handle it.

If you prefer the above technique, then on VMS & other architectures 
which support int size 1:
def tab-code int*2 size 1 = 9
def tab-char char*1 = characters(tab-code)

On machines which don't support int size 1, you'll need [1:1] on 
little-endian machines, and [2:1] (or [4:1]) on big-endian, as Jonas said.

If you need it truly portable:
def tab-code int*4 size 2 = 9*257 ; 9 in each byte
; then you don't need to worry about byte ordering.

Is there a FAQ this could go in - it seems to come up often ?

Chris


-----------------------------------------------------------------------

Any views expressed in this message are those of the sender and not
necessarily those of CCA Group.  The unauthorized use, disclosure,
copying or alteration of this message is forbidden.  The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed.  Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.