[Gambas-user] Modules

2014-09-15 Thread John Leake
Hi All,

I am really struggling with the Gambas 3 documentation.

Can anyone tell me where I can find out what constitutes a 'module'  ?

Best regards,
John Leake


--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules

2014-09-15 Thread John Leake
 A module is just a class whose all methods and properties are static. 
 It's a thing coming from Visual Basic.
 
Thank you. When and how is an instance instantiated ?

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules

2014-09-15 Thread Tobias Boege
On Mon, 15 Sep 2014, John Leake wrote:
 Hi All,
 
 I am really struggling with the Gambas 3 documentation.
 
 Can anyone tell me where I can find out what constitutes a 'module'  ?
 

See [0]:

A static class is a class whose all members are static (see below). In
Gambas, a static class is also named a module.

Regards,
Tobi

[0] http://gambaswiki.org/wiki/doc/object-model

-- 
There's an old saying: Don't change anything... ever! -- Mr. Monk

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules

2014-09-15 Thread Benoît Minisini
Le 15/09/2014 21:29, John Leake a écrit :
 A module is just a class whose all methods and properties are static.
 It's a thing coming from Visual Basic.

 Thank you. When and how is an instance instantiated ?


It's static, that means it cannot be instantiated.

-- 
Benoît Minisini

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules

2014-09-15 Thread John Leake
What scope do Functions/Subs and variables have when defined or declared
within a module ?

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules

2014-09-15 Thread Benoît Minisini
Le 15/09/2014 21:43, John Leake a écrit :
 What scope do Functions/Subs and variables have when defined or declared
 within a module ?


Private by default. It's like a class, except everything is static.

-- 
Benoît Minisini

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules

2014-09-15 Thread B Bruen
On Tue, 16 Sep 2014 00:03:22 +0200
Benoît Minisini gam...@users.sourceforge.net wrote:

 Le 15/09/2014 23:52, John Leake a écrit :
 
  Private by default. It's like a class, except everything is static.
 
  So if I have a module containing some general purpose functions that I
  wish to share across all the forms in a project,  can simply declare
  these functions as Public within the module ?
 
 
 Yes.
 
 -- 
 Benoît Minisini
 

Also, if you need to share objects around the various parts of the project you 
can declare them in the module as either public variables or (if you want to 
add some shareable features) as properties of the module.

However, remember this: As you are accessing static features you need to 
explicitly use the module name qualifier when you reference them in other code.

So for example:

in module MyUtil

Public CurrentCustomer As CCustomer

Public Sub Execute_Current_Customer(PrejudiceLevel As Integer)
  CurrentCustomer = Null
End

in, say, FMain

Public Sub Load(CustID)

  MyUtil.CurrentCustomer.Load(CustID)
  If MyUtil.CurrentCustomer.IsLatePayer then
MyUtil.Execute_Current_Customer(iExtreme)
  EndIf

etc


hth
Bruce


-- 
B Bruen adamn...@gmail.com
Note: temporary change to email address

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Modules not recognized

2011-06-30 Thread M. Cs.
I've created a module called Paper, and a PUBLIC SUB DoPrint() on it,
and when I try to invoke the module with

PUBLIC SUB myButton_Click()
 Paper.DoPrint
END

from FMain, I'm getting error Unknown identifier Paper on FMain...

