[Gambas-user] macros conditionals supported? (at code, at compile time and at runtime time)?
Benoît Minisini
gambas at ...1...
Fri Jan 22 15:15:19 CET 2016
Le 22/01/2016 15:00, PICCORO McKAY Lenz a écrit :
> there its any way of choose piece of logic in gambas code: i ilustrate with
> a example:
>
> in smtp component between gambas << 3.5 and gambas >> 3.6 the body now has
> a method:
>
> in gambas << 3.6 was:
>
> hmail as new SmtpClient
> hmail.Add("this its the body of the text mail")
>
>
> in gambas >> 3.6 now are:
>
> hmail as new SmtpClient
> hmail.Body("this its the body of the text mail")
>
>
> so how can i in code made something like in c:
>
> #if gambas < 3.6
> hmail.Add("this its the body of the text mail")
> #else
> hmail.Body("this its the body of the text mail")
> #endif
>
You can't, this is non-sense: the version of Gambas depends on the
computer where you run the program, not the computer where you compile it.
Instead you must use System.FullVersion at runtime and run normal
IF...ENDIF.
And not that SmtpClient.Body is a property, not a method.
Regards,
--
Benoît Minisini
More information about the User
mailing list