WholeIO.WriteCard() 
Author Message
 WholeIO.WriteCard()

M2 users:

I finally got burned in converting from StonyBrook V3 to the new
V4 compiler. (though the new compiler is certainly worth the singeing
here).

The ISO standard IO module WholeIO contains the procedure WriteCard,
which looks
like this in the DEF sources posted on the WG13 web pages:

PROCEDURE WriteCard (cid: IOChan.ChanId; card: CARDINAL; width:
CARDINAL);
  (* Writes the value of card to cid in text form, in a field of the
given minimum width. *)

I have always used a value of 0 for the "width" parameter to mean no
minimum width, and that is the way the V3 compiler interpreted it.

The V4 package changes the meaning of 0 here to be a special case
which implies a minimum width of at least 2. The DEF file in V4 has the
additional comment:

(* A width of zero(0) is special and means a single
     space character will always be output before the number *)

Is this a part of the ISO standard (buried in the document that I am too
cheap to buy)?

or was it added by general agreement?

or is it something that was never standardized and for which I could
lobby StonyBrook to remove?

Thanks,

Tom Breeden



Tue, 11 Feb 2003 03:00:00 GMT  
 WholeIO.WriteCard()
The ISO standard defines the special case for 0, and yes a single leading
space is always output with the number. Use a space value of 1 to output the
number, only the number, and nothing but the number.

V3 was not compliant in that regard, actually at some point in the V3
maintenance cycle I thought that was changed/corrected.

--
Norman Black
Stony Brook Software
the reply, fubar => ix.netcom


Quote:

> M2 users:

> I finally got burned in converting from StonyBrook V3 to the new
> V4 compiler. (though the new compiler is certainly worth the singeing
> here).

> The ISO standard IO module WholeIO contains the procedure WriteCard,
> which looks
> like this in the DEF sources posted on the WG13 web pages:

> PROCEDURE WriteCard (cid: IOChan.ChanId; card: CARDINAL; width:
> CARDINAL);
>   (* Writes the value of card to cid in text form, in a field of the
> given minimum width. *)

> I have always used a value of 0 for the "width" parameter to mean no
> minimum width, and that is the way the V3 compiler interpreted it.

> The V4 package changes the meaning of 0 here to be a special case
> which implies a minimum width of at least 2. The DEF file in V4 has the
> additional comment:

> (* A width of zero(0) is special and means a single
>      space character will always be output before the number *)

> Is this a part of the ISO standard (buried in the document that I am too
> cheap to buy)?

> or was it added by general agreement?

> or is it something that was never standardized and for which I could
> lobby StonyBrook to remove?

> Thanks,

> Tom Breeden




Tue, 11 Feb 2003 03:00:00 GMT  
 WholeIO.WriteCard()


Quote:

> M2 users:

> I finally got burned in converting from StonyBrook V3 to the new
> V4 compiler. (though the new compiler is certainly worth the singeing
> here).

> The ISO standard IO module WholeIO contains the procedure WriteCard,
> which looks
> like this in the DEF sources posted on the WG13 web pages:

> PROCEDURE WriteCard (cid: IOChan.ChanId; card: CARDINAL; width:
> CARDINAL);
>   (* Writes the value of card to cid in text form, in a field of the
> given minimum width. *)

> I have always used a value of 0 for the "width" parameter to mean no
> minimum width, and that is the way the V3 compiler interpreted it.

> The V4 package changes the meaning of 0 here to be a special case
> which implies a minimum width of at least 2. The DEF file in V4 has the
> additional comment:

> (* A width of zero(0) is special and means a single
>      space character will always be output before the number *)

> Is this a part of the ISO standard (buried in the document that I am too
> cheap to buy)?

  It's in the fine print somewhere, "In the special case of a value of
zero for width, exactly one leading space shall be written".

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 21 Feb 2003 04:53:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 
 

 
Powered by phpBB® Forum Software