comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Free source code diagramming programs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Free source code diagramming programs [message #48344 is a reply to message #48304] Thu, 13 April 2006 17:43 Go to previous messageGo to previous message
Al Balmer is currently offline  Al Balmer
Messages: 3
Registered: April 2006
Junior Member
On 13 Apr 2006 17:20:40 -0700, "mitch grunes" <idlwizard-1@yahoo.com>
wrote:

>> Pretty printers (auto-indentation, etc.) lose a lot of information...
>> and tend to mess up comments,
>> especially when the author carefully lined up the columns of his/her
>> comments or code in some sort of table.
>
> Could you elaborate on this? What information is lost by reformatting?
>
> Here is an example from a FORTRAN calculator program, which will also
> only line up right if you display in a fixed width font like Courier:
>
> ! Problems
> if((a.eq.'/' .and. y.eq.0).or. ! Divide by 0
> & (a.eq.'1/'.and. y.eq.0).or. ! reciprocal of 0
> & (a.eq.'^' .and.(y.lt.0 ! Negatives to
> negative power
> & .or.(x.eq.0.and.y.eq.0))) then ! Zero to zero power
>
> If you only know IDL,
> ; Problems
> if (a eq '/' and y eq 0) or $ ; Divide by 0
> (a eq '1/' and y eq 0) or $ ; reciprocal of 0
> (a eq '^' and (y lt 0 $ ; Negatives to
> negative power
> or (x eq 0 and y eq 0)) then begin ; Zero to zero
> power
>
> If you only know C,
> /* Problems */
> if((strcmp(a,'/' )==0 && y==0) || /* Divide by 0 */
> (strcmp(a,'1/')==0 && y==0) || /* reciprocal of 0 */
> (strcmp(a,'^' )==0 && (y==0 /* Negatives to negative
> power */
> || (x==0 && y==0))) { /* Zero to zero power */
>
> No pretty printer is gonna preserve that.

I wouldn't ask a pretty printer to format anything that won't compile.
Count your parentheses and braces. Check the definition of strcmp().

--
Al Balmer
Sun City, AZ
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Finding a value in a array efficiently
Next Topic: ENVI Vector File with IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:05:13 PDT 2025

Total time taken to generate the page: 0.00372 seconds