forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Binary (Stream) Files (porting woe #2)

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
JugoslavDujic



Joined: 10 Nov 2005
Posts: 7

PostPosted: Mon Nov 14, 2005 8:54 am    Post subject: Binary (Stream) Files (porting woe #2) Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Nov 15, 2005 12:57 am    Post subject: Binary (Stream) Files (porting woe #2) Reply with quote

Jugoslav

You could try READF@.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group