replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Convert the following fixed format code from MS Dev Studio?
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 

Convert the following fixed format code from MS Dev Studio?

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



Joined: 14 May 2009
Posts: 29

PostPosted: Tue Mar 09, 2010 5:07 pm    Post subject: Convert the following fixed format code from MS Dev Studio? Reply with quote

I would like to convert the following fixed format code from MS Developer Studio to free format in FTN95.

Code:

!        Special interface to use 32 bit Windows "C" Library BTRCALL routine
!        contained in WBTRV32.LIB
         INTERFACE TO INTEGER*4 FUNCTION BTRCALL
     + [STDCALL,ALIAS:'_BTRCALL@28' ](ARG1[VALUE]
     +                                        ,ARG2[REFERENCE]
     +                                        ,ARG3[REFERENCE]
     +                                        ,ARG4[REFERENCE]
     +                                        ,ARG5[REFERENCE]
     +                                        ,ARG6[VALUE]
     +                                        ,ARG7[VALUE])

         INTEGER*4     ARG1     
         CHARACTER*128 ARG2     
         CHARACTER*(*) ARG3     
         INTEGER*4     ARG4     
         CHARACTER*(*) ARG5     
         INTEGER*4     ARG6     
         INTEGER*4     ARG7     

   END


Should I be using C_EXTERNAL? Or maybe something similar to the following:

Code:

!Special interface to use 32 bit Windows "C" Library BTRCALL routine
!contained in WBTRV32.LIB
interface
STDCALL BTRCALL '_BTRCALL@28' (VAL,REF,REF,REF,REF,VAL,VAL):INTEGER*4

INTEGER*4 arg1
CHARACTER (LEN=128) :: arg2
CHARACTER (LEN=*) :: arg3
INTEGER*4 arg4
CHARACTER (LEN=*) :: arg5
INTEGER*4 arg6
INTEGER*4 arg7
 
END FUNCTION BTRCALL
end interface



With this, I get a the following errors:
Nesting error - the INTERFACE construct on line 3 has been terminated
ARG3 cannot have the type CHARACTER (LEN=*) :: arg3 as it is not a dummy argument...

Any ideas on how to best handle this?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Mar 09, 2010 5:19 pm    Post subject: Reply with quote

You will need STDCALL but not 'interface' before it.
That is all. Nothing else after this line.
Back to top
View user's profile Send private message AIM Address
silverdan



Joined: 14 May 2009
Posts: 29

PostPosted: Wed Mar 10, 2010 5:15 pm    Post subject: Reply with quote

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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