Re: [Gambas-user] How do I directly access the child controls in a panel container.
On 01/10/2015 03:33 PM, Tobias Boege wrote: > On Sat, 10 Jan 2015, T Lee Davidson wrote: >>> If Panel1's containing Form is FForm, then you can do >>> >>> FForm.Controls["TextBox1"] >>> [snip] >>> >> >> Thanks for the elucidation, Tobi. But, I must be missing something. >> >> FForm.Controls["TextBox1"] returns a Control which does not have a Text >> property. >> >> .Parent ("Panel1.Parent") returns a Container which also does not have a >> Text property. >> >> If we do something like >> >> Dim hForm As Form >> If Panel1.Parent Is Form Then hForm = Panel1.Parent >> >> we would have hForm.Controls["TextBox1"], which returns a Control with no >> Text property. >> > > It returns an object *typed* as a Control. But if the object is actually a > TextBox, say, you can "cast" that Control to a TextBox, with something like > >Dim hControl As Control >Dim hTextBox As TextBox > >hControl = FForm.Controls["TextBox1"] >If hControl Is TextBox Then > hTextBox = hControl > ' ... >Endif > > Since now the type of the hTextBox variable says "TextBox", and the object > behind it has a Text property, this property can successfully be resolved. That's great, Tobi. So then Martin can do something like: Dim hForm As Form Dim hControl As Control Dim hTextBox As TextBox If Panel1.Parent Is Form Then hForm = Panel1.Parent hControl = hForm.Controls["TextBox1"] If hControl Is TextBox Then hTextBox = hControl Print hTextBox.Text Endif Endif I tried it. It works. > As for the hijacking, my bad. But I didn't understand Martin's question > either way, so let's pretend I thought this was relevant to the thread :-) Lol. Okay. :-) Lee __ "Artificial Intelligence is no match for natural stupidity." -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How do I directly access the child controls in a panel container.
On Sat, 10 Jan 2015, T Lee Davidson wrote: > > If Panel1's containing Form is FForm, then you can do > > > >FForm.Controls["TextBox1"] > > > > to have this access pattern. Since for every non-Form control, there must be > > a Form somewhere up in the parent chain, it is always an option to go up > > Panel.Parent, Panel.Parent.Parent, etc. to find the *first* container which > > is a Form and then use its Controls property as shown above. > > > > Since all controls (recursively[*]) included in a form must have different > > names, there are no name clashes by design. > > > > [*] It is not so easy if your Form embeds other Forms. If you want to, say, > > list all control names in your form, you descend recursively from the > > Form through all containers and Print their children's names. > > > > In this process, you may not descend into containers which happen to be > > Forms because another Form is a brand new namespace and you don't want > > the new names which are in there. > > > > To test whether a container is a form, you can use the Is operator[0]. > > > > Regards, > > Tobi > > > > [0] http://gambaswiki.org/wiki/lang/is > > > > Thanks for the elucidation, Tobi. But, I must be missing something. > > FForm.Controls["TextBox1"] returns a Control which does not have a Text > property. > > .Parent ("Panel1.Parent") returns a Container which also does not have a Text > property. > > If we do something like > > Dim hForm As Form > If Panel1.Parent Is Form Then hForm = Panel1.Parent > > we would have hForm.Controls["TextBox1"], which returns a Control with no > Text property. > It returns an object *typed* as a Control. But if the object is actually a TextBox, say, you can "cast" that Control to a TextBox, with something like Dim hControl As Control Dim hTextBox As TextBox hControl = FForm.Controls["TextBox1"] If hControl Is TextBox Then hTextBox = hControl ' ... Endif Since now the type of the hTextBox variable says "TextBox", and the object behind it has a Text property, this property can successfully be resolved. Note that for this trick to access non-Control properties, say Text, of an object typed as Control, you need a class which is an ancestor (in the inheritance tree) of the true class of that object and which also has that property. It does not suffice to pick an ancestor without this property or to pick a random class which also happens to have a Text property but is not an ancestor. (Like you cannot cast a Control which is actually a TextBox to a ComboBox in order to access its Text.) As for the hijacking, my bad. But I didn't understand Martin's question either way, so let's pretend I thought this was relevant to the thread :-) Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How do I directly access the child controls in a panel container.
On 01/10/2015 01:37 PM, Tobias Boege wrote: > On Sat, 10 Jan 2015, T Lee Davidson wrote: >> On 01/10/2015 11:08 AM, J?rn Erik M?rne wrote: >>> Hello, One can address a control on another form with fMain.txtHello.Text. This syntax also works for other container objects. I have a form with a panel control. There are several controls within the panel. To avoid naming conflicts I want to keep the panel controls separate from the parent form. Something like panel.txtEdit.Text would be great but, it does not work. I can get the "children" collection of the panel and get the control names. That does not help. I need to get to the control and use its properties and events. Is there a way to do this? Thanks >>> This is the way: Panel1.Children[1].Text >>> >> >> The documentation for Container.Children says that it, "Returns a collection >> [...]" But it does not return a Collection (class). >> >> That's too bad. The ability to do Panel1.Children["TextBox1"].Text would be >> nice. >> > > If Panel1's containing Form is FForm, then you can do > >FForm.Controls["TextBox1"] > > to have this access pattern. Since for every non-Form control, there must be > a Form somewhere up in the parent chain, it is always an option to go up > Panel.Parent, Panel.Parent.Parent, etc. to find the *first* container which > is a Form and then use its Controls property as shown above. > > Since all controls (recursively[*]) included in a form must have different > names, there are no name clashes by design. > > [*] It is not so easy if your Form embeds other Forms. If you want to, say, > list all control names in your form, you descend recursively from the > Form through all containers and Print their children's names. > > In this process, you may not descend into containers which happen to be > Forms because another Form is a brand new namespace and you don't want > the new names which are in there. > > To test whether a container is a form, you can use the Is operator[0]. > > Regards, > Tobi > > [0] http://gambaswiki.org/wiki/lang/is > Thanks for the elucidation, Tobi. But, I must be missing something. FForm.Controls["TextBox1"] returns a Control which does not have a Text property. .Parent ("Panel1.Parent") returns a Container which also does not have a Text property. If we do something like Dim hForm As Form If Panel1.Parent Is Form Then hForm = Panel1.Parent we would have hForm.Controls["TextBox1"], which returns a Control with no Text property. So, we seem to be right back to needing to know the integer index of the control in the container: Jørn Erik Mørne wrote, "This is the way: Panel1.Children[1].Text" I did not realize that my little comment would elicit a response, and I do not wish to hijack Martin's thread. So, unless there is a better way to access the properties of a Container's children, then it seems his question has been answered. Lee __ "Artificial Intelligence is no match for natural stupidity." -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How do I directly access the child controls in a panel container.
Am Samstag, den 10.01.2015, 13:27 -0500 schrieb T Lee Davidson: > On 01/10/2015 11:08 AM, Jørn Erik Mørne wrote: > > > >> Hello, > >> > >> > >> > >> One can address a control on another form with fMain.txtHello.Text. This > >> syntax also works for other container objects. I have a form with a panel > >> control. There are several controls within the panel. To avoid naming > >> conflicts I want to keep the panel controls separate from the parent form. > >> Something like panel.txtEdit.Text would be great but, it does not work. I > >> can get the "children" collection of the panel and get the control names. > >> That does not help. I need to get to the control and use its properties and > >> events. Is there a way to do this? > >> > >> > >> > >> Thanks > >> > > This is the way: Panel1.Children[1].Text > > > > The documentation for Container.Children says that it, "Returns a collection > [...]" But it does not return a Collection (class). > > That's too bad. The ability to do Panel1.Children["TextBox1"].Text would be > nice. > Salut, best would be Panel1.TextBox1.Text, he said it , on forms that works. -- Amicalement Charlie -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How do I directly access the child controls in a panel container.
On Sat, 10 Jan 2015, T Lee Davidson wrote: > On 01/10/2015 11:08 AM, J?rn Erik M?rne wrote: > > > >> Hello, > >> > >> > >> > >> One can address a control on another form with fMain.txtHello.Text. This > >> syntax also works for other container objects. I have a form with a panel > >> control. There are several controls within the panel. To avoid naming > >> conflicts I want to keep the panel controls separate from the parent form. > >> Something like panel.txtEdit.Text would be great but, it does not work. I > >> can get the "children" collection of the panel and get the control names. > >> That does not help. I need to get to the control and use its properties and > >> events. Is there a way to do this? > >> > >> > >> > >> Thanks > >> > > This is the way: Panel1.Children[1].Text > > > > The documentation for Container.Children says that it, "Returns a collection > [...]" But it does not return a Collection (class). > > That's too bad. The ability to do Panel1.Children["TextBox1"].Text would be > nice. > If Panel1's containing Form is FForm, then you can do FForm.Controls["TextBox1"] to have this access pattern. Since for every non-Form control, there must be a Form somewhere up in the parent chain, it is always an option to go up Panel.Parent, Panel.Parent.Parent, etc. to find the *first* container which is a Form and then use its Controls property as shown above. Since all controls (recursively[*]) included in a form must have different names, there are no name clashes by design. [*] It is not so easy if your Form embeds other Forms. If you want to, say, list all control names in your form, you descend recursively from the Form through all containers and Print their children's names. In this process, you may not descend into containers which happen to be Forms because another Form is a brand new namespace and you don't want the new names which are in there. To test whether a container is a form, you can use the Is operator[0]. Regards, Tobi [0] http://gambaswiki.org/wiki/lang/is -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How do I directly access the child controls in a panel container.
On 01/10/2015 11:08 AM, Jørn Erik Mørne wrote: > >> Hello, >> >> >> >> One can address a control on another form with fMain.txtHello.Text. This >> syntax also works for other container objects. I have a form with a panel >> control. There are several controls within the panel. To avoid naming >> conflicts I want to keep the panel controls separate from the parent form. >> Something like panel.txtEdit.Text would be great but, it does not work. I >> can get the "children" collection of the panel and get the control names. >> That does not help. I need to get to the control and use its properties and >> events. Is there a way to do this? >> >> >> >> Thanks >> > This is the way: Panel1.Children[1].Text > The documentation for Container.Children says that it, "Returns a collection [...]" But it does not return a Collection (class). That's too bad. The ability to do Panel1.Children["TextBox1"].Text would be nice. -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] For Each ?WHAT? in Result
Done. I just copied the example from the 'foreach' page. Lee __ "Artificial Intelligence is no match for natural stupidity." On 01/10/2015 07:16 AM, Caveat wrote: > But the documentation arrived at by following the enumerable link > doesn't give a fully working code example, and also doesn't document > whether the order of the enumeration is predictable, which we'd better > hope it is if you ever decide to use an "order by" clause :-D > > I'll see if have time to sign up and edit the page later, unless someone > else can already take care of this? > > Thanks and kind regards > Caveat > > On 10/01/15 11:59, Tobias Boege wrote: >> On Sat, 10 Jan 2015, Lewis Balentine wrote: >>> On 01/10/2015 03:04 AM, Caveat wrote: On 10/01/15 09:52, Lewis Balentine wrote: > Result (gb.db) > This class represents the result of a SQL request. > This class is not creatable. > This class acts like a read / write array. > This class is *enumerable* with the FOR EACH keyword. > > Guess this should be obvious but not to me pray tell what > type/class does one use to enumerate it ?? > I tried "ResultField[]" > I tried "Collection" > I tried to try "record" > As a last resort I tried String[] > Suffice it to say: I have not a clue :-\ > > > Dim MyResult as Result > Dim MyRecord as ? > > Result = Connection.Find (Something) > > For Each MyRecord in MyResult > Print MyRecord["Field1Name"] > Print MyRecord["Field2Name"] > Print MyRecord["Field3Name"] > Next > > regards, > > Lewis I presume you started here http://gambaswiki.org/wiki/comp/gb.db/result And then clicked on the big obvious link to FOR EACH, arriving here: http://gambaswiki.org/wiki/lang/foreach And then didn't look at the second example... :-P Kind regards, Caveat >>> Thank thee ... :-) >>> I did follow that path and I did miss the nuance of the second example. >>> >> Better yet, don't click on the "FOR EACH" link but on the "enumerable" link. >> This brings you to the Result-specific documentation for enumeration. You >> want to remember this because not every class is mentioned in the FOR EACH >> language documentation. >> >> As you see, Result has a different way of being enumerated. Instead of >> returning the objects in the result, a new iteration moves an internal >> cursor through the rows of the result data. This means, each execution of >> the loop body >> >> For Each hResult >> Print hResult!onefield >> Next >> >> will yield a different print (unless some rows contain the same value, of >> course). >> >> Regards, >> Tobi >> > > > -- > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How do I directly access the child controls in a panel container.
> Hello, > > > > One can address a control on another form with fMain.txtHello.Text. This > syntax also works for other container objects. I have a form with a panel > control. There are several controls within the panel. To avoid naming > conflicts I want to keep the panel controls separate from the parent form. > Something like panel.txtEdit.Text would be great but, it does not work. I > can get the "children" collection of the panel and get the control names. > That does not help. I need to get to the control and use its properties and > events. Is there a way to do this? > > > > Thanks > This is the way: Panel1.Children[1].Text -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] How do I directly access the child controls in a panel container.
Hello, One can address a control on another form with fMain.txtHello.Text. This syntax also works for other container objects. I have a form with a panel control. There are several controls within the panel. To avoid naming conflicts I want to keep the panel controls separate from the parent form. Something like panel.txtEdit.Text would be great but, it does not work. I can get the "children" collection of the panel and get the control names. That does not help. I need to get to the control and use its properties and events. Is there a way to do this? Thanks -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Column Alignment Property
You and the other members of the mailing list have been very patient, tolerant and helpful. Version 1 is a text file based Gambas console app and is currently serving the immediate need. I am working on version 2 that is database driven with a GUI interface. I think that I shall reserve fine-tuning the Data-Manager for version 3 or 4. Best Regards, Lewis Balentine On 01/10/2015 08:28 AM, Benoît Minisini wrote: > > You have three "patterns" in Gambas to solve your problem (extending the > behaviour of a control): the Observer class, the Object.Attach() method, > and inheritance. > > If you are new to OOP, then you should read the "Gambas object model" > document on the wiki slowly, carefully and many times, until you > understand these three "patterns". > > I have to leave, I can't explain more now. > > Regards, > -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Column Alignment Property
Le 10/01/2015 15:13, Lewis Balentine a écrit : > My application is sort of a mini-datamanager where the end user > determine which tables/fields they need/want to access. The application > generates the datasources and dataviews at run time. Each table is > displayed in its own tab of a Tabstrip /(small screen shot attached)/. > There are two tables in the DB that hold the parameters for the run-time > tabs. > > My OOP competency level is marginal :-[ > I am actually amazed that I have made as much progress with this as I have. > > *Correct me if I am wrong: * > The event handler would have to be created at design time. > Thus I would need to create a new control class that inherits dataview. > > Lewis > You have three "patterns" in Gambas to solve your problem (extending the behaviour of a control): the Observer class, the Object.Attach() method, and inheritance. If you are new to OOP, then you should read the "Gambas object model" document on the wiki slowly, carefully and many times, until you understand these three "patterns". I have to leave, I can't explain more now. Regards, -- Benoît Minisini -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Column Alignment Property
My application is sort of a mini-datamanager where the end user determine which tables/fields they need/want to access. The application generates the datasources and dataviews at run time. Each table is displayed in its own tab of a Tabstrip /(small screen shot attached)/. There are two tables in the DB that hold the parameters for the run-time tabs. My OOP competency level is marginal :-[ I am actually amazed that I have made as much progress with this as I have. *Correct me if I am wrong: * The event handler would have to be created at design time. Thus I would need to create a new control class that inherits dataview. Lewis On 01/10/2015 07:08 AM, Benoît Minisini wrote: The DataView control (normally) raises a Data event for each cell it draws. In the event handler, you can use the DataView.Data property to modifiy the contents of the cell just before it is drawn, exactly like the Data event of the TableView control. Then you can change how the cell value is drawn, the alignment, the colors... Regards, -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Order By Clause
Is there any way to sneak an "order by" clause into a Datasource or Dataview. I did try putting a complete SQL statement in place of the Table name but that results in a read-only result regardless of the value of the Datasource.ReadOnly property. I know I can set the Sort poperty true to allow resorting by a particular column but I would like to have control of initial order by a combination of columns (i.e "order by StartDateTime, Channel, Status"). Regards, Lewis Balentine -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Column Alignment Property
Le 10/01/2015 12:54, Lewis Balentine a écrit : > I changed my Integers to Longs and set limits on the length of most of > the strings. > I do have a suggestion if you get around to working on this: > add a property to the columns to hold a format$ > > examples: > Dataview.View.Columns[?].Format="mm/dd/" > Dataview.View.Columns[?].Format="dd mmm " > > This would be handy particularly where a date is stored with no real > time portion. > Dates are displayed as: mm/dd/ hh:nn:ss > Example: > 21 January 2015 displays as 01/21/2015 00:00:00 > > There are probably other circumstances where it would be useful. > > Now someone is going to tell me that capability has already implemented > and I have missed reading the proper link again. :-) > > Cheers, > > Lewis > > The DataView control (normally) raises a Data event for each cell it draws. In the event handler, you can use the DataView.Data property to modifiy the contents of the cell just before it is drawn, exactly like the Data event of the TableView control. Then you can change how the cell value is drawn, the alignment, the colors... Regards, -- Benoît Minisini -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Issue 594 in gambas: Container Panel Alineamiento
Updates: Status: Invalid Comment #1 on issue 594 by benoit.m...@gmail.com: Container Panel Alineamiento https://code.google.com/p/gambas/issues/detail?id=594 Sorry, I can't speak spanish. Please write your bug report in english. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] OpenGl - 'Not an Object' - solved
Sorry, guys. Finally worked out the issue - I'd redefined 'gl' as an integer deep in some old code - the whole project was converted from VB6 when gl had no meaning. I was searching for gl. (with a dot) to avoid other references inside longer expressions. So panic over. -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] For Each ?WHAT? in Result
I does work as expected with the "order by clause". On 01/10/2015 06:16 AM, Caveat wrote: > But the documentation arrived at by following the enumerable link > doesn't give a fully working code example, and also doesn't document > whether the order of the enumeration is predictable, which we'd better > hope it is if you ever decide to use an "order by" clause :-D > > I'll see if have time to sign up and edit the page later, unless someone > else can already take care of this? > > Thanks and kind regards > Caveat > > -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] For Each ?WHAT? in Result
But the documentation arrived at by following the enumerable link doesn't give a fully working code example, and also doesn't document whether the order of the enumeration is predictable, which we'd better hope it is if you ever decide to use an "order by" clause :-D I'll see if have time to sign up and edit the page later, unless someone else can already take care of this? Thanks and kind regards Caveat On 10/01/15 11:59, Tobias Boege wrote: > On Sat, 10 Jan 2015, Lewis Balentine wrote: >> On 01/10/2015 03:04 AM, Caveat wrote: >>> On 10/01/15 09:52, Lewis Balentine wrote: Result (gb.db) This class represents the result of a SQL request. This class is not creatable. This class acts like a read / write array. This class is *enumerable* with the FOR EACH keyword. Guess this should be obvious but not to me pray tell what type/class does one use to enumerate it ?? I tried "ResultField[]" I tried "Collection" I tried to try "record" As a last resort I tried String[] Suffice it to say: I have not a clue :-\ Dim MyResult as Result Dim MyRecord as ? Result = Connection.Find (Something) For Each MyRecord in MyResult Print MyRecord["Field1Name"] Print MyRecord["Field2Name"] Print MyRecord["Field3Name"] Next regards, Lewis >>> I presume you started here http://gambaswiki.org/wiki/comp/gb.db/result >>> And then clicked on the big obvious link to FOR EACH, arriving here: >>> http://gambaswiki.org/wiki/lang/foreach >>> And then didn't look at the second example... :-P >>> >>> Kind regards, >>> Caveat >>> >> Thank thee ... :-) >> I did follow that path and I did miss the nuance of the second example. >> > Better yet, don't click on the "FOR EACH" link but on the "enumerable" link. > This brings you to the Result-specific documentation for enumeration. You > want to remember this because not every class is mentioned in the FOR EACH > language documentation. > > As you see, Result has a different way of being enumerated. Instead of > returning the objects in the result, a new iteration moves an internal > cursor through the rows of the result data. This means, each execution of > the loop body > >For Each hResult > Print hResult!onefield >Next > > will yield a different print (unless some rows contain the same value, of > course). > > Regards, > Tobi > -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Column Alignment Property
I changed my Integers to Longs and set limits on the length of most of the strings. I do have a suggestion if you get around to working on this: add a property to the columns to hold a format$ examples: Dataview.View.Columns[?].Format="mm/dd/" Dataview.View.Columns[?].Format="dd mmm " This would be handy particularly where a date is stored with no real time portion. Dates are displayed as: mm/dd/ hh:nn:ss Example: 21 January 2015 displays as 01/21/2015 00:00:00 There are probably other circumstances where it would be useful. Now someone is going to tell me that capability has already implemented and I have missed reading the proper link again. :-) Cheers, Lewis On 01/09/2015 07:55 PM, Benoît Minisini wrote: > Le 09/01/2015 11:11, Lewis Balentine a écrit : >> It appears to me that the Column Alignment Property does not work for >> some types. >> > It's the DataView that override column alignments with cell specific > alignments for Integer, Float, and unlimited String fields. I'm admit > it's not very coherent... > > At the moment there is no way to know if the user has specified a > specific alignment somewhere. > > Laybe I should create a property that would tell DataView if it should > override or not the alignment? > -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] For Each ?WHAT? in Result
On Sat, 10 Jan 2015, Lewis Balentine wrote: > On 01/10/2015 03:04 AM, Caveat wrote: > > On 10/01/15 09:52, Lewis Balentine wrote: > >> Result (gb.db) > >> This class represents the result of a SQL request. > >> This class is not creatable. > >> This class acts like a read / write array. > >> This class is *enumerable* with the FOR EACH keyword. > >> > >> Guess this should be obvious but not to me pray tell what > >> type/class does one use to enumerate it ?? > >> I tried "ResultField[]" > >> I tried "Collection" > >> I tried to try "record" > >> As a last resort I tried String[] > >> Suffice it to say: I have not a clue :-\ > >> > >> > >> Dim MyResult as Result > >> Dim MyRecord as ? > >> > >> Result = Connection.Find (Something) > >> > >> For Each MyRecord in MyResult > >>Print MyRecord["Field1Name"] > >> Print MyRecord["Field2Name"] > >> Print MyRecord["Field3Name"] > >> Next > >> > >> regards, > >> > >> Lewis > > > > I presume you started here http://gambaswiki.org/wiki/comp/gb.db/result > > And then clicked on the big obvious link to FOR EACH, arriving here: > > http://gambaswiki.org/wiki/lang/foreach > > And then didn't look at the second example... :-P > > > > Kind regards, > > Caveat > > > > Thank thee ... :-) > I did follow that path and I did miss the nuance of the second example. > Better yet, don't click on the "FOR EACH" link but on the "enumerable" link. This brings you to the Result-specific documentation for enumeration. You want to remember this because not every class is mentioned in the FOR EACH language documentation. As you see, Result has a different way of being enumerated. Instead of returning the objects in the result, a new iteration moves an internal cursor through the rows of the result data. This means, each execution of the loop body For Each hResult Print hResult!onefield Next will yield a different print (unless some rows contain the same value, of course). Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Fieldlist output differs (extended)
Am Samstag, den 10.01.2015, 02:51 +0100 schrieb Benoît Minisini: > As for Eval, I don't understand your question. > > Eval() evaluates Gambas expressions, it has nothing to do with case > sensitive by itself. > > It's the Gambas keyword that are case unsensitive. > Salut Benoît, I add the . to a collection, where I have to replace the dot by an underscore. This collection I pass to Eval() lets say I pass this expression :iif(Employee_Name,Employee_Name,'unknown') Works well for mysql and sqlite but postgres has only a 'Employee_name'. Upps : understand now, it is not Eval(), Eval just hides the Error message, right. For the "AS" keyword, Name results from an "AS" Thanks anyway -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] For Each ?WHAT? in Result
Thank thee ... :-) I did follow that path and I did miss the nuance of the second example. On 01/10/2015 03:04 AM, Caveat wrote: > I presume you started here http://gambaswiki.org/wiki/comp/gb.db/result > And then clicked on the big obvious link to FOR EACH, arriving here: > http://gambaswiki.org/wiki/lang/foreach > And then didn't look at the second example... :-P > > Kind regards, > Caveat > > On 10/01/15 09:52, Lewis Balentine wrote: >> Result (gb.db) >> This class represents the result of a SQL request. >> This class is not creatable. >> This class acts like a read / write array. >> This class is *enumerable* with the FOR EACH keyword. >> >> Guess this should be obvious but not to me pray tell what >> type/class does one use to enumerate it ?? >> I tried "ResultField[]" >> I tried "Collection" >> I tried to try "record" >> As a last resort I tried String[] >> Suffice it to say: I have not a clue :-\ >> >> >> Dim MyResult as Result >> Dim MyRecord as ? >> >> Result = Connection.Find (Something) >> >> For Each MyRecord in MyResult >>Print MyRecord["Field1Name"] >> Print MyRecord["Field2Name"] >> Print MyRecord["Field3Name"] >> Next >> >> regards, >> >> Lewis >> -- >> Dive into the World of Parallel Programming! The Go Parallel Website, >> sponsored by Intel and developed in partnership with Slashdot Media, is your >> hub for all things parallel software development, from weekly thought >> leadership blogs to news, videos, case studies, tutorials and more. Take a >> look and join the conversation now. http://goparallel.sourceforge.net >> ___ >> Gambas-user mailing list >> Gambas-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-user >> > > -- > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] For Each ?WHAT? in Result
I presume you started here http://gambaswiki.org/wiki/comp/gb.db/result And then clicked on the big obvious link to FOR EACH, arriving here: http://gambaswiki.org/wiki/lang/foreach And then didn't look at the second example... :-P Kind regards, Caveat On 10/01/15 09:52, Lewis Balentine wrote: > Result (gb.db) > This class represents the result of a SQL request. > This class is not creatable. > This class acts like a read / write array. > This class is *enumerable* with the FOR EACH keyword. > > Guess this should be obvious but not to me pray tell what > type/class does one use to enumerate it ?? > I tried "ResultField[]" > I tried "Collection" > I tried to try "record" > As a last resort I tried String[] > Suffice it to say: I have not a clue :-\ > > > Dim MyResult as Result > Dim MyRecord as ? > > Result = Connection.Find (Something) > > For Each MyRecord in MyResult > Print MyRecord["Field1Name"] > Print MyRecord["Field2Name"] > Print MyRecord["Field3Name"] > Next > > regards, > > Lewis > -- > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] For Each ?WHAT? in Result
Result (gb.db) This class represents the result of a SQL request. This class is not creatable. This class acts like a read / write array. This class is *enumerable* with the FOR EACH keyword. Guess this should be obvious but not to me pray tell what type/class does one use to enumerate it ?? I tried "ResultField[]" I tried "Collection" I tried to try "record" As a last resort I tried String[] Suffice it to say: I have not a clue :-\ Dim MyResult as Result Dim MyRecord as ? Result = Connection.Find (Something) For Each MyRecord in MyResult Print MyRecord["Field1Name"] Print MyRecord["Field2Name"] Print MyRecord["Field3Name"] Next regards, Lewis -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user