Re: [Gambas-user] gambas3 printer
Benoît Minisini wrote Le 31/07/2014 19:49, Charlie Reinl a écrit : This strange behaviour actually comes from the Qt library. I will try to override it so that things become more logical. -- Benoît Minisini I wish you could override this: There is no reliable way to print text without splitting a line of text horizontally, as a graphic. When I have a multi-page document, my final line of text on most pages is split horizontally, and the top of the text is on one page, and the bottom of the text starts the new page. In Gambas2/Qt3, we could issue a line break after a certain number of lines, but this capability disappeared with Gambas3/Qt4. -- View this message in context: http://gambas.8142.n7.nabble.com/gambas3-printer-tp47647p49923.html Sent from the gambas-user mailing list archive at Nabble.com. -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Issue 485 in gambas: 'Like' square brackets problem
It appears that the problem happens if the first letter of the string being matched appears anywhere in the Pattern before the actual match. Your original examples were: Print GambasIDE Like {alma,Gambas,szilva,GambasIDE,otto} Output: False Print GambasIDE Like {alma,GambasIDE,szilva,Gambas,otto} Output: True *Actually, any g in the list, before GambasIDE, will interfere with the match:* Print GambasIDE Like {alma,g,szilva,GambasIDE,otto} Output: False but: Print GambasIDE Like {alma,szilva,otto,GambasIDE,g} Output: True It is only the *first letter* in the Pattern that is a problem -- the other letters do not have any bad effect. If we delete the g from the word Gambas, the result is correct: Print GambasIDE Like {alma,ambas, ambasIDE,szilva,GambasIDE,otto} Output: True *Note that if you use the * symbol, it eliminates the problem:* Print GambasIDE Like *{alma,Gambas,szilva,GambasIDE,otto}* Output: True ** eliminates the sensitivity of the patterns to their location in the list. Regards, Jon -- View this message in context: http://gambas.8142.n7.nabble.com/Issue-485-in-gambas-Like-square-brackets-problem-tp44870p44872.html Sent from the gambas-user mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Stopping a CLI program
Right -- my fault! When I suggested the example /proc/meminfo, I was just looking for any script example, to discuss using string variables in SHELL and EXEC for very long command strings. Tobias provided the coolest option to do that job. But you've pointed out that I could have chosen a better example. Jon -- View this message in context: http://gambas.8142.n7.nabble.com/Stopping-a-CLI-program-tp44612p44615.html Sent from the gambas-user mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Line continuation
If you are using SHELL, you can assign lines to variables. If the string continues on multiple lines, assign the text to string variables, and concatenate those variables. The example below merely shows SHELL accepting a string variable as its command string: DIM sRes as String DIM shellString as String shellString = cat /proc/meminfo Shell shellString To sRes If you use EXEC, the flexibility is more limited, as the command cannot be contained in a variable, but the following will work: DIM execString as String DIM sRes as String execString = /proc/meminfo Exec [cat, execString] To sRes -- View this message in context: http://gambas.8142.n7.nabble.com/Line-continuation-tp44561p44582.html Sent from the gambas-user mailing list archive at Nabble.com. -- Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] shell
Maybe I'm not understanding the problem, but sudo always wants a password, right? In which case you have to feed it a password with the Exec or Shell command. I'm not a shell script expert (just learning), but I assume that the string would look like this: Exec [system.shell, sudo sh -c 'echo out /sys/class/gpio/gpio27/direction' EOF\nmypassword\nEOF] where you have already dimensioned and set the value of mypassword in your code. If you have dimensioned a variable like strShellResponseString, you will be able to display a response from sudo in your program, if the password is incorrect: Exec [system.shell, sudo sh -c 'echo out /sys/class/gpio/gpio27/direction' EOF\nmypassword\nEOF] TO strShellResponseString note: My additional code is a here document code block. feeds a command list to an interactive program or a command, like sudo. EOF means end-of-file, but it also terminates input from stdin. The newline escape code \n is needed before and after the password variable, to place the password where sudo expects it, after a linefeed from stdin, followed by another linefeed. And then the second EOF terminates this input, which allows sudo to evaluate the password and either execute the sh command, or give an error message if the password is wrong. No extra spaces in all of this, or they'll be interpreted as part of the code! -- View this message in context: http://gambas.8142.n7.nabble.com/shell-tp44500p44508.html Sent from the gambas-user mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] article on Gambas...
ukimiku wrote Tobias, congratulations! I read on the Gambas-Buch page that you are co-author of a book on Gambas programming. I tried to locate it at Amazon, but no luck. Where is it available? Does it cover Gambas 3? Regards, ukimiku Hello, Ukimiku -- There is a free .PDF book in English, The Beginner's Guide to Gambas, which you can download at my blog www.beginnersguidetogambas.com You can also buy the paperback version of the book through a link on that blog page, if it meets your needs. It was written for both Gambas2 and Gambas3. The blog also includes sample projects, and other documents. Regards, Jon -- View this message in context: http://gambas.8142.n7.nabble.com/article-on-Gambas-tp44386p44402.html Sent from the gambas-user mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] ColumnView Sorting
Hi, Nigel -- I've never used the ColumnView (or other View) to sort the data -- I always sort the arrays where I keep data, and then re-fill the ColumnView or other View, if necessary. Your question raised a point that I've never explored, so I dug into it and found that you CAN sort data in a View, using the built-in capabilities of the View object. The documentation is on this page: http://gambasdoc.org/help/comp/gb.qt4/_columnview_columns?v3 Frankly, I sometimes find the Gambas online documentation to be a little cryptic, so (like usual) I wrote a simple program to explore and demonstrate sorting in a ColumnView. Here is the essential code block, especially note the inner/2nd If-Endif block: 'Note that when you change the sort of the ColumnView from one column to another, 'the sort column header will display a down-arrow symbol. Public Sub Button1_Click() If TextBox1.Text 'In other words, if TextBox1.Text is not NULL. If TextBox1.Text = 0 Or If TextBox1.Text = 1 Or If TextBox1.Text = 2 Then ColumnView1.Columns.Ascending = True ColumnView1.Columns.Sort = Val(TextBox1.Text) Else Message.Info(Type a Column ID: '0','1', or '2', OK) TextBox1.Text = Endif Else Message.Info(Type a Column ID: '0','1', or '2', OK) TextBox1.Text = Endif End My e-mail address is: nicho...@acegroup.cc If you send me your e-mail address, I'll send you a tar.gz file of the complete program, just so you can play with it and see how the sort works. Best regards, Jon Nicholson -- View this message in context: http://gambas.8142.n7.nabble.com/ColumnView-Sorting-tp44263p44279.html Sent from the gambas-user mailing list archive at Nabble.com. -- DreamFactory - Open Source REST JSON Services for HTML5 Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Key code constant wrong?
Don't worry, Fabien -- we will all be dying soon! -- View this message in context: http://gambas.8142.n7.nabble.com/Key-code-constant-wrong-tp44176p44262.html Sent from the gambas-user mailing list archive at Nabble.com. -- DreamFactory - Open Source REST JSON Services for HTML5 Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Feeding a DataView using data from another DataView
Jose -- Remember that there is a big difference between a MouseDown event on the DataView *control*, and an Activate event on a field containing information, inside that control. -- View this message in context: http://gambas.8142.n7.nabble.com/Feeding-a-DataView-using-data-from-another-DataView-tp44216p44228.html Sent from the gambas-user mailing list archive at Nabble.com. -- November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Semi-persistent pop-up form?
Bruce -- You may want to try using the Desktop component, which allows you to easily switch active (top-level) windows. It seems that I can't attach a file here, on a Reply, so I will e-mail you a small program showing how this component works. If you have two virtual desktops open, activating a window in the other desktop will bring it into the current desktop. (I'm using XFCE, it is probably the same for LDXE.) Regards -- View this message in context: http://gambas.8142.n7.nabble.com/Semi-persistent-pop-up-form-tp44208p44229.html Sent from the gambas-user mailing list archive at Nabble.com. -- November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Key code constant wrong?
.. Wamukota wrote The value for the key.enter constant in the 3.5.0 on my box is given as 16777221 ? key.enter 16777221 But, the value returned by key.code in the program is 16777220 in the keyrelease or the keypress events which implies that I cannot check if the key pressed is the Enter/Return key using the constants. As a workaround I switched to checking for the number or the key.enter value as valid values, but I know that is not the way to go Bug? Alain -- The Enter key and the Return key are actually 2 different keys! In my blog post http://beginnersguidetogambas.com/2013/02/12/some-useful-gambas-usages-and-examples/;, I explain: Note that the “Return” key is the “enter” key near the center of a standard desktop PC keyboard, with the “return” symbol. The “Enter” key is the “enter” key at the right side of a standard desktop PC keyboard, with the numeric keypad. The keys are equivalent in function, but each one returns a different key code. Here is how you use the constants: . If Key.Code = Key.Return Or Key.Code = Key.Enter Then .. Endif -- View this message in context: http://gambas.8142.n7.nabble.com/Key-code-constant-wrong-tp44176p44183.html Sent from the gambas-user mailing list archive at Nabble.com. -- November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Shell sudo
Thanks, Les -- I had this same problem, and you solved it for me. For other readers, here is the command adapted for Gambas3: Shell sudo -S chmod 0777 ~/myfilename EOF\nmypassword\nEOF Note: chmod 0777 is just an example of a chmod code The newline code \n should NOT have spaces before it or after it. If you have excess spaces, this will be interpreted as part of the shell command, and you'll get an error. -- View this message in context: http://gambas.8142.n7.nabble.com/Shell-sudo-tp17654p40876.html Sent from the gambas-user mailing list archive at Nabble.com. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user