Request: FiveWinVersion as number

Post Reply
AntoninoP
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Request: FiveWinVersion as number

Post by AntoninoP »

Hello,
sometime we need to keep the code compatible with 2 versions of fivewin, for example in 18.01 there is no more WndReadPalBmpEx that is replaced with FW_ReadImage.
in those case I would like write something like:

Code: Select all | Expand

#if FWH_VER>=18
aBmpPal       :=  FW_ReadImage(,cResName)
#else
aBmpPal       :=  WndReadPalBmpEx(,cResName)
#endif
 

The problem is that there is no FWH_VER define, I think it would be useful in fivewin.h a define like:

Code: Select all | Expand

#define FWH_VER 18.1

or better, splitted in 2 define.
Antonino
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Request: FiveWinVersion as number

Post by nageswaragunupudi »

Code: Select all | Expand

function nFWVersion()
return Int( Val( Token( FWVERSION, ' ' ) ) ) + ;
            Val( Token( FWVERSION, '.' ) ) / 100
 
Regards

G. N. Rao.
Hyderabad, India
AntoninoP
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: Request: FiveWinVersion as number

Post by AntoninoP »

This will be a run-time check, my problem in this case is that "FW_ReadImage" is not defined in 17.12 so it does not link...
It is because I want a compile time check.
User avatar
karinha
Posts: 7948
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Request: FiveWinVersion as number

Post by karinha »

Code: Select all | Expand


   IF FWVERSION = "FWHX 16.12" .OR. FWVERSION = "FWHX 17.01"
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
AntoninoP
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: Request: FiveWinVersion as number

Post by AntoninoP »

February 2018
=============

* Enhancement: #define FW_VersionNo 18020 has been added to FiveWin.ch


YEEEEE!!!!
Many thank!!
AntoninoP
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: Request: FiveWinVersion as number

Post by AntoninoP »

My code now:

Code: Select all | Expand

#if defined(FW_VersionNo) .and. FW_VersionNo >= 18020
   nImage := FW_ReadImage( Self, cImage )[1]
#else
   nImage := WndReadPalBmpEx( Self, cImage )[1]
#endif
Post Reply