- #1
sergegirard
- 1
- 0
Hello,
I am new with FORTRAN but experienced with PLI/I, Cobol (mainframe), Clipper (PC) etc.
As an exercise I'm writing some small pograms.
Now I have one problem/question:
I have an INTEGER array (ARPAS). When printing this array I want to suppress printing the zeroes; only # 0. This option I can't find.
Then I tried to make a turn-a-round: convert those INTEGERs to CHARs (CHARPAS):
CHARPAS (RIJ , KOL) = ACHAR(ARPAS (RIJ , KOL) ) and even
CHARPAS (RIJ , KOL) = ICHAR(ARPAS (RIJ , KOL) )
and then conditioned printed (IF char .EQ. '0' print a space..)
Result is a lots of ☺ etc.
Input is : 0 1 0 7 0 21 0 35 0 35 0 21 0 7 0 1 0
and I want is : bb 1 bb 7 bb 21 bb 35 bb 35 bb 21 bb 7 bb 1 bb
where bb is blanks/spaces.
Any idea what goed wrong?
Thanks,
Serge/Belgium
I am new with FORTRAN but experienced with PLI/I, Cobol (mainframe), Clipper (PC) etc.
As an exercise I'm writing some small pograms.
Now I have one problem/question:
I have an INTEGER array (ARPAS). When printing this array I want to suppress printing the zeroes; only # 0. This option I can't find.
Then I tried to make a turn-a-round: convert those INTEGERs to CHARs (CHARPAS):
CHARPAS (RIJ , KOL) = ACHAR(ARPAS (RIJ , KOL) ) and even
CHARPAS (RIJ , KOL) = ICHAR(ARPAS (RIJ , KOL) )
and then conditioned printed (IF char .EQ. '0' print a space..)
Result is a lots of ☺ etc.
Input is : 0 1 0 7 0 21 0 35 0 35 0 21 0 7 0 1 0
and I want is : bb 1 bb 7 bb 21 bb 35 bb 35 bb 21 bb 7 bb 1 bb
where bb is blanks/spaces.
Any idea what goed wrong?
Thanks,
Serge/Belgium