replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Statement ordering error - FUNCTION cannot appear after type
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 

Statement ordering error - FUNCTION cannot appear after type

 
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: Wed Mar 10, 2010 5:25 pm    Post subject: Statement ordering error - FUNCTION cannot appear after type Reply with quote

If I have the STDCALL statement below the FUNCTION I do not get the error, but if the STDCALL is above I get the following error message:

Statement ordering error - FUNCTION cannot appear after type definition statements C:\Perforce\Mv-90\Main\FORT\CommonShared\CommonShared\ITRV.F90 5


Code:

!!Interface to use Pervasive's DLL BTRCALL routine contained in WBTRV32.DLL
STDCALL BTRCALL '_BTRCALL@28' (VAL,REF,REF,REF,REF,VAL,VAL):INTEGER*4

!***********************************************************************
FUNCTION Itrv(operation,posblock,databuffer,datalength,keybuffer,keynumber)
  IMPLICIT NONE
  !Make it public
  ASSEMBLY_INTERFACE (name="Itrv")
 
  ! B_OPEN...
  INTEGER*4, INTENT(IN OUT)       :: operation
  ! RTE_FCB
  CHARACTER (LEN=128), INTENT(IN) :: posblock
  ! RTE_BUF
  CHARACTER (LEN=*), INTENT(IN)   :: databuffer
  ! RTE_LEN
  INTEGER*4, INTENT(IN)           :: datalength
  ! RTE_KEY0
  CHARACTER (LEN=*), INTENT(IN)   :: keybuffer
  ! KEY0
  INTEGER*4, INTENT(IN OUT)       :: keynumber
  ! max_key_size
 
  INTEGER*4                        keylength
  INTEGER*4              btrcall,status,itrv
 
  keylength=255
  status=btrcall(operation,posblock,databuffer,datalength,keybuffer,keylength,keynumber)
  itrv=status
 
  RETURN
END FUNCTION Itrv

!Interface to use Pervasive's DLL BTRCALL routine contained in WBTRV32.DLL
!STDCALL BTRCALL '_BTRCALL@28' (VAL,REF,REF,REF,REF,VAL,VAL):INTEGER*4


I would prefer the STDCALL at the beginning of the file if possible. Any suggestions?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Mar 10, 2010 7:14 pm    Post subject: Reply with quote

The STDCALL line is like any other declaration, it must appear within a main or sub program (FUNCTION or SUBROUTINE).
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 -> 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