JugoslavDujic
Joined: 10 Nov 2005 Posts: 7
|
Posted: Mon Nov 14, 2005 8:54 am Post subject: Binary (Stream) Files (porting woe #2) |
|
|
I'm porting my Xeffort GUI library (www.xeffort.com) from Visual Fortran to FTN95 (among other compilers). The code uses a lot of "smart" non-standard tricks (since VF has pretty much full capabilites of C language) and I'm trying to find out how to find equivalent constructs in FTN95.
The part on saving the bitmap into a .bmp file used OPEN(FORM="BINARY") extension of Visual Fortran (equivalent of F2003 "STREAM"). I don't see it supported in FTN95 in either form. The call in question is
[pre]
OPEN(251, file = sFileName, ACTION = 'WRITE', ACCESS = 'SEQUENTIAL', STATUS = 'UNKNOWN', &
FORM = 'BINARY', IOSTAT = iErr)
IF (iErr.NE.0) RETURN
WRITE(251, IOSTAT = iErr) hdr, &
bmInfo(1: SIZE(TRANSFER(BI%bmiHeader, bmBits))+ nColorTable*RGBQUAD_SIZE), &
bmBits
CLOSE(251)
XSaveBitmap = iErr.EQ.0
[/pre]Well, I can rewrite it using CreateFile/WriteFile API, but I'd like to hear if there's a simpler solution.
(Btw, SIZE(TRANSFER(...)) is ugly replacement for lack of SIZEOF intrinsic... grrrr...
--
Jugoslav _________________ %2D%2D%0D%0AJugoslav |
|