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 

Using centre@ function
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1884

PostPosted: Mon Jan 15, 2018 3:48 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
If I am right (and I concede that it is about 20 years since I last worked with Assembler, so I could be wrong), then all a FUNCTION returns is the address to its result on the stack.

The compiler writer is free to implement function calls that way, but that is not how FTN95 handles functions that return simple scalar type results (such as integer, real and double precision). For example, for functions of type INTEGER, the return value is held in AX, EAX or RAX. For functions of type real, the return value is in ST0 or XMM0. No address is needed or used, as with more general expressions.

Things were different when we had 8-bit or 16-bit computers, and a register was insufficiently large to hold Fortran integers (other than INTEGER*2 and INTEGER*1).

If such a character type function is referenced in an expression or an I/O list, the compiler may have to create a temporary variable on the stack to hold the result and pass the address or value of the temporary variable to the I/O routines.
Back to top
View user's profile Send private message
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Mon Mar 12, 2018 2:18 pm    Post subject: A related question... Reply with quote

When using DRAW_CHARACTERS@, with a proportional font, is there a way to determine the size in pixels of the box that contains the text, such that right/centre justification can be calculated for hardcopy...

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Mar 12, 2018 2:47 pm    Post subject: Reply with quote

Try GET_TEXT_SIZE@.
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Mon Mar 12, 2018 3:26 pm    Post subject: Reply with quote

Perfect, tks!

i was obviously searching for the wrong key words in the help file!

K
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
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