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] 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
Re: [Gambas-user] Format Text
How about using something like space(5) between each string? On Apr 23, 2009 9:16 AM, Stefan Miefert smief...@kikxxl.de wrote: HEllo, how can i format a text like this 1 Auto 20.12.2008 20,15 2 Fahrrad 30.12.20053,22 3 Bus 12.05.2000 22,44 4 Auto2 15.04.2088 23,55 5 Auto3 15.04.2088 6 Bus2 15.04.2088 7 LKW 15.04.2088 8 Bus 15.04.2088 9 Auto4 15.04.2088 10 Bus 5 15.04.2088 -- 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
Re: [Gambas-user] Format Text
Hello, but the strings have different lengts:) That couldt work:) -Ursprüngliche Nachricht- Von: M0E Lnx [mailto:m0e@gmail.com] Gesendet: Donnerstag, 23. April 2009 16:32 An: mailing list for gambas users Betreff: Re: [Gambas-user] Format Text How about using something like space(5) between each string? On Apr 23, 2009 9:16 AM, Stefan Miefert smief...@kikxxl.de wrote: HEllo, how can i format a text like this 1 Auto 20.12.2008 20,15 2 Fahrrad 30.12.20053,22 3 Bus 12.05.2000 22,44 4 Auto2 15.04.2088 23,55 5 Auto3 15.04.2088 6 Bus2 15.04.2088 7 LKW 15.04.2088 8 Bus 15.04.2088 9 Auto4 15.04.2088 10 Bus 5 15.04.2088 -- 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 -- 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
Re: [Gambas-user] Format Text
Stefan Miefert írta: HEllo, how can i format a text like this 1 Auto 20.12.2008 20,15 2 Fahrrad 30.12.20053,22 3 Bus 12.05.2000 22,44 4 Auto2 15.04.2088 23,55 5 Auto3 15.04.2088 6 Bus2 15.04.2088 7 LKW 15.04.2088 8 Bus 15.04.2088 9 Auto4 15.04.2088 10 Bus 5 15.04.2088 -- 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 You have to do it manually! The basics: 1. The length of a row of text is for example m - you can use property Len(yourstring) 2. The length of numbering 3 (if you intend to have less than a thousand rows) 3. The length of the first gap: If you want your vehicles to start at position x then the length of gap is: x- Len(numbering). You can insert gaps with firstgap=String$(x-Len(numbering), ) 4. Now you have to plan the position of dates, let it be w. You will have the second gap between the vehicles and dates Can be calculated with w-x-Len(vehicle) etc. .. If you have done your calculus you'll have to create strings for each row like this: string[i]=numbers[i] firstgap[i] vehicles[i] secondgap[i] dates[i] ... -- 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
Re: [Gambas-user] Format Text
Istn very smart but i do something like this now Test space(30 - len(Test)) Alles how I can 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 -Ursprüngliche Nachricht- Von: Mészáros Csaba [mailto:mohar...@gmail.com] Gesendet: Donnerstag, 23. April 2009 16:45 An: mailing list for gambas users Betreff: Re: [Gambas-user] Format Text Stefan Miefert írta: HEllo, how can i format a text like this 1 Auto 20.12.2008 20,15 2 Fahrrad 30.12.20053,22 3 Bus 12.05.2000 22,44 4 Auto2 15.04.2088 23,55 5 Auto3 15.04.2088 6 Bus2 15.04.2088 7 LKW 15.04.2088 8 Bus 15.04.2088 9 Auto4 15.04.2088 10 Bus 5 15.04.2088 -- 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 You have to do it manually! The basics: 1. The length of a row of text is for example m - you can use property Len(yourstring) 2. The length of numbering 3 (if you intend to have less than a thousand rows) 3. The length of the first gap: If you want your vehicles to start at position x then the length of gap is: x- Len(numbering). You can insert gaps with firstgap=String$(x-Len(numbering), ) 4. Now you have to plan the position of dates, let it be w. You will have the second gap between the vehicles and dates Can be calculated with w-x-Len(vehicle) etc. .. If you have done your calculus you'll have to create strings for each row like this: string[i]=numbers[i] firstgap[i] vehicles[i] secondgap[i] dates[i] ... -- 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
Re: [Gambas-user] Format Text
HEllo, is the same:) I cant see any differences. Isnt their any formatting function in gambas like other languages habe? my problem is that I want to mail it via a textmail 123.22 1.22 34.11 Must be this x= space 123.22 xx1.22 x34.11 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$ -- 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