home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,581 of 10,840   
   Rookie to All   
   Help Please: Vb6.0 Aligning Columns of N   
   22 Jun 05 21:36:30   
   
   XPost: comp.lang.basic.visual   
   From: gonor@adelphia.net   
      
   I need to display several columns of numbers in a textbox.  I wish to   
   display the columns with the decimal point position aligned vertically.   
      
   I have found that the # digit placeholders do not reserve the spaces for the   
   number if the number of digits are fewer than the number of placeholders.   
      
   My simplified example:  included within a loop  such that it displays two   
   columns   
      
      
          Text1.Text = Text1.Text & Format(x, "         ###.#0") & _   
                                    Format(y, "          #,###.0") & _   
                                    vbCrLf   
      
      
   The digit place holders do not hold the places when the number of digits in   
   the values of  x and y are fewer than the number of place holders (#). This   
   causes the columns to not align.   
      
    I can make the columns align by placing a (0) placeholder at the most   
   significant digit to the left of the decimal but then the columns are   
   displayed with numbers of leading zeros depending on how many significant   
   digits are actually required to display the value in a particular row.   
      
   Example:   
      
   00000012.01    2345       0000000000.25   
      
   Help would be appreciated.   
      
      
   I recall that this was the only method to reserve spaces for the purposes of   
   alignment of columns in earlier forms of Basic and Fortran.  It seems that   
   VB digit placeholders only reserve spaces for actual digits of the value to   
   be displayed.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca