View previous topic :: View next topic |
Author |
Message |
Moji
Joined: 30 Sep 2020 Posts: 27
|
Posted: Tue Jul 18, 2023 9:47 am Post subject: get_font_ID@ in 64-bit programs |
|
|
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 |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 709 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Tue Jul 18, 2023 11:21 am Post subject: |
|
|
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 |
|
|
Moji
Joined: 30 Sep 2020 Posts: 27
|
Posted: Tue Jul 18, 2023 12:06 pm Post subject: Re: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8012 Location: Salford, UK
|
Posted: Tue Jul 18, 2023 1:06 pm Post subject: |
|
|
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 |
|
|
|