Carriage Return/Line Feed - QTP
Chris Sharman
chris.sharman@ccagroup.co.uk
Fri, 27 Sep 2002 09:07:01 +0100
Timothy J Cummings wrote:
>DEF CR INTEGER*2 UNSIGNED = 13
>DEF LF INTEGER*2 UNSIGNED = 10
>DEF CR_LF CHAR*2 = CHARACTERS(CR)[2:1] + CHARACTERS(LF)[2:1]
This only works on a big-endian machine. On a little-endian (all the best
machines are little-endian ;)
it gives the wrong answer.
Terry Curran wrote:
> DEF CR INTEGER*2 UNSIGNED SIZE 1 = 13
> DEF LF INTEGER*2 UNSIGNED SIZE 1 = 10
> DEF CR_LF CHAR*2 = CHARACTERS(CR) + CHARACTERS(LF)
This is better, in that it never gives the wrong answer, and it works for
me.
Unfortunately, on some rather limited platforms, integer size 1 is
unsupported, and it won't compile at all.
To be fully portable:
def cr int*4 = 13*257 ; 13 in both bytes !
def lf int*4 = 10*257 ; 10 in both bytes !
def cr_lf char*2 = characters(cr)[1:1] + characters(lf)[1:1]
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.