Men, is this still Gambas??? This was the standard way of handling the
modules in G2. :-(

What's wrong?

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules not recognized

2011-06-30 Thread M. Cs.
Hmmm, I see the examples have no modules. Does it mean that in G3 the
modules are not working yet?


2011/6/30, M. Cs. mohar...@gmail.com:
 I've created a module called Paper, and a PUBLIC SUB DoPrint() on it,
 and when I try to invoke the module with

 PUBLIC SUB myButton_Click()
  Paper.DoPrint
 END

 from FMain, I'm getting error Unknown identifier Paper on FMain...

 Men, is this still Gambas??? This was the standard way of handling the
 modules in G2. :-(

 What's wrong?


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules not recognized

2011-06-30 Thread M. Cs.
O.K. I've discovered that the modules should be added to the sources
branch of the project!

2011/6/30, M. Cs. mohar...@gmail.com:
 Hmmm, I see the examples have no modules. Does it mean that in G3 the
 modules are not working yet?


 2011/6/30, M. Cs. mohar...@gmail.com:
 I've created a module called Paper, and a PUBLIC SUB DoPrint() on it,
 and when I try to invoke the module with

 PUBLIC SUB myButton_Click()
  Paper.DoPrint
 END

 from FMain, I'm getting error Unknown identifier Paper on FMain...

 Men, is this still Gambas??? This was the standard way of handling the
 modules in G2. :-(

 What's wrong?



--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Modules cant raise events :-(

2010-01-10 Thread bbb888

I have a module called env  that holds three system wide objects
(CurrentUser, CurrentProject, CurrentSystem).  Lots of forms access and use
these objects (Login, FMain etc etc).

I am trying to signal an unknown number of listeners when one of these
objects changes, for example is the user changes to another project.  But
modules cant raise events.

I don't want to raise the event inside the objects classes (e.g.
CurrentProject is an instance of Project) as ... actually I don't know why,
but it seems wrong (the object itself doesn't know it's changed).

I am having trouble coming up with a solution.  Can anyone suggest a
solution or a workaround?

tia
bruce
-- 
View this message in context: 
http://old.nabble.com/Modules-cant-raise-events-%3A-%28-tp27104759p27104759.html
Sent from the gambas-user mailing list archive at Nabble.com.


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules cant raise events :-(

2010-01-10 Thread Benoît Minisini
 I have a module called env  that holds three system wide objects
 (CurrentUser, CurrentProject, CurrentSystem).  Lots of forms access and use
 these objects (Login, FMain etc etc).
 
 I am trying to signal an unknown number of listeners when one of these
 objects changes, for example is the user changes to another project.  But
 modules cant raise events.
 
 I don't want to raise the event inside the objects classes (e.g.
 CurrentProject is an instance of Project) as ... actually I don't know why,
 but it seems wrong (the object itself doesn't know it's changed).
 
 I am having trouble coming up with a solution.  Can anyone suggest a
 solution or a workaround?
 
 tia
 bruce
 

If CurrentUser, CurrentProject and CurrentSystem are the objects that change, 
then they should raise the events, not the module where they are declared. 
Shouldn't they? An event is the way an object tells the world it has changed.

If you can't, then there is something not clear in your design.

Anyway, you can register your listeners in an object array in your module, and 
call specific procedures of these object references when something change. 
It's more like some sort of bus.

I did that in the IDE. For example, when the project state changes (a new 
project is loaded, the project enters debugging mode, and so on...), the same 
procedure is called on all opened forms.

Regards,

-- 
Benoît Minisini

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Modules cant raise events :-(

2010-01-10 Thread bbb888

Hi Benoit,


Benoît Minisini wrote:
 
 If CurrentUser, CurrentProject and CurrentSystem are the objects that
 change, 
 then they should raise the events, not the module where they are declared. 
 Shouldn't they? An event is the way an object tells the world it has
 changed.
 
 If you can't, then there is something not clear in your design.
 
Actually, it was something unclear in my explanation.  Its the whole
instance that gets changed, for example, FReconnect allows the user to
change the CurrentProject.  So before it exits, we have

codeenv.CurrentProject = selectedProject/code

where selectedProject is a Project instance and env has a Property
CurrentProject and

codePRIVATE SUB CurrentProject_Write(Value AS Project)
  $currentProject = Value
END/code

In other words, I am overwriting the whole instance in env (or providing a
new replacement pointer, if you prefer). So, more specifically,
$currentProject doesn't know it's been replaced.


Benoît Minisini wrote:
 Anyway, you can register your listeners in an object array in your module,
 and 
 call specific procedures of these object references when something change. 
 It's more like some sort of bus.
 
 I did that in the IDE. For example, when the project state changes (a new 
 project is loaded, the project enters debugging mode, and so on...), the
 same 
 procedure is called on all opened forms.
 

This sounds like what I may be looking for! Could you provide a bit more of
a clue where to look as there is a lot of good stuff in the IDE project...
but there is quite a lot of code too!

Finally, just out of interest, why can't modules raise events?

Regards,
bruce
-- 
View this message in context: 
http://old.nabble.com/Modules-cant-raise-events-%3A-%28-tp27104759p27105479.html
Sent from the gambas-user mailing list archive at Nabble.com.


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] modules

2009-10-25 Thread Benoît Minisini
 Benoît Minisini a écrit :
  Hi list,
 
  I wonder if it is possible to create modules dependencies in order to
  automatically load N modules when you only select one?
 
  JY
 
  You mean, when loading a module at runtime?
 
 well, both @ runtime and when beginning the project when you choose the
 components modules you need.
 ie: base_erp that calls users, clients, suppliers, docs, ... without having
 to check them.
 

I don't understand what you need: can you give more details?

-- 
Benoît Minisini

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] modules

2009-10-25 Thread Jean-Yves F. Barbier
Benoît Minisini a écrit :
 Benoît Minisini a écrit :
 Hi list,

 I wonder if it is possible to create modules dependencies in order to
 automatically load N modules when you only select one?

 JY
 You mean, when loading a module at runtime?
 well, both @ runtime and when beginning the project when you choose the
 components modules you need.
 ie: base_erp that calls users, clients, suppliers, docs, ... without having
 to check them.

 
 I don't understand what you need: can you give more details?
 
ok, I wanna make a software that is broken in different system-like modules 
(as of gb.qt, gb.gtk...) and I'd like the dependencies to be automatic
when I start another project base upon these modules

-- 

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] modules

2009-10-24 Thread Jean-Yves F. Barbier
Hi list,

I wonder if it is possible to create modules dependencies in order to
automatically load N modules when you only select one?

JY
-- 
Praise the Lord and pass the ammunition.
-- Stephen Coonts, The Minotaur

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] modules

2009-10-24 Thread Benoît Minisini
 Hi list,
 
 I wonder if it is possible to create modules dependencies in order to
 automatically load N modules when you only select one?
 
 JY
 

You mean, when loading a module at runtime?

-- 
Benoît Minisini

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] modules

2009-10-24 Thread Jean-Yves F. Barbier
Benoît Minisini a écrit :
 Hi list,

 I wonder if it is possible to create modules dependencies in order to
 automatically load N modules when you only select one?

 JY

 
 You mean, when loading a module at runtime?

well, both @ runtime and when beginning the project when you choose the
components modules you need.
ie: base_erp that calls users, clients, suppliers, docs, ... without having
to check them.

-- 
Chaos is King and Magic is loose in the world.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user