Re: A problem of character (Fortran)

Rick Fochtman <[email protected]> Thu, 03 Jun 2010 19:36:43 -0500
Newsgroups gmane.comp.emulators.turnkey-mvs
Message-ID <[email protected]>
-------------------------------<snip>----------------------------------------- 


>
>
>     Make the "A3" in the format "A4". Characters are pringter Most sig
>     byte first
>      
>     Dave Wade G4UGM
>     Illegitimi Non Carborundum
>
>
> Um, but isn't that going to print with a lot of spaces (or junk)? I'd 
> go for setting the value in the high byte, and then using A1, e.g.
>
> STAR = 92*256**3
> ...
> IF (SECT(I,J) .EQ. 1) SRS(J) = STAR
>
> Then you can position the individual characters as you like in the 
> FORMAT statement, such as
>
> 900 FORMAT(' ',A1)
>
> to get single horizontal spacing. But it's been almost 40 years, so I 
> may well be confused.
>
> Tony H.

---------------------------------<unsnip>----------------------------------
Make your declaration for SRS(8) to be INTEGER*2 and use A2 format. That 
declaration will make SRS an array of halfwords, instead of fullwords.

Rick

>      
>
>         -----Original Message-----
>         From: [email protected]
>         <mailto:[email protected]>
>         [mailto:[email protected]
>         <mailto:[email protected]>] On Behalf Of Ron Hudson
>         Sent: 03 June 2010 23:14
>         To: [email protected]
>         <mailto:[email protected]>
>         Subject: [turnkey-mvs] A problem of character (Fortran)
>
>         Calling all Fortran Wizards...
>
>         I am trying to print out the sect(8,8) integer array as characters
>         The array is mostly zeros for that I want to print '.'(ebcidic
>         75) 
>         The other values...
>          92 = '*'
>          96 = '-'
>         123 = '#'
>          78 = '+'
>
>
>              INTEGER SRS(8)
>               DO 1 I=1,8
>               DO 2 J=1,8
>               SRS(J) = 75
>               IF (SECT(I,J) .EQ. 1) SRS(J) = 92
>               IF (SECT(I,J) .EQ. 2) SRS(J) = 96
>               IF (SECT(I,J) .EQ. 3) SRS(J) = 123
>               IF (SECT(I,J) .EQ. 4) SRS(J) = 78
>             2 CONTINUE
>               WRITE(6,900) (SRS(J), J=1,8)
>           900 FORMAT(' ',8A3)
>             1 CONTINUE
>
>         I am getting a blank area instead of the characters I expect.
>
>         Yes, it's going to be a StarTrek game.
>
>         : ^ )
>
>         Ron.
>
>
>
>
>