Re: [Gambas-user] Format Text
Hi, Can you quote the thing you've written? Maybe you missed something or so... Normally it should work with both len() or string.len() Ok, then you said you will only give strings to another program, so the font shouldn't be important. In Basic, the only way of doing what you want will be using Print with a comma: print 22.55, 'the comma adds a tab character chr$(9) Then I remember (was it PowerBasic?) a USING thing where one could do such things with a mask of ### or so. Long time ago, very, very long time ;-) Never used that stuff then. But as you need right-aligned tabs... you will need to spend a little time developing an algorithm that assembles your lines. You mentioned other languages that offer easier ways. Can you give me an example? The easiest way I can think of would be some function where you define the line length and the tabs and then you add the strings to be inserted. If this function just replaces a line of spaces with the inserted strings, it wouldn't be too complicated. Rolf Stefan Miefert schrieb: Hello, i try your version included string.len ... but it dosent run when I have äöü inside. I always get bad arguments -Ursprüngliche Nachricht- Von: Rolf-Werner Eilert [mailto:eilert-sprac...@t-online.de] Gesendet: Donnerstag, 23. April 2009 18:04 An: mailing list for gambas users Betreff: Re: [Gambas-user] Format Text Hi Stefan, Stefan Miefert schrieb: Istn very smart but i do something like this now Test space(30 - len(Test)) Alles how I can Not very smart? Hm. This would be just my solution. But how can I align something like number like this 22.55 1.22 133.22 Must be like this 22.55 1.22 133.22 Just do it the other way round. If txt$ contains the text: space(30 - len(txt$)) txt$ or better (if umlauts are contained) space(30 - string.len(txt$)) txt$ That should do it... at least if you use Courier. For proportional fonts, you will want to use a drawing space like Printer or DrawingArea and work with measures of text lengths etc. That's quite another world, though it's basically the same way of grouping the columns. Rolf -- Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Obtaining a list of system printers
Il venerdì 24 aprile 2009 06:37:39 richard terry ha scritto: Hi, I need to be able to browse a list of system printers and wondered how one obtained these. Regards richard You could try 'lpstat'. I suggest you to read 'man lpstat' and try -a, -p, -v options to see which one fit your needs better. Warning: lpstat needs cupsd daemon running. Saluti, Stefano --- --- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Gambas server pages
Well i do not know if you got the last message but I have been playing with this. Got it working in Apache with cgi. But i have this problem the example always works. yeah! But when I try it myself with this program #!/usr/bin/env gbw2 % DIM myName AS String % !-- Variable declaration must come before any HTML -- html h2My Test/h2 % myName = steven % PMy name is %= myName %./P /html I test via the command line and get the right response. Content-type: text/html Content-length: 123 !-- Variable declaration must come before any HTML -- html h2My Test/h2 PMy name is steven./P /html But when I put on my webserver I get Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, ste...@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.11 (Fedora) Server at localhost Port 80 in the appache error log i get ERROR: #24: No startup method [Fri Apr 24 16:31:20 2009] [error] [client 127.0.0.1] Premature end of script headers: test4.gbw2 I have got SElinux disabled, I need to to get anything working but I will sort that out later. Any thoughts Steven -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Gambas server pages
Well i do not know if you got the last message but I have been playing with this. Got it working in Apache with cgi. -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Format Text
Benoît Minisini schrieb: Hi, Can you quote the thing you've written? Maybe you missed something or so... Normally it should work with both len() or string.len() Ok, then you said you will only give strings to another program, so the font shouldn't be important. In Basic, the only way of doing what you want will be using Print with a comma: print 22.55, 'the comma adds a tab character chr$(9) Then I remember (was it PowerBasic?) a USING thing where one could do such things with a mask of ### or so. Long time ago, very, very long time ;-) Never used that stuff then. But as you need right-aligned tabs... you will need to spend a little time developing an algorithm that assembles your lines. You mentioned other languages that offer easier ways. Can you give me an example? The easiest way I can think of would be some function where you define the line length and the tabs and then you add the strings to be inserted. If this function just replaces a line of spaces with the inserted strings, it wouldn't be too complicated. Rolf In Gambas 3, you can do that: sBuffer = Space$(80) Mid$(sBuffer, 1) = FirstColumn Mid$(sBuffer, 15) = SecondColumn Mid$(sBuffer, 28) = ThirdColumn ... Print sBuffer Regards, Oh yes, that's very practical. Good to know this exists in Gambas3, but I still use Gambas2, so it's for the future :-) Regards Rolf -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] A postregres question re points
Probably off-gambas topic but, I want to be able to store x-y co-ordinates e.g: create table defaults.temp (pk serial primary key, xy point ); insert into defaults.temp(xy) values (point(1,1)); I can retreive a result as - select * from defaults.temp; which gives (1,1) Now I'm stuck knowing how to put this into a variablee in gambas. Any help appreciated. Richard -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user