Silverfrost Forums

Welcome to our forums

get_font_ID@ in 64-bit programs

18 Jul 2023 8:47 #30451

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):

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:

PROGRAM GET_FONT_ID_TEST
   IMPLICIT NONE
   INCLUDE <windows.ins>
     
   INTEGER      :: Arr(2)
   
   call get_font_ID@ (Arr(1))
END 
18 Jul 2023 10:21 #30453

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

18 Jul 2023 11:06 #30455

Quoted from Kenneth_Smith 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?

18 Jul 2023 12:06 #30457

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.

Please login to reply.