soccer jersey forums.silverfrost.com :: View topic - get_font_ID@ in 64-bit programs
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 

get_font_ID@ in 64-bit programs

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
Moji



Joined: 30 Sep 2020
Posts: 27

PostPosted: Tue Jul 18, 2023 9:47 am    Post subject: get_font_ID@ in 64-bit programs Reply with quote

In the manual, it is stated that get_font_ID@ requires an integer parameter (https://www.silverfrost.com/ftn95-help/clearwinp/library/get_font_id_.aspx). However, I get an error regarding argument type (INTEGER(KIND=4) is required), as I try to compile this code in 64-bit (/64):
Code:
PROGRAM GET_FONT_ID_TEST
   IMPLICIT NONE
   INCLUDE <windows.ins>
     
   INTEGER      :: ID
   call get_font_ID@ (ID)
END


In the above code, if instead of ID, an array element is used, the program doesn't complain about it:
Code:
PROGRAM GET_FONT_ID_TEST
   IMPLICIT NONE
   INCLUDE <windows.ins>
     
   INTEGER      :: Arr(2)
   
   call get_font_ID@ (Arr(1))
END
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 709
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Jul 18, 2023 11:21 am    Post subject: Reply with quote

Moji,
Define ID as INTEGER(KIND=7) and I think that should fix the problem, with the code working correctly for both WIN32 and X64 compilers.
Ken
Back to top
View user's profile Send private message Visit poster's website
Moji



Joined: 30 Sep 2020
Posts: 27

PostPosted: Tue Jul 18, 2023 12:06 pm    Post subject: Re: Reply with quote

Kenneth_Smith wrote:
Moji,
Define ID as INTEGER(KIND=7) and I think that should fix the problem, with the code working correctly for both WIN32 and X64 compilers.
Ken

Thank you Ken for the suggestion. If the input parameter of get_font_ID@ should be a handle of KIND=7, then why the compiler does not complain when an array element is used instead of that simple integer (the second program in my post)? When I define an integer array of default kind (KIND=3), doesn't it mean that elements are of that kind?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Jul 18, 2023 1:06 pm    Post subject: Reply with quote

The font ID is an address that will be a 32 bit integer for Win32 and a 64 bit integer for x64.

It looks like the documentation needs correcting in this respect.

The header file clearwin.ins and module look right but from what you say, FTN95 must not check the size of the integer provided.
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 -> 64-bit 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