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

Brian G brian at westwoodsvcs.com
Fri Apr 2 01:02:48 CEST 2021


Piccoro, 

Can you post an example app to show what you are trying to do? 
I find this whole conversation confusing.. kind of anyway. 
What are you working on, Library or Component? 

the app is usually created as a cmdline app or a graphical interface so you know at runtime. 

"Failure is the key to success; 
each mistake teaches us something" .. Morihei Ueshiba 
Brian G 

----- On Apr 1, 2021, at 3:25 PM, Bruce Steers <bsteers4 at gmail.com> wrote: 

> 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 < [
> mailto:mckaygerhard at gmail.com | mckaygerhard at gmail.com ] > wrote:

>> El jue, 1 de abr. de 2021 a la(s) 13:47, Bruce Steers
>> ( [ mailto:bsteers4 at gmail.com | 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 < [
>> > mailto:mckaygerhard at gmail.com | 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
>> >> ( [ mailto:bsteers4 at gmail.com | 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 < [
>> >> > mailto:mckaygerhard at gmail.com | 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://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 |
>> >> 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 ] ]----

> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210401/3364d12d/attachment.htm>


More information about the User mailing list