old question: detect gambas version in code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

old question: detect gambas version in code

PICCORO McKAY Lenz
i want to make a piece of software work in both gambas olders (gambas3 <<
3.5) and gambas newers (gambas >> 3.5.1)

by example, the smtp has some changes depending on the version, also the
gridview too..

example:

SMTP was rewriten in 3.6 so Body are not present in 3.5
http://gambaswiki.org/wiki/comp/gb.net.smtp/smtpclient/body?nh
this makes some of my code not work in embebed devices that does not run
modern versions of linux and some libs required by gambas 3.9

same behaviour with new rows.selection that are since 3.4
http://gambaswiki.org/wiki/comp/gb.qt4/_gridview_rows/selection

so there's a way to detect gambas version and paste code respect that? (was
answered some time ago, but i cannot find the mail)

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: old question: detect gambas version in code

Tobias Boege-2
On Tue, 20 Jun 2017, PICCORO McKAY Lenz wrote:

> i want to make a piece of software work in both gambas olders (gambas3 <<
> 3.5) and gambas newers (gambas >> 3.5.1)
>
> by example, the smtp has some changes depending on the version, also the
> gridview too..
>
> example:
>
> SMTP was rewriten in 3.6 so Body are not present in 3.5
> http://gambaswiki.org/wiki/comp/gb.net.smtp/smtpclient/body?nh
> this makes some of my code not work in embebed devices that does not run
> modern versions of linux and some libs required by gambas 3.9
>
> same behaviour with new rows.selection that are since 3.4
> http://gambaswiki.org/wiki/comp/gb.qt4/_gridview_rows/selection
>
> so there's a way to detect gambas version and paste code respect that? (was
> answered some time ago, but i cannot find the mail)
>

You can do a run-time check with System.FullVersion [1]. A compile-time
check is also possible by using the #If preprocessor syntax [2].

Regards,
Tobi

[1] http://gambaswiki.org/wiki/comp/gb/system/fullversion
[2] http://gambaswiki.org/wiki/lang/.if

--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: old question: detect gambas version in code

PICCORO McKAY Lenz
Excelent! thanks tobias

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-20 13:05 GMT-04:30 Tobias Boege <[hidden email]>:

> On Tue, 20 Jun 2017, PICCORO McKAY Lenz wrote:
> > i want to make a piece of software work in both gambas olders (gambas3 <<
> > 3.5) and gambas newers (gambas >> 3.5.1)
> >
> > by example, the smtp has some changes depending on the version, also the
> > gridview too..
> >
> > example:
> >
> > SMTP was rewriten in 3.6 so Body are not present in 3.5
> > http://gambaswiki.org/wiki/comp/gb.net.smtp/smtpclient/body?nh
> > this makes some of my code not work in embebed devices that does not run
> > modern versions of linux and some libs required by gambas 3.9
> >
> > same behaviour with new rows.selection that are since 3.4
> > http://gambaswiki.org/wiki/comp/gb.qt4/_gridview_rows/selection
> >
> > so there's a way to detect gambas version and paste code respect that?
> (was
> > answered some time ago, but i cannot find the mail)
> >
>
> You can do a run-time check with System.FullVersion [1]. A compile-time
> check is also possible by using the #If preprocessor syntax [2].
>
> Regards,
> Tobi
>
> [1] http://gambaswiki.org/wiki/comp/gb/system/fullversion
> [2] http://gambaswiki.org/wiki/lang/.if
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: old question: detect gambas version in code

PICCORO McKAY Lenz
er tobias.. the #If saaid that only allow string values.. how the
comparison are do it?

i mean i want to compare the gambas version, so its for detection of a
lower rather that 3.5 :

#if Version <= 3.5
 print "version 3.4"
#endif

so i cannot see the value of the Version or how do the comparison, the wiki
dont say so much

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-20 13:12 GMT-04:30 PICCORO McKAY Lenz <[hidden email]>:

> Excelent! thanks tobias
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-06-20 13:05 GMT-04:30 Tobias Boege <[hidden email]>:
>
>> On Tue, 20 Jun 2017, PICCORO McKAY Lenz wrote:
>> > i want to make a piece of software work in both gambas olders (gambas3
>> <<
>> > 3.5) and gambas newers (gambas >> 3.5.1)
>> >
>> > by example, the smtp has some changes depending on the version, also the
>> > gridview too..
>> >
>> > example:
>> >
>> > SMTP was rewriten in 3.6 so Body are not present in 3.5
>> > http://gambaswiki.org/wiki/comp/gb.net.smtp/smtpclient/body?nh
>> > this makes some of my code not work in embebed devices that does not run
>> > modern versions of linux and some libs required by gambas 3.9
>> >
>> > same behaviour with new rows.selection that are since 3.4
>> > http://gambaswiki.org/wiki/comp/gb.qt4/_gridview_rows/selection
>> >
>> > so there's a way to detect gambas version and paste code respect that?
>> (was
>> > answered some time ago, but i cannot find the mail)
>> >
>>
>> You can do a run-time check with System.FullVersion [1]. A compile-time
>> check is also possible by using the #If preprocessor syntax [2].
>>
>> Regards,
>> Tobi
>>
>> [1] http://gambaswiki.org/wiki/comp/gb/system/fullversion
>> [2] http://gambaswiki.org/wiki/lang/.if
>>
>> --
>> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...