[Gambas-user] macros conditionals supported? (at code, at compile time and at runtime time)?

PICCORO McKAY Lenz mckaygerhard at ...626...
Fri Jan 22 15:24:10 CET 2016


ok so i can made code like this:

if  Comp(System.FullVersion , "3.4.3", gb.ignorecase) = 0 then
' code for 3.4
else
' code for lasted
endif

but i made already and when compile breaks due in 3.4 does not exist the
property "Body" in Smtpclient class

sorry for "method" right its a property due set contents..

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

2016-01-22 9:45 GMT-04:30 Benoît Minisini <gambas at ...1...>:

> 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
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list