Re: [Gambas-user] static const?

2010-04-13 Thread Fabián Flores Vadell
2010/4/13 Jussi Lahtinen : >> Just in case: >> >> REPEAT >>     b = TabStrip3.Count ' In fact, this does nothing usefull >>     INC a >> UNTIL a < TabStrip3.Count OR TabStrip3[a].Caption = IdCaption > >  This doesn't make same functionality. That is why I did not want to follow the example anymore

Re: [Gambas-user] static const?

2010-04-13 Thread Jussi Lahtinen
> Just in case: > > REPEAT >     b = TabStrip3.Count ' In fact, this does nothing usefull >     INC a > UNTIL a < TabStrip3.Count OR TabStrip3[a].Caption = IdCaption This doesn't make same functionality. Because if ldCaption doesn't match to any of tabstrip captions, function will still answer

Re: [Gambas-user] static const?

2010-04-13 Thread Fabián Flores Vadell
2010/4/13 Jussi Lahtinen : > Aaa I think you meant it this way: > > PUBLIC FUNCTION ScanTab(IdCaption AS Integer) AS Integer > Dim a as Integer > Dim b as Integer > > REPEAT >   IF TabStrip3[a].Caption = IdCaption THEN >      b = TabStrip3.Count >      BREAK >   ENDIF > WHILE a < TabStrip3.Coun

Re: [Gambas-user] static const?

2010-04-13 Thread Jussi Lahtinen
Always forgetting something... "INC a". Jussi On Wed, Apr 14, 2010 at 01:59, Jussi Lahtinen wrote: > Aaa I think you meant it this way: > > PUBLIC FUNCTION ScanTab(IdCaption AS Integer) AS Integer > Dim a as Integer > Dim b as Integer > > REPEAT >   IF TabStrip3[a].Caption = IdCaption THEN

Re: [Gambas-user] static const?

2010-04-13 Thread Jussi Lahtinen
Aaa I think you meant it this way: PUBLIC FUNCTION ScanTab(IdCaption AS Integer) AS Integer Dim a as Integer Dim b as Integer REPEAT IF TabStrip3[a].Caption = IdCaption THEN b = TabStrip3.Count BREAK ENDIF WHILE a < TabStrip3.Count RETURN b END Jussi On Wed, Apr 14, 2010

Re: [Gambas-user] static const?

2010-04-13 Thread Jussi Lahtinen
First you referred to FOR loop only, but with case of return command you are talking more generally about loops? Or so I understand as you are speaking about it's influence to code structure. Consider this, if you have VERY long iteration and but you are done with first element of iteration. Then

Re: [Gambas-user] static const?

2010-04-13 Thread Fabián Flores Vadell
2010/4/13 Jussi Lahtinen : > I forgot "Dim a as integer" but you got the point. > > Jussi Yes Jussi. But my point isn't to do that the code work, it's show a bad use of language resources. -- Fabián Flores Vadell www.speedbooksargentina.blogspot.com -

Re: [Gambas-user] static const?

2010-04-13 Thread Fabián Flores Vadell
> Why shouldn't the compiler allow to modify a loop variable? It is sometimes > useful. I'm refering to the loop FOR only. IMHO, WHILE and REPEAT are good structures that allow at programmer take absolute control over iterations, objective of FOR is iterate all items of a memory structure. At leas

Re: [Gambas-user] There are errors in the class "Key", and in the events KeyPress / KeyRelease?

2010-04-13 Thread Fabián Flores Vadell
> Key.Text is not guaranteed to be set during a KeyRelease. (Do you means readed? Ok, you are look at from compiler dev perspective. Right?) Why it's in that way? >> Result Test (gb.qt) > > I think you meant gb.gtk instead. Yes. >> Issues in two real proyects (I'm trying to isolate the probl

Re: [Gambas-user] static const?

2010-04-13 Thread Jussi Lahtinen
I forgot "Dim a as integer" but you got the point. Jussi On Tue, Apr 13, 2010 at 22:29, Jussi Lahtinen wrote: > Generally bad code... > What that supposed to do? > Either it will return TabStrip3.Count or zero. > > This would do exactly same thing: > > PUBLIC FUNCTION ScanTab(IdCaption AS Integ

Re: [Gambas-user] static const?

2010-04-13 Thread Jussi Lahtinen
Generally bad code... What that supposed to do? Either it will return TabStrip3.Count or zero. This would do exactly same thing: PUBLIC FUNCTION ScanTab(IdCaption AS Integer) AS Integer FOR a = 0 TO TabStrip3.Count - 1 IF TabStrip3[a].Caption = IdCaption THEN RETURN TabStrip3.Co

Re: [Gambas-user] static const?

2010-04-13 Thread Benoît Minisini
> > No STATIC with CONST. Or maybe the compiler is more tolerant than that? > > Maybe the compiler is a too much good guy :) > > I think that the compiler shouldn't allow to do something like that: > > > PUBLIC FUNCTION ScanTab(IdCaption AS Integer) AS Integer > > DIM a AS Integer = 0 > DI

Re: [Gambas-user] static const?

2010-04-13 Thread Fabián Flores Vadell
> No STATIC with CONST. Or maybe the compiler is more tolerant than that? Maybe the compiler is a too much good guy :) I think that the compiler shouldn't allow to do something like that: PUBLIC FUNCTION ScanTab(IdCaption AS Integer) AS Integer   DIM a AS Integer = 0   DIM b AS Integer = 0   

Re: [Gambas-user] There are errors in the class "Key", and in the events KeyPress / KeyRelease?

