I have run across a problem using TRANSPARENT to create a file. I have two different methods of creating the file (shown below) but one of these has an 'occasional' problem.
The file contains printer command codes for driving a graphic printer directly. The data are generated by the remainder of the code (too big to post) which creates an in-memory image of the rasterized data. I chose TRANSPARENT to allow the CRLF characters to NOT be transmitted unless needed.
And one byte is missing from the file (actually, many, but the first one can be easily found). I ran both methods of file generation (below), and the one that does not use the building of a character string in memory containing the raster data fails.
The binary comparison of the two files shows the following first error occurrence.
Comparing files output_fixed.plt and OUTPUT_NOTFIXED.PLT (Binary compare)
00002117: 20 00
00002119: 00 18
0000211A: 18 00
0000211C: 00 06
0000211D: 06 FF
00002120: FF 00
0000213B: 00 1F
0000213C: 1F FF
0000213D: FF F8
The code segment that fails is:
open(unit=99,file='output_notfixed.plt',access='transparent',
$ form='formatted',status='replace',iostat=icheck)
.
.
.
99000 format(99a1)
i=0
do 30060 jj4=0,ii4
write(99,99000)RASTER_VERTICAL_C(i4,jj4),
$ RASTER_VERTICAL_C(i4+1l,jj4),
$ RASTER_VERTICAL_C(i4+2l,jj4)
30060 continue
The code segment that works is:
open(unit=99,file='output_fixed.plt',access='transparent',
$ form='formatted',status='replace',iostat=icheck)
.
.
.
99000 format(99a1)
i=0
do 30060 jj4=0,ii4
i = i + 1
raster_master(i:i)=RASTER_VERTICAL_C(i4,jj4)
i = i + 1
raster_master(i:i)=RASTER_VERTICAL_C(i4+1L,jj4)
i = i + 1
raster_master(i:i)=RASTER_VERTICAL_C(i4+2L,jj4)
30060 continue
write(99,99001)raster_master(1:i)
99001 format(a)
When comparing the two files, they differ in size by 2306 bytes. There are 350 of these graphic outputs performed; it is likely (just based on file size) that there are more than one byte missing in these data, but it is too difficult to look through 300K of data to find them.
The compile options used for this code are: /DEFINT_KIND 2 /silent /SAVE /ZEROISE /FPP /CFPP /WINDOWS