[Gambas-user] how to detect compilation runtime componets available?

Bruce Steers bsteers4 at gmail.com
Fri Apr 2 00:25:38 CEST 2021


why would gb.gui not be loaded and you not know about it?
how you maybe have it?



On Thu, 1 Apr 2021 at 18:56, PICCORO McKAY Lenz <mckaygerhard at gmail.com>
wrote:

> El jue, 1 de abr. de 2021 a la(s) 13:47, Bruce Steers
> (bsteers4 at gmail.com) escribió:
>  Or there's using "Try" to attempt something and see if it's possible?
> > something like ..
> >
> > Dim sVar As String, HasGUI as Boolean
> > Try sVar = Message("Hello")
> > If Error Then
> >   Print "Hello"
> >   HasGUI=False
> > Else
> >   HasGUI=True
> > Endif
>
> no is not possible.. compilation time saids "gb.gui is not loaded" XD
> thanks anyway
> >
> > On Thu, 1 Apr 2021 at 18:29, PICCORO McKAY Lenz <mckaygerhard at gmail.com>
> wrote:
> >>
> >> ha ha ha thanks but now get a problem.. i trey to detect as suggested
> >> and ok.. but at build time it fails.. if i do not have gb.gui loaded..
> >>
> >> i guess i do not ask correctly but it makes sense.. i cannot use
> >> message if i do not have gb.gui component defined XD
> >> El jue, 1 de abr. de 2021 a la(s) 13:12, Bruce Steers
> >> (bsteers4 at gmail.com) escribió:
> >> >
> >> > Something like this will work..
> >> >
> >> > Public Sub GetGUI() As String
> >> > Dim GUIs As String[] = ["gb.gtk", "gb.gtk3", "gb.qt4", "gb.qt5"]
> >> > For Each gui As String In GUIs
> >> >  if Component.IsLoaded(gui) then Return gui
> >> > Next
> >> >
> >> > Return "wayland"
> >> > End
> >> >
> >> >
> >> > Something like that
> >> > BruceS
> >> >
> >> >
> >> > On Thu, 1 Apr 2021 at 16:44, PICCORO McKAY Lenz <
> mckaygerhard at gmail.com> wrote:
> >> >>
> >> >> how to detect compilation runtime components available?
> >> >>
> >> >> by example try to detect if gb.gui are loaded or used or compiled in
> >> >> the project/app and if true, then try to use some gui things.. if not
> >> >> just use console only..
> >> >>
> >> >> Lenz McKAY Gerardo (PICCORO)
> >> >> http://qgqlochekone.blogspot.com
> >> >>
> >> >> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >> >
> >> >
> >> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >>
> >> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >
> >
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210401/9af18bc0/attachment-0001.htm>


More information about the User mailing list