2010-04-13 Thread Jussi Lahtinen
I wasn't very accurate... I couldn't reproduce random missed events either. Just missing Key.Code. I think that Key.Text behaviour should be consistent between GTK+ and Qt. Jussi 2010/4/13 Benoît Minisini : >> Using Gambas 2.20, Ubuntu 9.10 with KDE 4.3.5 and GTK+ libraries >> >> Key.Code is not

Re: [Gambas-user] Showing the Form's Gui

2010-04-13 Thread Ricardo Díaz Martín
If It can help to someone, this is I always do: When I'm going to open a form, I always call my own OpenForm(FormName as String, Parameters as String) sub. This sub is not inside the form I'm going to open. It's a public sub that's is inside a utilities module. OpenForm() sub create new object wi

Re: [Gambas-user] static const?

2010-04-13 Thread Benoît Minisini
> Hi everybody. > > Well, all us knows that a constant is something that can't change. > Then, constants would be class members. So, when a class is > instantiated, constants should be shared by all instances. > > The online help exclude the use of STATIC keyword in the declaration > of constants

Re: [Gambas-user] There are errors in the class "Key" , and in the events KeyPress / KeyRelease?

2010-04-13 Thread Benoît Minisini
> Using Gambas 2.20, Ubuntu 9.10 with KDE 4.3.5 and GTK+ libraries > > Key.Code is not returned? Key.Text is lost? KeyRelease is not raised? > > Put a TextBox in a Form, then write the code to catch the pressed key. > Run it and press a number o letter key. > > PUBLIC SUB TextBox1_KeyPress() >

Re: [Gambas-user] There are errors in the class "Key", and in the events KeyPress / KeyRelease?

2010-04-13 Thread Fabián Flores Vadell
> Confirmed with Gambas 2.20 rev 2890 @ Ubuntu 9.10 64bit. Thanks Jussi. In my tests the first set results corresponds to gb.gtk (erroneously I indicated gb.qt) -- Fabián Flores Vadell www.speedbooksargentina.blogspot.com

[Gambas-user] static const?

2010-04-13 Thread Fabián Flores Vadell
Hi everybody. Well, all us knows that a constant is something that can't change. Then, constants would be class members. So, when a class is instantiated, constants should be shared by all instances. The online help exclude the use of STATIC keyword in the declaration of constants, so the STATIC

Re: [Gambas-user] Showing the Form's Gui

2010-04-13 Thread Doriano Blengino
Fabien Bodard ha scritto: > 2010/4/13 Doriano Blengino : > >> Fabien Bodard ha scritto: >> >>> just remember to put a flag to say when the data are loaded ! >>> >>> >> What would be the reason for this flag? >> > if the form is showed and the data not accessible ? > Really, t

Re: [Gambas-user] Showing the Form's Gui

2010-04-13 Thread Fabien Bodard
2010/4/13 Doriano Blengino : > Fabien Bodard ha scritto: >> just remember to put a flag to say when the data are loaded ! >> > What would be the reason for this flag? if the form is showed and the data not accessible ? > >> 2010/4/13 richard terry : >> >>> On Tuesday 13 April 2010 20:50:26 Doriano

Re: [Gambas-user] There are errors in the class "Key", and in the events KeyPress / KeyRelease?

2010-04-13 Thread Jussi Lahtinen
Confirmed with Gambas 2.20 rev 2890 @ Ubuntu 9.10 64bit. With GTK+: KeyPress, Key.Code: 0 Key.Text: a KeyRealease, Key.Code: 97 Key.Text: a With Qt: KeyPress, Key.Code: 65 Key.Text: a KeyRealease, Key.Code: 65 Key.Text: <-- BTW, there seems to be space. Code used for test: PUBLIC SUB TextBox1_

Re: [Gambas-user] Showing the Form's Gui

2010-04-13 Thread Doriano Blengino
Fabien Bodard ha scritto: > just remember to put a flag to say when the data are loaded ! > What would be the reason for this flag? > 2010/4/13 richard terry : > >> On Tuesday 13 April 2010 20:50:26 Doriano Blengino wrote: >> >> Thanks doriano, that worked a treat, looks much better, will tr

Re: [Gambas-user] Showing the Form's Gui

2010-04-13 Thread Fabien Bodard
just remember to put a flag to say when the data are loaded ! 2010/4/13 richard terry : > On Tuesday 13 April 2010 20:50:26 Doriano Blengino wrote: > > Thanks doriano, that worked a treat, looks much better, will try with some > other  forms which have the same problem. > > >> richard terry ha scr

Re: [Gambas-user] Showing the Form's Gui

2010-04-13 Thread richard terry
On Tuesday 13 April 2010 20:50:26 Doriano Blengino wrote: Thanks doriano, that worked a treat, looks much better, will try with some other forms which have the same problem. > richard terry ha scritto: > > Often with forms one wants to start some processing after the form has > > loaded - in m

Re: [Gambas-user] Showing the Form's Gui

2010-04-13 Thread Doriano Blengino
richard terry ha scritto: > Often with forms one wants to start some processing after the form has loaded > - in my case, as my app is quite database intensive, it could involve loading > sometimes quite large amounts of data. > > I'd ideally like to have the form load visually, and then the data

[Gambas-user] Showing the Form's Gui

2010-04-13 Thread richard terry
Often with forms one wants to start some processing after the form has loaded - in my case, as my app is quite database intensive, it could involve loading sometimes quite large amounts of data. I'd ideally like to have the form load visually, and then the data loading to take place once the fo