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 

select_graphics_object@

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



Joined: 11 Apr 2005
Posts: 371

PostPosted: Mon Jun 20, 2005 7:23 am    Post subject: select_graphics_object@ Reply with quote

Just investigating a mysterious problem with code that has been (apparently) working fine for some years, and found my way to this line:

call select_graphics_object@ (hangra)

Stepping through the code, I found that two of the four values returned by a subsequent call to get_graphics_selected area@ were garbage. This prompted me to check the user manual, where I found that select_graphics_object@ is apparently a function, not a subroutine. Prompting (at least) two questions:

Am I right in that it was once a subroutine, and that the definition has been changed at some point? Even if I'm wrong and it was always a function, why doesn't the compiler pick up my attempt to use it as a subroutine?

Confused and potentially vexed,

Andy Mad
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


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

PostPosted: Tue Jun 21, 2005 1:34 am    Post subject: select_graphics_object@ Reply with quote

select_graphics_object@ has always been a function but FTN95 allows you to call it as a subroutine.
The argument is a user-supplied integer that identifies a given %gr region.

As a general rule a Fortran compiler does not know if an external subprogram is a function or a subroutine. At best it can only check that your usage is consistent (similarly for the number and types of its arguments). In the present case the routine is given an interface in a header file so perhaps a check for function/subroutine usage could be made. However, there are obviously cases where one is not interested in the value returned by a function and it is convenient to be able to call it as a subroutine.

Regards

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