[Gambas-user] DataSource & DataBrowser problem
As I previously said, when I add a new row (by first clicking the New button in my DataBrowser control) / change data displayed in my DataBrowser control and then click the save button (in my DataBrowser control), it comes up with a dialog box saying 'Connection not opened' with OK button only (and clicking OK does not result in saving). The Editable property is set to true. Has anybody successfully used the Save button in a DataBrowser control in Gambas3? -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] DataSource & DataBrowser problem
My DataBrowser control saved automatic, you can not press save. 10.02.2012, 16:44, "John Rose" : > As I previously said, when I add a new row (by first clicking the New > button in my DataBrowser control) / change data displayed in my > DataBrowser control and then click the save button (in my DataBrowser > control), it comes up with a dialog box saying 'Connection not opened' > with OK button only (and clicking OK does not result in saving). The > Editable property is set to true. Has anybody successfully used the Save > button in a DataBrowser control in Gambas3? > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- С уважением, Беспалов Алексей. -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Issue 207 in gambas: Event Save get error at DataBrowser
Comment #1 on issue 207 by john.aaron.r...@gmail.com: Event Save get error at DataBrowser http://code.google.com/p/gambas/issues/detail?id=207 When I try to Save after adding/changing rows , I get a dialog box saying 'Connection not opened' with OK button only (and clicking OK does not result in saving). This is on a SQLite3 database. [OperatingSystem] OperatingSystem=Linux KernelRelease=2.6.32-38-generic DistributionVendor=Ubuntu DistributionRelease="Ubuntu 10.04.3 LTS" [System] CPUArchitecture=i686 TotalRam=1930772 kB Desktop=Gnome [Gambas] Gambas1=Not Installed Gambas2=Not Installed Gambas3=3.0.90 Gambas3Path=/usr/local/bin/gbx3 -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Gambas bug?
Hi. When I execute this: Print Object.Call(["John", "Peter"], "Count") I get an error like this: "Count Symbol unknown in the String []" Thanks in advance. -- Fabián Flores Vadell www.comoprogramarcongambas.blogspot.com www.speedbooksargentina.blogspot.com -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
First, what are you trying to do? -- Original Message --- From: Fabián Flores Vadell To: mailing list for gambas users Sent: Fri, 10 Feb 2012 16:39:12 -0300 Subject: [Gambas-user] Gambas bug? > Hi. > > When I execute this: > > Print Object.Call(["John", "Peter"], "Count") > > I get an error like this: > > "Count Symbol unknown in the String []" > > Thanks in advance. > > -- > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user --- End of Original Message --- -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
2012/2/10 nando > First, what are you trying to do?-- > I'm trying to find a design pattern that allows me to use the introspective features of Gambas to avoid the boring work consisting in write (in a class) the signatures of some methods that belong to one of its collaborators (that I need to expose). In this case, I need to expose some methods from an array in my class, but I don't want to write the wrapper signatures, e.g.: Public Sub Add(somethig As type) myArray.Add(something) End Fabián Flores Vadell www.comoprogramarcongambas.blogspot.com www.speedbooksargentina.blogspot.com -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
Can't you just store the array in an "Object", then each calls are dispatched? Dim o As Object o = the_array o.Add(whatever) /Emil 2012/2/10 Fabián Flores Vadell > 2012/2/10 nando > > > First, what are you trying to do?-- > > > > > I'm trying to find a design pattern that allows me to use the introspective > features of Gambas to avoid the boring work consisting in write (in a > class) the signatures of some methods that belong to one of its > collaborators (that I need to expose). > In this case, I need to expose some methods from an array in my class, but > I don't want to write the wrapper signatures, e.g.: > > Public Sub Add(somethig As type) > myArray.Add(something) > End > > > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Issue 209 in gambas: Inheritance and translatable constant strings does not work
Status: New Owner: Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any Desktop-Any GUI-Any New issue 209 by emil.len...@gmail.com: Inheritance and translatable constant strings does not work http://code.google.com/p/gambas/issues/detail?id=209 1) Describe the problem. Let's say you have a base class with a string constant that is not translatable. If you now inherit the class and override the string constant with a translatable string, the translated version of the string is not always used. The problem is caused by an optimization in gbx_exec_push.c 2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate): Version: TRUNK Revision: r4463 3) Provide a little project that reproduces the bug or the crash. Class1: Public Const ConstString As String = "hello" Class2: Inherits Class1 Public Const ConstString As String = ("hello2") And the code: Dim i As Integer Dim e As Class1 For i = 1 To 2 If i = 1 Then e = New Class1 Else e = New Class2 End If Print e.ConstString Next 5) Explain clearly how to reproduce the bug or the crash. Mark the project as translatable, and translate the string "hello2". The program will output: hello hello2 and NOT the translated version of hello2. It is same problem when the base class has a translatable string, but the inherited marks the string as non-translatable. -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
You probably get the error because Count is a property and not a method. There is a Object.GetProperty method you can use instead ;) Print Object.GetProperty(["John", "Peter"], "Count") /Emil 2012/2/10 Fabián Flores Vadell > Hi. > > When I execute this: > > Print Object.Call(["John", "Peter"], "Count") > > I get an error like this: > > "Count Symbol unknown in the String []" > > Thanks in advance. > > -- > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
2012/2/10 Emil Lenngren > You probably get the error because Count is a property and not a method. > > There is a Object.GetProperty method you can use instead ;) > > Print Object.GetProperty(["John", "Peter"], "Count") > Thanks Emil. It seems to me like the encapsulation is broken because I need to be conscious of the implementation (property or method) in order to pass the message that I want. That could not be a great problem in the daily programming, but to programming in a reflexive way it seems to me inflexible. What you think? > -- > Fabián Flores Vadell www.comoprogramarcongambas.blogspot.com www.speedbooksargentina.blogspot.com -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
You can check whether it is property or method. Dim hCls As Class = Object.Class(["John", "Peter"]) If hCls["Count"].Kind = Class.Method Then ... Jussi 2012/2/10 Fabián Flores Vadell > 2012/2/10 Emil Lenngren > > > You probably get the error because Count is a property and not a method. > > > > There is a Object.GetProperty method you can use instead ;) > > > > Print Object.GetProperty(["John", "Peter"], "Count") > > > > Thanks Emil. > > It seems to me like the encapsulation is broken because I need to be > conscious of the implementation (property or method) in order to pass the > message that I want. > > That could not be a great problem in the daily programming, but to > programming in a reflexive way it seems to me inflexible. > > What you think? > > > > -- > > > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
Did the Object solution not solve your problem? It should work in all cases when the name of the function/property is the same at all calls/property readings. If you use different symbol names each time, maybe you can use something like this: Try Return Object.GetProperty(object, name) Catch Return Object.Call(object, name) But you probably should try another code design if you really need this kind of code ;) /Emil 2012/2/10 Fabián Flores Vadell > 2012/2/10 Emil Lenngren > > > You probably get the error because Count is a property and not a method. > > > > There is a Object.GetProperty method you can use instead ;) > > > > Print Object.GetProperty(["John", "Peter"], "Count") > > > > Thanks Emil. > > It seems to me like the encapsulation is broken because I need to be > conscious of the implementation (property or method) in order to pass the > message that I want. > > That could not be a great problem in the daily programming, but to > programming in a reflexive way it seems to me inflexible. > > What you think? > > > > -- > > > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
2012/2/10 Jussi Lahtinen > You can check whether it is property or method. > > Dim hCls As Class = Object.Class(["John", "Peter"]) > > If hCls["Count"].Kind = Class.Method Then > Yes, I figured out. Thanks Jussi -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Help for Image and Picture Colors
Le 06/02/2012 21:19, tobias a écrit : > hi, > > Benoît Minisini wrote: >> Le 04/02/2012 01:19, tobias a écrit : >>> On 04.02.2012 01:12, tobias wrote: Hi, I really need help. There's a lot of work with colors in Images and Pictures in a project and between these classes. This is generally speaking as follows: I have a class which has an 8*8px Image which is manipulated (due to the easy of accessing pixels directly). Using a property of my class, I provide access to a scaled version of the Image as a Picture (which is created when requested). So I do some things and when manually resizing the Image to get the prototype of the Picture to return (it is needed as bigger version of the Image without anti-aliasing, I don't get this result with Image.Stretch(), and doing it manually is not a problem) there seem to appear problems with transparency. I read that Pictures do not have an alpha channel and I noticed that colors from the ColorChooser or Color class are given with alpha channel set to 0x00 which will be transparent for the Image class... so I tried adding&Hff00&to whatever color is assigned to any pixel in the 8*8px Image or not to do it and some other experiments but nothing worked on the entire project. there's always something transparent or black or whatever. I really go nuts with this. Anyone to my rescue? Regards, Tobi >>> wait a minute. I forgot to say that I don't even need the transparency >>> feature of the Image class. I only use Image - as I said - because of >>> Image[x, y] pixel access. For the meantime - or as a final solution? >>> there may be a lot of those accesses and I thought using Image[x, y] >>> will be the most efficient way to go - I switch to using an 8*8px >>> Picture and Draw.Pixel() instead but I would really appreciate anyone >>> clarify this topic to me. >>> >> >> I understand nothing. Maybe because I'm a little sick, but if you can be >> clearer... >> > > it's a messy explanation, i just recalled too... > > the situation is as follows: i have a class that takes care of designing > a picture for me according to user input. because of the ease of > accessing pixels with the image class i took an image behind the scenes > but it has to be converted to a picture for display in a PictureBox at > the front end. moreover it has to be resized which i do manually and is > no big deal for my format. i used to import pictures and images into the > class, etc. which overall introduces as big back and forth of image<-> > picture conversion, resizing, etc. > the problem first came up when i incorporated palettes created by > another program and stored in binary files. i noticed that these were in > ARGB format with the A component set to 0x00 all the time (colors came > from a ColorChooser, later i noticed that the constants in the Color > class do likewise). while this works (color is displayed) when drawing > it to a picture, it doesn't when writing it to an image pixel. i tried > conversion functions and everything that came in my mind. > at the end i rewrote the class to use pictures. those pictures are > created with the Transparent = False instanciation parameter. from those > i can derive Picture.Image on which i operate to speed things up. > this is sort of solved and the program works fine now. > > i seem to repress the memory of what i tried (pathetic programmer's > brain :) ) but i can tell that nothing worked on the entire project > (which was certainly a fault due to my quick fixes or project > infrastructure) but to clarify things: > it resulted in transparency in all kinds of places in the whole program > originally introduced by reading colors from standard components that > had their alpha channel zeroed which according to the docs signaled the > image class that this color is fully transparent. > > i hope it didn't get as complicated but recalling the situation pointed > me to the fact that actually i do not know why it is working now (seems > to rely on the Transparent = False picture instanciation?)... > > regards, > tobi > Mff... If you need to create a Picture, start from an Image, and convert it to a Picture at the last step. Do not use the Transparent property of Pictures. As for transparency: it is inverted between pixels in memory and Gambas color values. If you use the Image class and the [] operator, then this is taken into account transparently. This is all I can say: I hope it will help you! -- Benoît Minisini -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.ne
Re: [Gambas-user] Help for Image and Picture Colors
On Fri, 10 Feb 2012, Benoît Minisini wrote: > Le 06/02/2012 21:19, tobias a écrit : > > hi, > > > > Benoît Minisini wrote: > >> Le 04/02/2012 01:19, tobias a écrit : > >>> On 04.02.2012 01:12, tobias wrote: > Hi, > > I really need help. There's a lot of work with colors in Images and > Pictures in a project and between these classes. This is generally > speaking as follows: I have a class which has an 8*8px Image which is > manipulated (due to the easy of accessing pixels directly). Using a > property of my class, I provide access to a scaled version of the Image > as a Picture (which is created when requested). So I do some things and > when manually resizing the Image to get the prototype of the Picture to > return (it is needed as bigger version of the Image without > anti-aliasing, I don't get this result with Image.Stretch(), and doing > it manually is not a problem) there seem to appear problems with > transparency. I read that Pictures do not have an alpha channel and I > noticed that colors from the ColorChooser or Color class are given with > alpha channel set to 0x00 which will be transparent for the Image > class... so I tried adding&Hff00&to whatever color is assigned to > any pixel in the 8*8px Image or not to do it and some other experiments > but nothing worked on the entire project. there's always something > transparent or black or whatever. I really go nuts with this. Anyone to > my rescue? > > Regards, > Tobi > >>> wait a minute. I forgot to say that I don't even need the transparency > >>> feature of the Image class. I only use Image - as I said - because of > >>> Image[x, y] pixel access. For the meantime - or as a final solution? > >>> there may be a lot of those accesses and I thought using Image[x, y] > >>> will be the most efficient way to go - I switch to using an 8*8px > >>> Picture and Draw.Pixel() instead but I would really appreciate anyone > >>> clarify this topic to me. > >>> > >> > >> I understand nothing. Maybe because I'm a little sick, but if you can be > >> clearer... > >> > > > > it's a messy explanation, i just recalled too... > > > > the situation is as follows: i have a class that takes care of designing > > a picture for me according to user input. because of the ease of > > accessing pixels with the image class i took an image behind the scenes > > but it has to be converted to a picture for display in a PictureBox at > > the front end. moreover it has to be resized which i do manually and is > > no big deal for my format. i used to import pictures and images into the > > class, etc. which overall introduces as big back and forth of image<-> > > picture conversion, resizing, etc. > > the problem first came up when i incorporated palettes created by > > another program and stored in binary files. i noticed that these were in > > ARGB format with the A component set to 0x00 all the time (colors came > > from a ColorChooser, later i noticed that the constants in the Color > > class do likewise). while this works (color is displayed) when drawing > > it to a picture, it doesn't when writing it to an image pixel. i tried > > conversion functions and everything that came in my mind. > > at the end i rewrote the class to use pictures. those pictures are > > created with the Transparent = False instanciation parameter. from those > > i can derive Picture.Image on which i operate to speed things up. > > this is sort of solved and the program works fine now. > > > > i seem to repress the memory of what i tried (pathetic programmer's > > brain :) ) but i can tell that nothing worked on the entire project > > (which was certainly a fault due to my quick fixes or project > > infrastructure) but to clarify things: > > it resulted in transparency in all kinds of places in the whole program > > originally introduced by reading colors from standard components that > > had their alpha channel zeroed which according to the docs signaled the > > image class that this color is fully transparent. > > > > i hope it didn't get as complicated but recalling the situation pointed > > me to the fact that actually i do not know why it is working now (seems > > to rely on the Transparent = False picture instanciation?)... > > > > regards, > > tobi > > > > Mff... If you need to create a Picture, start from an Image, and convert > it to a Picture at the last step. Do not use the Transparent property of > Pictures. > > As for transparency: it is inverted between pixels in memory and Gambas > color values. If you use the Image class and the [] operator, then this > is taken into account transparently. > > This is all I can say: I hope it will help you! > > -- > Benoît Minisini > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - b
Re: [Gambas-user] Gambas bug?
2012/2/10 Emil Lenngren > Did the Object solution not solve your problem? It should work in all cases > when the name of the function/property is the same at all calls/property > readings. > II want to write just one method that allow me to call whatever method I could need from one collaborator (the array in this case). That is why I think that this approach will not work. > If you use different symbol names each time, maybe you can use something > like this: > Try > Return Object.GetProperty(object, name) > Catch > Return Object.Call(object, name) > To check or to catch. That is the question. :) > But you probably should try another code design if you really need this > kind of code ;) > > /Emil > Humm. I want to avoid the need to write a wrapper for each method that I need expose from the "helper" class. The easy way is to move the fingers faster. But eventually that will become in a disease. (the issue of the carpal tunnel) :) But, if you knows a better way to do that, please let me know. Thank you. Fabián -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
2012/2/10 Fabián Flores Vadell > 2012/2/10 Emil Lenngren > >> Did the Object solution not solve your problem? It should work in all >> cases >> when the name of the function/property is the same at all calls/property >> readings. >> > > II want to write just one method that allow me to call whatever method I > could need from one collaborator (the array in this case). That is why I > think that this approach will not work. > whatever method or property, that's what i meant. > -- > Fabián Flores Vadell www.comoprogramarcongambas.blogspot.com www.speedbooksargentina.blogspot.com -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
Can you give some examples how you mean? What do you need wrappers for? I don't think I understand fully what you mean, but it seems interesting :) /Emil 2012/2/10 Fabián Flores Vadell > 2012/2/10 Fabián Flores Vadell > > > 2012/2/10 Emil Lenngren > > > >> Did the Object solution not solve your problem? It should work in all > >> cases > >> when the name of the function/property is the same at all calls/property > >> readings. > >> > > > > II want to write just one method that allow me to call whatever method I > > could need from one collaborator (the array in this case). That is why I > > think that this approach will not work. > > > > whatever method or property, that's what i meant. > > > > > -- > > > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] extern library
Le 05/02/2012 18:42, Wally a écrit : > talking about Gambas 3: > > When i place my library to /usr/local/lib and run ldconfig it works and > my_gb3_project can find the lib and its functions. > When i put it into my_gb3_project folder the library can not be found. > Where to place the library ganbas3 may find it ? It should work. Can you send me a little project with your library inside so that I can check what happens exactly? -- Benoît Minisini -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
2012/2/10 Emil Lenngren > Can you give some examples how you mean? > What do you need wrappers for? > I don't think I understand fully what you mean, but it seems interesting :) > > /Emil > I would like to show you an example, but I can't. If I did, I would have to kill you. :P There is a foolish example: '* ' Class Person '* $FirstName As String $LastName As String Property Read FirstName As String Property Read LastName As String Public Sub _new(fname As String, lname As String) $FirstName = fname $LastName = lname End Private Function FirstName_Read() As String Return $FirstName End Private Function LastName_Read() As String Return $LastName End '* ' PeopleList class '* 'aPeople is a collaborator from which I want to expose some methods (by the PeopleList message protocol) Private $aPeople As New Person[] 'The Call method implement the "instrospective call" "pattern" (okay, I just made it up... but it works!) Public Sub Call(aMethodName As String, Optional arguments As Array = Null) As Variant Dim result As Variant If Not [Add, Clear, Count, Insert, {Max}].Exist(aMethodName) Then Return Object.Call($aPeople, aMethodName, arguments) Catch Return Object.GetProperty($aPeople, aMethodName) End 'I want avoid code like this: ' Public Sub Add(aPerson As Person) ' $aPeople.Add(aPerson) ' End ' ' Public Sub Insert(arrayPerson As Person[]) ' $aPeople.Insert(arrayPerson) ' End ' ' Public Sub Clear() ' $aPeople.Clear ' End ' ' Property Read Max ' ' Private Function Max_Read() ' $aPeople.Max ' End ' 'and so on 'More methods for PeopleList: Public Sub PrintList() Dim aPerson As Person For Each aPerson In $aPeople Print aPerson.FirstName & ", " & aPerson.LastName Next End '** ' Test Class '** Static Public Sub Main() Dim aPeopleList As New PeopleList Dim MaxItems As Integer Dim Person1, Person2, Person3, Person4 As Person Dim Person5, Person6, Person7, Person8 As Person Person1 = New Person("Carlos", "Delfino") Person2 = New Person("Lionel", "Messi") Person3 = New Person("Luis", "Scola") Person4 = New Person("Emmanuel", "Ginóbili") 'Here are introspective calls: With aPeopleList 'Very ugly sintactically, but that is all we got .Call(.Insert, [[Person1, Person2, Person3]]) .Call(.Add, [Person4]) End With Person5 = New Person("Jhon", "Doe") Person6 = New Person("Jane", "Doe") Person7 = New Person("Nobody", "Gates") Person8 = New Person("Genius", "Minisini") 'Here are introspective calls: With aPeopleList .Call(.Insert, [[Person5, Person6, Person7], .Call(.Max)]) .Call(.Add, [Person8]) Print .Call(.Count) End With aPeopleList.PrintList End > -- > Fabián Flores Vadell www.comoprogramarcongambas.blogspot.com www.speedbooksargentina.blogspot.com -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
So what you want is to extend the array class with some extra methods? Just use Inherits Person[] in the PersonList class ;) /Emil 2012/2/10 Fabián Flores Vadell > 2012/2/10 Emil Lenngren > > > Can you give some examples how you mean? > > What do you need wrappers for? > > I don't think I understand fully what you mean, but it seems interesting > :) > > > > /Emil > > > > I would like to show you an example, but I can't. > If I did, I would have to kill you. :P > > > > > > There is a foolish example: > > > '* > ' Class Person > '* > > $FirstName As String > $LastName As String > > Property Read FirstName As String > Property Read LastName As String > > Public Sub _new(fname As String, lname As String) > $FirstName = fname > $LastName = lname > End > > Private Function FirstName_Read() As String > Return $FirstName > End > > Private Function LastName_Read() As String > Return $LastName > End > > '* > ' PeopleList class > '* > > 'aPeople is a collaborator from which I want to expose some methods (by the > PeopleList message protocol) > > Private $aPeople As New Person[] > > 'The Call method implement the "instrospective call" "pattern" (okay, I > just made it up... but it works!) > > Public Sub Call(aMethodName As String, Optional arguments As Array = Null) > As Variant > Dim result As Variant > > If Not [Add, Clear, Count, Insert, {Max}].Exist(aMethodName) Then Return > > Object.Call($aPeople, aMethodName, arguments) > > Catch >Return Object.GetProperty($aPeople, aMethodName) > End > > 'I want avoid code like this: > > ' Public Sub Add(aPerson As Person) > ' $aPeople.Add(aPerson) > ' End > ' > ' Public Sub Insert(arrayPerson As Person[]) > ' $aPeople.Insert(arrayPerson) > ' End > ' > ' Public Sub Clear() > ' $aPeople.Clear > ' End > ' > ' Property Read Max > ' > ' Private Function Max_Read() > ' $aPeople.Max > ' End > ' > 'and so on > > 'More methods for PeopleList: > > Public Sub PrintList() > Dim aPerson As Person > > For Each aPerson In $aPeople >Print aPerson.FirstName & ", " & aPerson.LastName > Next > End > > '** > ' Test Class > '** > > Static Public Sub Main() > Dim aPeopleList As New PeopleList > Dim MaxItems As Integer > Dim Person1, Person2, Person3, Person4 As Person > Dim Person5, Person6, Person7, Person8 As Person > > Person1 = New Person("Carlos", "Delfino") > Person2 = New Person("Lionel", "Messi") > Person3 = New Person("Luis", "Scola") > Person4 = New Person("Emmanuel", "Ginóbili") > > 'Here are introspective calls: > With aPeopleList >'Very ugly sintactically, but that is all we got >.Call(.Insert, [[Person1, Person2, Person3]]) >.Call(.Add, [Person4]) > End With > > Person5 = New Person("Jhon", "Doe") > Person6 = New Person("Jane", "Doe") > Person7 = New Person("Nobody", "Gates") > Person8 = New Person("Genius", "Minisini") > > 'Here are introspective calls: > With aPeopleList >.Call(.Insert, [[Person5, Person6, Person7], .Call(.Max)]) >.Call(.Add, [Person8]) >Print .Call(.Count) > End With > > aPeopleList.PrintList > End > > > > > -- > > > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
2012/2/10 Emil Lenngren > So what you want is to extend the array class with some extra methods? > Just use > Inherits Person[] > in the PersonList class ;) > Did you read the code and comments? Not at all. I don't want use inheritance because I won't all methods and properties from Array[] in the PeopleList interfaz. Hence, I have to use aggregation (composition, delegation). If I use inheritance, the clients of PeopleList could do bad things or things that have no sense (as the case), e.g. PeopleList.Fill PeopleList.Push PeopleList.Pop This isn't the best example. But if you think about a minute, you will catch it. Do not focus on the example, because really, what I want isn't to add to a class methods from an array (that's just an example). I looking for a design pattern that allows me to solve a typical problem. That problem could be described as "How to add methods from a helper object without have to rewrite a wrapper for each method (with just a call within) in the host class?". -- Fabián Flores Vadell www.comoprogramarcongambas.blogspot.com www.speedbooksargentina.blogspot.com -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
Ok, I understand your issue. But unfortunately, I don't know any good way how to do it in Gambas. In C++ there are private inheritance that solves the problem, but Gambas only has public inheritance. Maybe Benoit can find out some way how to inherit only "some" of the symbols from a base class, if many Gambas programmers want that, and disallow such an inherited object to be cast to an ancestor class? /Emil 2012/2/11 Fabián Flores Vadell > 2012/2/10 Emil Lenngren > > > So what you want is to extend the array class with some extra methods? > > Just use > > Inherits Person[] > > in the PersonList class ;) > > > > Did you read the code and comments? > > Not at all. I don't want use inheritance because I won't all methods and > properties from Array[] in the PeopleList interfaz. Hence, I have to use > aggregation (composition, delegation). > > If I use inheritance, the clients of PeopleList could do bad things or > things that have no sense (as the case), e.g. > > PeopleList.Fill > PeopleList.Push > PeopleList.Pop > > This isn't the best example. But if you think about a minute, you will > catch it. > > Do not focus on the example, because really, what I want isn't to add to a > class methods from an array (that's just an example). I looking for a > design pattern that allows me to solve a typical problem. > > That problem could be described as "How to add methods from a helper object > without have to rewrite a wrapper for each method (with just a call within) > in the host class?". > > -- > Fabián Flores Vadell > www.comoprogramarcongambas.blogspot.com > www.speedbooksargentina.blogspot.com > > -- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
2012/2/10 Emil Lenngren > Ok, I understand your issue. But unfortunately, I don't know any good way > how to do it in Gambas. > Well, that's what it is solve this problem by a single method that make a dinamic call. > In C++ there are private inheritance that solves the problem, but Gambas > only has public inheritance. > > Maybe Benoit can find out some way how to inherit only "some" of the > symbols from a base class, if many Gambas programmers want that, and > disallow such an inherited object to be cast to an ancestor class? > > /Emil I changed my mind about this, few years ago. The problem with inheritance is that involves an conceptual issue: inheritance implies that an instance of the subclass "is a" exemplar (specimen) of both, its class and its superclass, and the subclass is an extension of the behaviour of the superclass. So, a subclass that have less behaviour that its superclass is something that is at odds with the object theory. In fact, the object theory could prescind from inheritance (as implementation mechanism) and just support delegation. The Google GO language is going down that road. The example that I wrote is very poor. The problem is shown more clearly when it is considered that an object can have many collaborators and sometimes the host object will need to expose methods from several of they. This is the case, and a solution based on inheritance would require a mechanism to support selective multiple inheritance (Frankenstein and all his family). I agree with you about that would be great that the interpreter provide us a feature that would allow us to do this selectively, but by delegation. Regards. -- > Fabián Flores Vadell www.comoprogramarcongambas.blogspot.com www.speedbooksargentina.blogspot.com -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] extern library
On Friday, February 10, 2012 22:54:58 Benoît Minisini wrote: > Le 05/02/2012 18:42, Wally a écrit : > > talking about Gambas 3: > > > > When i place my library to /usr/local/lib and run ldconfig it works and > > my_gb3_project can find the lib and its functions. > > When i put it into my_gb3_project folder the library can not be found. > > Where to place the library ganbas3 may find it ? > > It should work. Can you send me a little project with your library > inside so that I can check what happens exactly? It works when libMylib.so is in the project folder and i do Library "./libMylib" in top of the form. Library "./libMylib:0" also works if in project folder is a symbolic link libMylib.so.0 --> libMylib.so I can live with that but it would be nice if it would be mentioned in docs. Maybe i just did not find it in the docs. wally -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
On Fri, 2012-02-10 at 21:59 -0300, Fabián Flores Vadell wrote: > 2012/2/10 Emil Lenngren > Interesting, I have a similar problem, perhaps the same but maybe slightly different. I have a base class that is CREATE PRIVATE, it cannot be instantiated directly by a client application. It contains various methods that must be available to it's child classes (which CAN be instantiated) and can be called by the client application. For example, DBAdd is public in the base class so that the child class can call it. What I have done, with some success is as follows: In the base class I inspect the System.Backtrace and compare the object indicated by the second item (i.e. System.Backtrace[1]) to see that it "IS" a Me. (is that clear, if not I'll have to go find the code?) IOW I check that the caller object is an instance of Me, which can only be the base class itself or a class that inherits the base class. If not, I just raise an "Illegal Call" error. This works within reason, however it has the following drawbacks: a) there is obviously an overhead involved in the check code b) it does not prevent a client application from instantiating an object that inherits directly from the base class. So it goes. To expand this further. I also have examples where I need (read "want") to have methods in the base class that MUST be overridden in the specialised child classes. This is because these methods are templates only. However, they must be present in the base class, as the base class calls these methods! IOW the base class calls "SomeMethod", which my design says "must be implemented in the child class". Gambas is (almost) great at achieving this by its' use of virtual dispatch. If the child class has correctly overridden the base class method, then that is the one that is called. And in the base class, I can have a "stub" method that simply raises an error. If the child class does not override the method the the error is raised. I would love to be able to solve problem b) above. But hope this helps. Bruce -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas bug?
On Sat, 2012-02-11 at 18:06 +1030, Bruce Bruen wrote: > On Fri, 2012-02-10 at 21:59 -0300, Fabián Flores Vadell wrote: > > 2012/2/10 Emil Lenngren > > > > > Interesting, I have a similar problem, perhaps the same but maybe > slightly different. > > I have a base class that is CREATE PRIVATE, it cannot be instantiated > directly by a client application. It contains various methods that must > be available to it's child classes (which CAN be instantiated) and can > be called by the client application. For example, DBAdd is public in > the base class so that the child class can call it. > > What I have done, with some success is as follows: > > In the base class I inspect the System.Backtrace and compare the object > indicated by the second item (i.e. System.Backtrace[1]) to see that it > "IS" a Me. (is that clear, if not I'll have to go find the code?) > IOW I check that the caller object is an instance of Me, which can only > be the base class itself or a class that inherits the base class. If > not, I just raise an "Illegal Call" error. > > This works within reason, however it has the following drawbacks: > a) there is obviously an overhead involved in the check code > b) it does not prevent a client application from instantiating an object > that inherits directly from the base class. > So it goes. > > To expand this further. I also have examples where I need (read "want") > to have methods in the base class that MUST be overridden in the > specialised child classes. This is because these methods are templates > only. However, they must be present in the base class, as the base class > calls these methods! IOW the base class calls "SomeMethod", which my > design says "must be implemented in the child class". Gambas is > (almost) great at achieving this by its' use of virtual dispatch. If the > child class has correctly overridden the base class method, then that is > the one that is called. And in the base class, I can have a "stub" > method that simply raises an error. If the child class does not > override the method the the error is raised. > > I would love to be able to solve problem b) above. > Oh, by the way, the only way I can think of solving b) is to exchange some sort of signature when the objects are created. However, I don't think this can work as the base class is instantiated first by gambas. B -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user