[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Global Variable
[Thread Prev] | [Thread Next]
- Subject: Re: Global Variable
- From: Brian G <brian@xxxxxxxxxxxxxxxx>
- Date: Thu, 19 Feb 2026 09:11:49 -0800
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Just to rabble rouse.... env["xx"] -> global array .. lolGlobal arrays/collections are possible, they are variables I guess, could be any type of array
class globalValueArray ' Gambas class file Static varfile As New Collection(gb.ignorecase) Static Public Sub _init() varfile.default = "" End Static Public Sub _get(name As String) As Variant Return varfile[name] End Static Public Sub _put(value As Variant, name As String) varfile[name] = value End end class Public Sub Main() Print "Hello world" Print Env["SHELL"] ' global array ' Global Array/Collections globalValueArray["hexit"] = "hello world" Print globalValueArray["hexit"] End On 2/19/26 02:22, Gianluigi wrote:
Il 19/02/26 11:06, Benoît Minisini ha scritto:Le 19/02/2026 à 10:40, Gianluigi a écrit :Sorry, Benoit, you need to please resolve a forum discussion.I maintain that in Gambas, unlike other languages, there is no such thing as a global variable (i.e., a variable you can access anywhere in the project by name alone). Global Variables exist only at the module (or class) level. A Global Variable in Gambas can be Static, Private (visible everywhere but only in the module where it was declared), or Public (visible everywhere in the project). If the Global Variable is Public (being at the module level), if called in another class or module, it must be preceded by the name of the module in which it was declared.Am I mistaken or missing something? Thanks for your attention. Regards GianluigiIt seems right to me. What could be the matter of arguing about that?Thank you so much.You find meaning in aging: the older you get, the more you feel like a child again :-)Best regards Gianluigi
-- ~~~~ Brian
Attachment:
OpenPGP_0x78BFB26402F48419.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
| Re: Global Variable | Gianluigi <gradobag@xxxxxxxxxxx> |
| Global Variable | Gianluigi <gradobag@xxxxxxxxxxx> |
| Re: Global Variable | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
| Re: Global Variable | Gianluigi <gradobag@xxxxxxxxxxx> |