Request: FiveWinVersion as number

Request: FiveWinVersion as number

Postby AntoninoP » Mon Feb 19, 2018 8:56 am

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 view  RUN
#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 view  RUN
#define FWH_VER 18.1

or better, splitted in 2 define.
Antonino
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Request: FiveWinVersion as number

Postby nageswaragunupudi » Mon Feb 19, 2018 10:18 am

Code: Select all  Expand view  RUN
function nFWVersion()
return Int( Val( Token( FWVERSION, ' ' ) ) ) + ;
            Val( Token( FWVERSION, '.' ) ) / 100
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Request: FiveWinVersion as number

Postby AntoninoP » Mon Feb 19, 2018 3:04 pm

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.
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Request: FiveWinVersion as number

Postby karinha » Mon Feb 19, 2018 3:42 pm

Code: Select all  Expand view  RUN

   IF FWVERSION = "FWHX 16.12" .OR. FWVERSION = "FWHX 17.01"
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7844
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Request: FiveWinVersion as number

Postby AntoninoP » Mon Mar 12, 2018 2:26 pm

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

Re: Request: FiveWinVersion as number

Postby AntoninoP » Fri Mar 16, 2018 10:05 am

My code now:
Code: Select all  Expand view  RUN
#if defined(FW_VersionNo) .and. FW_VersionNo >= 18020
   nImage := FW_ReadImage( Self, cImage )[1]
#else
   nImage := WndReadPalBmpEx( Self, cImage )[1]
#endif
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests