Re: [Gambas-user] type mismatch: wanted integer, got string instead
2009/8/25 MSulchan Darmawan bleke...@gmail.com: Pada Mon, 24 Aug 2009 23:00:07 -0600 Dimitris Anogiatis dos...@gmail.com menulis: this way iRain would always have an integer and you wouldn't have to worry about the mismatch error... assuming 0, 1, 2, x, - and NULL are the only values used in your database. Thanks Dimitris and JY, Unfortunately, the possible values are more then that, it's just a sample. The values are amount of rainfall data, so it has numbers (0 to 400) also with floating number 0.5, 1.7, and so on. The field of old data on the database was set with string type, which x represent as a value less then 0.5, - represent as no rain, and NULL represent as no data. So, for temporary solution, I'll use TRY statement to exclude x, -, and NULL, but the problem is with the floating number. I don't know how to handle this yet. any idea how to solve this ? you test the string first : if instr(hResult!Fall, -) 0 or if instr(hResult!Fall, x) 0 or if hResult!Fall=null then iValue =0 else if instr(hResult!Fall, x) 0 then iValue =0 else iValue= CInt(val(hResult!Fall)) endif Endif Be carefull, the current localisation is used by Val() on problem ... try iValue = CFloat(hResult!Fall) or iValue = Cint(CFloat(hResult!Fall) ) http://www.gambasdoc.org/help/cat/conv?v3 thanks in advance, Regards, Sulchan -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] type mismatch: wanted integer, got string instead
Why don't you just convert the characters into numbers before converting the values? Unfortunately, the possible values are more then that, it's just a sample. The values are amount of rainfall data, so it has numbers (0 to 400) also with floating number 0.5, 1.7, and so on. The field of old data on the database was set with string type, which x represent as a value less then 0.5, - represent as no rain, and NULL represent as no data. For example, you could use Replace to change x into 0.4, - into 0 and NULL (search for chr$(0)...) into 0.3 or whatever. So everything is a value now, and the converting functions will be happy. Regards Rolf -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] type mismatch: wanted integer, got string instead
MSulchan, in http://www.gambasdoc.org/help/cat/datatypes you will find a breakdown of the available data types supported by Gambas2 and in http://www.gambasdoc.org/help/cat/conv the available data conversion functions. In this section of Gambasdoc http://www.gambasdoc.org/help/cat/type you will also find datatype functions that can help you with the special cases... ie IsNULL will detect if your variable is null or not. Now as for a strategy to deal with the floats... Depending on the floating number's floating part (meaning if the number's floating part is no more than 2 digits ie 0.90) seeing as it represents percentage you could always multiply them * 100 and turn them into an integer. If of course you get a large number like 0.582694 multiplying it by 100 and turning that into an integer, you'll end up with rounded data. The other approach is to use a float type variable but then you need to change your code to handle floats. With this new data about your project's input You could try something like this... '-- 'if the value of sRain is NOT a null if IsNull(Val(sRain)) = False THEN 'if the number is an integer just assign it to the iRain variable if IsInteger(Val(sRain)) = TRUE THEN iRain = Val(sRain) 'if it's not an integer ELSE 'check to see if it's a string SELECT CASE isString(sRain) CASE True 'if it's a string check here to see which one of the 'designated strings you have and assign a value to iRain if sRain = x then iRain = 0.4 'or anything else you want to make it if sRain = - then iRain = 0 'or anything else you want to make it CASE False ' if it's neither an integer nor a string, convert it into an integer multiply it by 100 turn it assign it to the iRain variable iRain = Val(sRain) * 100 CASE ELSE END SELECT ENDIF 'if the value of sRain is a null then just assign a negative integer to iRain ELSE iRain = -1 ENDIF '-- I hope this helps a bit more Regards Dimitris On Mon, Aug 24, 2009 at 11:40 PM, MSulchan Darmawan bleke...@gmail.comwrote: Pada Mon, 24 Aug 2009 23:00:07 -0600 Dimitris Anogiatis dos...@gmail.com menulis: this way iRain would always have an integer and you wouldn't have to worry about the mismatch error... assuming 0, 1, 2, x, - and NULL are the only values used in your database. Thanks Dimitris and JY, Unfortunately, the possible values are more then that, it's just a sample. The values are amount of rainfall data, so it has numbers (0 to 400) also with floating number 0.5, 1.7, and so on. The field of old data on the database was set with string type, which x represent as a value less then 0.5, - represent as no rain, and NULL represent as no data. So, for temporary solution, I'll use TRY statement to exclude x, -, and NULL, but the problem is with the floating number. I don't know how to handle this yet. any idea how to solve this ? thanks in advance, Regards, Sulchan -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] type mismatch: wanted integer, got string instead
one small correction in this line if sRain = x then iRain = 0.4 'or anything else you want to make it it should be if sRain = x then iRain = 40 'or anything else you want to make it On Tue, Aug 25, 2009 at 12:50 AM, Dimitris Anogiatis dos...@gmail.comwrote: MSulchan, in http://www.gambasdoc.org/help/cat/datatypes you will find a breakdown of the available data types supported by Gambas2 and in http://www.gambasdoc.org/help/cat/conv the available data conversion functions. In this section of Gambasdoc http://www.gambasdoc.org/help/cat/type you will also find datatype functions that can help you with the special cases... ie IsNULL will detect if your variable is null or not. Now as for a strategy to deal with the floats... Depending on the floating number's floating part (meaning if the number's floating part is no more than 2 digits ie 0.90) seeing as it represents percentage you could always multiply them * 100 and turn them into an integer. If of course you get a large number like 0.582694 multiplying it by 100 and turning that into an integer, you'll end up with rounded data. The other approach is to use a float type variable but then you need to change your code to handle floats. With this new data about your project's input You could try something like this... '-- 'if the value of sRain is NOT a null if IsNull(Val(sRain)) = False THEN 'if the number is an integer just assign it to the iRain variable if IsInteger(Val(sRain)) = TRUE THEN iRain = Val(sRain) 'if it's not an integer ELSE 'check to see if it's a string SELECT CASE isString(sRain) CASE True 'if it's a string check here to see which one of the 'designated strings you have and assign a value to iRain if sRain = x then iRain = 0.4 'or anything else you want to make it if sRain = - then iRain = 0 'or anything else you want to make it CASE False ' if it's neither an integer nor a string, convert it into an integer multiply it by 100 turn it assign it to the iRain variable iRain = Val(sRain) * 100 CASE ELSE END SELECT ENDIF 'if the value of sRain is a null then just assign a negative integer to iRain ELSE iRain = -1 ENDIF '-- I hope this helps a bit more Regards Dimitris On Mon, Aug 24, 2009 at 11:40 PM, MSulchan Darmawan bleke...@gmail.comwrote: Pada Mon, 24 Aug 2009 23:00:07 -0600 Dimitris Anogiatis dos...@gmail.com menulis: this way iRain would always have an integer and you wouldn't have to worry about the mismatch error... assuming 0, 1, 2, x, - and NULL are the only values used in your database. Thanks Dimitris and JY, Unfortunately, the possible values are more then that, it's just a sample. The values are amount of rainfall data, so it has numbers (0 to 400) also with floating number 0.5, 1.7, and so on. The field of old data on the database was set with string type, which x represent as a value less then 0.5, - represent as no rain, and NULL represent as no data. So, for temporary solution, I'll use TRY statement to exclude x, -, and NULL, but the problem is with the floating number. I don't know how to handle this yet. any idea how to solve this ? thanks in advance, Regards, Sulchan -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
On Monday 24 August 2009 17:33:39 Fabien Bodard wrote: 2009/8/24 Aleksandrs Livshics alek...@mpe.lv: Dear Gambas users, I am new to Gambas and my question may be silly, however I cannot find how to set a slider value in the code. (Not the initial value, this is easy) I want to specify some event (like double click on a slider) to force it to jump to a predefined position/value. If I write Dbl_click() method and use something like My_slider.value = The_value in it, then slider on screen does not move from where I have set it previously with a mouse. More precisely, It jumps to a position which corresponds to The_value and back to where it was before! Any ideas would be helpful. try to stop the event after setting the value public sub MySlider_DblClick() My_slider.value = The_value Stop Event end Thank you for a quick reply. Unfortunately when I have added the STOP EVENT line nothing really has been changed. When I assign some value to the slider and PRINT it after the STOP EVENT I have the wanted value printed 2 TIMES and then probably the change event happens. In my Change I print the value again as you see below. It is printed also 2 times and in both cases the old value is restored. PUBLIC SUB SMySlider_Change() PRINT Change - , MySlider.value END The slider on the screen shows the same: first it jumps to a specified position and the back... Alex -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] type mismatch: wanted integer, got string instead
Pada Tue, 25 Aug 2009 00:50:52 -0600 Dimitris Anogiatis dos...@gmail.com menulis: I hope this helps a bit more Great... this is more reasonable... I'll try it first... Thank you guys... -- Cheers, [-Sulchan-] Terbang dengan claws-mail 3.7.2 Mendarat di hardy heron 8.04.3 LTS signature.asc Description: PGP signature -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
you don't understand the stop event function.. stop event stop the event propagation...(so the widjet stop to act) but not the current sub execution ! if you want to stop the sub too you need to add a 'return' keyword ! if ok then stop event return endif nevertheless send me a short sample exemple and i will see what i can do 2009/8/25 Aleksandrs Livshics alek...@mpe.lv: On Monday 24 August 2009 17:33:39 Fabien Bodard wrote: 2009/8/24 Aleksandrs Livshics alek...@mpe.lv: Dear Gambas users, I am new to Gambas and my question may be silly, however I cannot find how to set a slider value in the code. (Not the initial value, this is easy) I want to specify some event (like double click on a slider) to force it to jump to a predefined position/value. If I write Dbl_click() method and use something like My_slider.value = The_value in it, then slider on screen does not move from where I have set it previously with a mouse. More precisely, It jumps to a position which corresponds to The_value and back to where it was before! Any ideas would be helpful. try to stop the event after setting the value public sub MySlider_DblClick() My_slider.value = The_value Stop Event end Thank you for a quick reply. Unfortunately when I have added the STOP EVENT line nothing really has been changed. When I assign some value to the slider and PRINT it after the STOP EVENT I have the wanted value printed 2 TIMES and then probably the change event happens. In my Change I print the value again as you see below. It is printed also 2 times and in both cases the old value is restored. PUBLIC SUB SMySlider_Change() PRINT Change - , MySlider.value END The slider on the screen shows the same: first it jumps to a specified position and the back... Alex -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
nevertheless it seem to be a bad idea... can't you prefer a default button ? to set the value ?... just put it at the right of the widget 2009/8/25 Fabien Bodard gambas...@gmail.com: you don't understand the stop event function.. stop event stop the event propagation...(so the widjet stop to act) but not the current sub execution ! if you want to stop the sub too you need to add a 'return' keyword ! if ok then stop event return endif nevertheless send me a short sample exemple and i will see what i can do 2009/8/25 Aleksandrs Livshics alek...@mpe.lv: On Monday 24 August 2009 17:33:39 Fabien Bodard wrote: 2009/8/24 Aleksandrs Livshics alek...@mpe.lv: Dear Gambas users, I am new to Gambas and my question may be silly, however I cannot find how to set a slider value in the code. (Not the initial value, this is easy) I want to specify some event (like double click on a slider) to force it to jump to a predefined position/value. If I write Dbl_click() method and use something like My_slider.value = The_value in it, then slider on screen does not move from where I have set it previously with a mouse. More precisely, It jumps to a position which corresponds to The_value and back to where it was before! Any ideas would be helpful. try to stop the event after setting the value public sub MySlider_DblClick() My_slider.value = The_value Stop Event end Thank you for a quick reply. Unfortunately when I have added the STOP EVENT line nothing really has been changed. When I assign some value to the slider and PRINT it after the STOP EVENT I have the wanted value printed 2 TIMES and then probably the change event happens. In my Change I print the value again as you see below. It is printed also 2 times and in both cases the old value is restored. PUBLIC SUB SMySlider_Change() PRINT Change - , MySlider.value END The slider on the screen shows the same: first it jumps to a specified position and the back... Alex -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] webcam weirdness
On Tuesday 25 August 2009, Jean-Yves F. Barbier wrote: Ron_1st a écrit : ... The pwc driver returns a v4l2 installation. The gb.v4l component can't handle v4l2 complet/correct but only v4l1 ATM normally no: ie: camstream uses the v4L1 compatibility mode that I compiled into my kernel (but may be the program spcifically ask for that mode, which could explain why it don't work with MyWebCam) I see with KMplayer (koos de vries) the philips web cam as v4l2 device interface. I hoop this explains more clear. (see note at the end) I have the same problem with the philips cams, i.e. PCVC645, and flash (adobe) and i'm using flashcam package http://flashcam.sourceforge.net A project to make Adobe Flash for Linux support V4L2 webcams or video devices. I avoid using adobe products in general (not free, super-bloatted, unexistant security (a very small worm is enough to activate it and spy you through flash webcam/mike facility); and you don't know what is transmitted to adobe), and flash in particular, as it don't have *any* interest in it. (the only thing it does very well is making my old CPU jump straight to 100% each time I'm obliged to use it.) In my case the page use flash for connection and audio/video streaming and flash could not find the v4l2 device. Avoiding is no option in this case.You may say go not to that site. How when it is intra-web site of my employer? It's using a modified vloopback from the motion project. This is in use for webcam on the intraweb site. I successfuly installed Ekiga in many places: it is fully m$n compatible, can uses many sound codecs, and the H264 video mode has really an amazing quality (on a LAN, and if you have a good WC, you're close to DVD quality:) Try it, you'll love it. I avoid such applications as mush as possible. I need a computer for work not for ammusement, then I go to the cafe/bioscoop/theater etc :) Ron_1st JY_666th Anyway some driver/modules of video devices give the v4l1 and/or v4l2 interface, the philips cam in my case only v4l2. I do have a microscoop (microdia) and that on is also v4l2 only. My TV-Card (terratec) using the bt8x8 driver returns both interfaces. Another cam just only v4l1 as interface, and bad quality picture too. Some applications have the same problem for using v4l1 and/or v4l2. What to do if applicaton support only v4l1 and the cam the other one? 1) The vloopback is for programs using the v4l1, and _not_ v4l2 for using the v4l1 API to talk to a v4l2 API. 2) Flash support only v4l1 and with _specific settings_. In my case flashcam does 1 and 2 together. Good solution for me. Note: The gb.v4l component was written by Daniel C. for his v4l1 cam. Gareth did however had a v4l2 cam and he rewrote a part of the component and released a test application that uses his modified driver. So ATM I would say the gb.component is more or less broken/incomplete. If your cam is v4l1 only then you should use the D.C. version. If your cam is v4l2 only then you should use the Gareth version. This is what happend in the background of the component and the v4l2 is only for the cam of Gareth implemented, i.e. the colorspace. Both are written for specific WC with very restricted capabilities. My active involvement ATM is only for the modified code of Gareth, specific the compile time error/abort, about undefinied variable names/values for some videodev.h versions. I solved my other wishes/problems with hardware solution instead of software. Best regards, Ron_1st -- -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
On Tuesday 25 August 2009 12:25:08 Fabien Bodard wrote: you don't understand the stop event function.. stop event stop the event propagation...(so the widjet stop to act) but not the current sub execution ! if you want to stop the sub too you need to add a 'return' keyword ! if ok then stop event return endif nevertheless send me a short sample exemple and i will see what i can do 2009/8/25 Aleksandrs Livshics alek...@mpe.lv: On Monday 24 August 2009 17:33:39 Fabien Bodard wrote: 2009/8/24 Aleksandrs Livshics alek...@mpe.lv: Dear Gambas users, I am new to Gambas and my question may be silly, however I cannot find how to set a slider value in the code. (Not the initial value, this is easy) I want to specify some event (like double click on a slider) to force it to jump to a predefined position/value. If I write Dbl_click() method and use something like My_slider.value = The_value in it, then slider on screen does not move from where I have set it previously with a mouse. More precisely, It jumps to a position which corresponds to The_value and back to where it was before! Any ideas would be helpful. try to stop the event after setting the value public sub MySlider_DblClick() My_slider.value = The_value Stop Event end Thank you for a quick reply. Unfortunately when I have added the STOP EVENT line nothing really has been changed. When I assign some value to the slider and PRINT it after the STOP EVENT I have the wanted value printed 2 TIMES and then probably the change event happens. In my Change I print the value again as you see below. It is printed also 2 times and in both cases the old value is restored. PUBLIC SUB SMySlider_Change() PRINT Change - , MySlider.value END The slider on the screen shows the same: first it jumps to a specified position and the back... Alex - - Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user --- --- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user OK, here is an example... The form has just one slider, nothing else. I want it to jump to ZERO if double clicked, no matter where it was before. If it is not at the ZERO position when double clicked it in fact jumps to ZERO and immediately back !... FMain.class Description: application/java # Gambas Form File 2.0 { Form Form MoveScaled(0,0,50,50) Text = () { Slider1 Slider MoveScaled(6,20,36,3) } } -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
I have just found that it works (without stop event) but only if i double click inside the slider, but NOT on it's moving part ! Aleks On Tuesday 25 August 2009 12:33:19 Fabien Bodard wrote: nevertheless it seem to be a bad idea... can't you prefer a default button ? to set the value ?... just put it at the right of the widget 2009/8/25 Fabien Bodard gambas...@gmail.com: you don't understand the stop event function.. stop event stop the event propagation...(so the widjet stop to act) but not the current sub execution ! if you want to stop the sub too you need to add a 'return' keyword ! if ok then stop event return endif nevertheless send me a short sample exemple and i will see what i can do 2009/8/25 Aleksandrs Livshics alek...@mpe.lv: On Monday 24 August 2009 17:33:39 Fabien Bodard wrote: 2009/8/24 Aleksandrs Livshics alek...@mpe.lv: Dear Gambas users, I am new to Gambas and my question may be silly, however I cannot find how to set a slider value in the code. (Not the initial value, this is easy) I want to specify some event (like double click on a slider) to force it to jump to a predefined position/value. If I write Dbl_click() method and use something like My_slider.value = The_value in it, then slider on screen does not move from where I have set it previously with a mouse. More precisely, It jumps to a position which corresponds to The_value and back to where it was before! Any ideas would be helpful. try to stop the event after setting the value public sub MySlider_DblClick() My_slider.value = The_value Stop Event end Thank you for a quick reply. Unfortunately when I have added the STOP EVENT line nothing really has been changed. When I assign some value to the slider and PRINT it after the STOP EVENT I have the wanted value printed 2 TIMES and then probably the change event happens. In my Change I print the value again as you see below. It is printed also 2 times and in both cases the old value is restored. PUBLIC SUB SMySlider_Change() PRINT Change - , MySlider.value END The slider on the screen shows the same: first it jumps to a specified position and the back... Alex -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user --- --- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
Il martedì 25 agosto 2009 11:43:05 Aleksandrs Livshics ha scritto: On Tuesday 25 August 2009 12:25:08 Fabien Bodard wrote: you don't understand the stop event function.. stop event stop the event propagation...(so the widjet stop to act) but not the current sub execution ! if you want to stop the sub too you need to add a 'return' keyword ! if ok then stop event return endif nevertheless send me a short sample exemple and i will see what i can do 2009/8/25 Aleksandrs Livshics alek...@mpe.lv: On Monday 24 August 2009 17:33:39 Fabien Bodard wrote: 2009/8/24 Aleksandrs Livshics alek...@mpe.lv: Dear Gambas users, I am new to Gambas and my question may be silly, however I cannot find how to set a slider value in the code. (Not the initial value, this is easy) I want to specify some event (like double click on a slider) to force it to jump to a predefined position/value. If I write Dbl_click() method and use something like My_slider.value = The_value in it, then slider on screen does not move from where I have set it previously with a mouse. More precisely, It jumps to a position which corresponds to The_value and back to where it was before! Any ideas would be helpful. try to stop the event after setting the value public sub MySlider_DblClick() My_slider.value = The_value Stop Event end Thank you for a quick reply. Unfortunately when I have added the STOP EVENT line nothing really has been changed. When I assign some value to the slider and PRINT it after the STOP EVENT I have the wanted value printed 2 TIMES and then probably the change event happens. In my Change I print the value again as you see below. It is printed also 2 times and in both cases the old value is restored. PUBLIC SUB SMySlider_Change() PRINT Change - , MySlider.value END The slider on the screen shows the same: first it jumps to a specified position and the back... Alex --- -- - Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user - -- --- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user OK, here is an example... The form has just one slider, nothing else. I want it to jump to ZERO if double clicked, no matter where it was before. If it is not at the ZERO position when double clicked it in fact jumps to ZERO and immediately back !... Found a solution: ' Gambas class file PRIVATE $boolWantZeroValue AS Boolean PUBLIC SUB _new() END PUBLIC SUB Form_Open() END PUBLIC SUB Slider1_Change() PRINT change: , Slider1.Value IF $boolWantZeroValue THEN Slider1.Value = 0 $boolWantZeroValue = FALSE ENDIF END PUBLIC SUB Slider1_DblClick() $boolWAntZeroValue = TRUE Slider1.Value = 0 PRINT dbl: , Slider1.Value END -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] webcam weirdness
Not sure what to include with this, please ask for additional info. Attached is a pict of some webcam weirdness with no error messages generated. Doesn't appear to be a webcam issue as the image looks fine with Cheese Webcam Booth. This was taken with gambas v3 SVN as of yesterday running the WebCam example program. usb 4-1: new full speed USB device using uhci_hcd and address 4 usb 4-1: New USB device found, idVendor=0733, idProduct=0401 usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 usb 4-1: configuration #1 chosen from 1 choice gspca: probing 0733:0401 gspca: probe ok [a...@localhost trunk]$ Only gambas debug info was this: (WebCam:25423): Gdk-CRITICAL **: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] /snip gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] Thanks Andy This is an image conversion problem: the SPCA501 is an image format, and the gb.v4l component prints it each time it cannot convert it to RGB. Apparently the component can convert only a few format to the one supported by Gambas: RGB RGBA. But I don't know what SPCA501 is exactly. A conversion library format is needed... Regards, I know what should be done: with v4l is developed a library named libv4lconvert that does all the conversion stuff. The gb.v4l component must use that library, instead of its own conversion routines. Regards, -- Benoît -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
you don't understand the stop event function.. stop event stop the event propagation...(so the widjet stop to act) but not the current sub execution ! if you want to stop the sub too you need to add a 'return' keyword ! if ok then stop event return endif nevertheless send me a short sample exemple and i will see what i can do STOP EVENT only works for a few events where it has sense. It has no effects in most of events. Regards, -- Benoît -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to set a slider value?
Le 25 août 2009 14:07, Benoît Minisinigam...@users.sourceforge.net a écrit : you don't understand the stop event function.. stop event stop the event propagation...(so the widjet stop to act) but not the current sub execution ! if you want to stop the sub too you need to add a 'return' keyword ! if ok then stop event return endif nevertheless send me a short sample exemple and i will see what i can do STOP EVENT only works for a few events where it has sense. It has no effects in most of events. Regards, -- Benoît I don't know that information :-) -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] howto set starting path for dirview?
Greetings I am wring a small app that utilizes dirview. As long as the directories are contained within the user home directory the app can be utilized properly but if the user mounts a external drive the app cannot changedir to the external drive because it is mounted under the /media directory and not the $HOME dir. How do I change the path of the dirview to see the entire system? I have tried dirview.root= / but it does not work. Thank you for any assistance. Ivan I never saw a wild thing sorry for itself. A small bird will drop frozen dead from a bough Without ever having felt sorry for itself. -- D.H. Lawrence http://www.usconstitution.net/const.html Linux - Live Free or Die. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] solved dirview set path problem - sorry for bothering you
Greetings Solved my own problem with the default path problem - I was not in the form load area when I set the path - sorry for bothering you fine folks. Ivan I never saw a wild thing sorry for itself. A small bird will drop frozen dead from a bough Without ever having felt sorry for itself. -- D.H. Lawrence http://www.usconstitution.net/const.html Linux - Live Free or Die. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Need help / call for volunteers
Forgot to attach :-) -- joshua higgins -- report-ng Description: Binary data -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Need help / call for volunteers
Included fix for FreeBSD ram detection. -- joshua higgins -- -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Need help / call for volunteers
On Wednesday 26 August 2009 04:24:25 Joshua Higgins wrote: Forgot to attach :-) -- Output from my ARCH linux box. [OperatingSystem] OperatingSystem=Linux KernelRelease=2.6.30-ARCH DistributionVendor=generic-undetected Arch Linux \r (\n) (\l) [System] CPUArchitecture=i686 TotalRam=2073964 kB [Gambas] Gambas1=Not Installed Gambas2=Not Installed Gambas3=2.99.0 Gambas3Path=/usr/bin/gbx3 -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] webcam weirdness
2009/8/25 Benoît Minisini gam...@users.sourceforge.net Not sure what to include with this, please ask for additional info. Attached is a pict of some webcam weirdness with no error messages generated. Doesn't appear to be a webcam issue as the image looks fine with Cheese Webcam Booth. This was taken with gambas v3 SVN as of yesterday running the WebCam example program. usb 4-1: new full speed USB device using uhci_hcd and address 4 usb 4-1: New USB device found, idVendor=0733, idProduct=0401 usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 usb 4-1: configuration #1 chosen from 1 choice gspca: probing 0733:0401 gspca: probe ok [a...@localhost trunk]$ Only gambas debug info was this: (WebCam:25423): Gdk-CRITICAL **: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] /snip gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] Thanks Andy Is it better if you use the latest revision? gb.v4l now uses the standard Video4Linux conversion library, so it should handle the specific format of your camera correctly. -- Benoît Yes, thank you, it now works perfectly. -- projecthuh.com All of my bits are free, are yours? Fedoraproject.org I'd rather have dead offenders than repeat offenders - Ted Nugent -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] webcam weirdness
Not sure what to include with this, please ask for additional info. Attached is a pict of some webcam weirdness with no error messages generated. Doesn't appear to be a webcam issue as the image looks fine with Cheese Webcam Booth. This was taken with gambas v3 SVN as of yesterday running the WebCam example program. usb 4-1: new full speed USB device using uhci_hcd and address 4 usb 4-1: New USB device found, idVendor=0733, idProduct=0401 usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 usb 4-1: configuration #1 chosen from 1 choice gspca: probing 0733:0401 gspca: probe ok [a...@localhost trunk]$ Only gambas debug info was this: (WebCam:25423): Gdk-CRITICAL **: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] /snip gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] Thanks Andy Is it better if you use the latest revision? gb.v4l now uses the standard Video4Linux conversion library, so it should handle the specific format of your camera correctly. -- Benoît -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] type mismatch: wanted integer, got string instead (solved)
Pada Tue, 25 Aug 2009 04:29:32 -0600 Dimitris Anogiatis dos...@gmail.com menulis: give it a try MSulchan and tell me if it works for you Thank you Dimitris, after a little try and error, I change the code into like this : IF IsNull(Val(sRain)) = FALSE THEN IF InStr(LCase(sRain), x) 0 OR InStr(sRain, -) 0 OR InStr(sRain, .) 0 THEN IF InStr(LCase(sRain), x) 0 THEN fRain = 0 IF InStr(sRain, -) 0 THEN fRain = 0 IF InStr(sRain, .) 0 THEN sRainy = Replace(sRain, ., ,) fRain = Val(sRainy) ENDIF ELSE fRain = CFloat(Val(sRain)) ENDIF ELSE fRain = -1 ENDIF Decided to change iRain (integer) to fRain (float). As Fabien told that Val() use current localization, so I need to change the decimal separator from dot to comma. And I think it is fast enough :D Thanks again. -- Cheers, [-Sulchan-] Terbang dengan claws-mail 3.7.2 Mendarat di hardy heron 8.04.3 LTS signature.asc Description: PGP signature -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] webcam weirdness
For which version 2 or 3? Steven On Tue, 2009-08-25 at 20:30 -0400, Dr. Diesel wrote: 2009/8/25 Benoît Minisini gam...@users.sourceforge.net Not sure what to include with this, please ask for additional info. Attached is a pict of some webcam weirdness with no error messages generated. Doesn't appear to be a webcam issue as the image looks fine with Cheese Webcam Booth. This was taken with gambas v3 SVN as of yesterday running the WebCam example program. usb 4-1: new full speed USB device using uhci_hcd and address 4 usb 4-1: New USB device found, idVendor=0733, idProduct=0401 usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 usb 4-1: configuration #1 chosen from 1 choice gspca: probing 0733:0401 gspca: probe ok [a...@localhost trunk]$ Only gambas debug info was this: (WebCam:25423): Gdk-CRITICAL **: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] /snip gambas v4l2: SPCA501 [11] gambas v4l2: SPCA501 [11] Thanks Andy Is it better if you use the latest revision? gb.v4l now uses the standard Video4Linux conversion library, so it should handle the specific format of your camera correctly. -- Benoît Yes, thank you, it now works perfectly. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] type mismatch: wanted integer, got string instead (solved)
You're welcome MSulchan :) I'm glad you solved that problem and I'm glad I helped :) Keep up the good work :) Regards Dimitris On Tue, Aug 25, 2009 at 8:01 PM, MSulchan Darmawan bleke...@gmail.comwrote: Pada Tue, 25 Aug 2009 04:29:32 -0600 Dimitris Anogiatis dos...@gmail.com menulis: give it a try MSulchan and tell me if it works for you Thank you Dimitris, after a little try and error, I change the code into like this : IF IsNull(Val(sRain)) = FALSE THEN IF InStr(LCase(sRain), x) 0 OR InStr(sRain, -) 0 OR InStr(sRain, .) 0 THEN IF InStr(LCase(sRain), x) 0 THEN fRain = 0 IF InStr(sRain, -) 0 THEN fRain = 0 IF InStr(sRain, .) 0 THEN sRainy = Replace(sRain, ., ,) fRain = Val(sRainy) ENDIF ELSE fRain = CFloat(Val(sRain)) ENDIF ELSE fRain = -1 ENDIF Decided to change iRain (integer) to fRain (float). As Fabien told that Val() use current localization, so I need to change the decimal separator from dot to comma. And I think it is fast enough :D Thanks again. -- Cheers, [-Sulchan-] Terbang dengan claws-mail 3.7.2 Mendarat di hardy heron 8.04.3 LTS -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user