[Gambas-user] Format Text

Stefan Miefert smiefert at ...784...
Thu Apr 23 17:30:18 CEST 2009


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:mohareve at ...626...] 
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.2005            3,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 at 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 at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user







More information about the User mailing list