Formating/Alignment Help? 
Author Message
 Formating/Alignment Help?

I'm somewhat new to the world of Visual Basic
Programming. I'm working on engineering tools and I'm
having trouble formation my output. I want to allocate a
certain number of spaces for a given output so that
everything will line up in the viewed output. Say I have
a variable named "ROTP". When I output that variable, I
want it to take 8 spaces weather it's value be 2;
18.6666, -66.3333, or 100.001.  I'm trying to use the
format command and code "Format(ROTP,"###.####"). However
using this doesn't do what I want. If the value is 2, I
want it to output "__2.____".  Each "_" just denotes where
an empty space would be. If the value is 18.6666, I want
it to output "_18.6666".  What it's doing is, if the value
is 2, it's just outputing "2" into the table, but it's not
allocationg those spaces, it's just moving everything to
the right of that variable over 7 spaces left(2 empty spaces
before the digit, 4 empty spaces after the digit, and the
space for the missing decimal point) and everything's
misaligned under the heading. Can anyone help?

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Fri, 13 May 2005 21:35:20 GMT  
 Formating/Alignment Help?
Bill,

I'm not sure exactly where you're writing your results
to, but you could try this:

formatnumber(ROTP,4)

This would give you four decimal places for every number,
and your data would then all be lined up based on the
decimal.  There would be no leading zeros or place
holders for anything to the left of the decimal, but I'm
not sure that matters.

Dawn H.

Quote:
>-----Original Message-----
>I'm somewhat new to the world of Visual Basic
>Programming. I'm working on engineering tools and I'm
>having trouble formation my output. I want to allocate a
>certain number of spaces for a given output so that
>everything will line up in the viewed output. Say I have
>a variable named "ROTP". When I output that variable, I
>want it to take 8 spaces weather it's value be 2;
>18.6666, -66.3333, or 100.001.  I'm trying to use the
>format command and code "Format(ROTP,"###.####").
However
>using this doesn't do what I want. If the value is 2, I
>want it to output "__2.____".  Each "_" just denotes
where
>an empty space would be. If the value is 18.6666, I want
>it to output "_18.6666".  What it's doing is, if the
value
>is 2, it's just outputing "2" into the table, but it's
not
>allocationg those spaces, it's just moving everything to
>the right of that variable over 7 spaces left(2 empty
spaces
>before the digit, 4 empty spaces after the digit, and
the
>space for the missing decimal point) and everything's
>misaligned under the heading. Can anyone help?

>*** Sent via Developersdex http://www.developersdex.com
***
>Don't just participate in USENET...get rewarded for it!
>.



Sat, 14 May 2005 06:28:01 GMT  
 Formating/Alignment Help?


Quote:
> I'm somewhat new to the world of Visual Basic
> Programming. I'm working on engineering tools and I'm
> having trouble formation my output. I want to allocate a
> certain number of spaces for a given output so that
> everything will line up in the viewed output. Say I have
> a variable named "ROTP". When I output that variable, I
> want it to take 8 spaces weather it's value be 2;
> 18.6666, -66.3333, or 100.001.  I'm trying to use the
> format command and code "Format(ROTP,"###.####"). However
> using this doesn't do what I want. If the value is 2, I
> want it to output "__2.____".  Each "_" just denotes where
> an empty space would be. If the value is 18.6666, I want
> it to output "_18.6666".  What it's doing is, if the value
> is 2, it's just outputing "2" into the table, but it's not
> allocationg those spaces, it's just moving everything to
> the right of that variable over 7 spaces left(2 empty spaces
> before the digit, 4 empty spaces after the digit, and the
> space for the missing decimal point) and everything's
> misaligned under the heading. Can anyone help?

I'm guessing you are looking for the old 'Using' function from
earlier Basics. That is not available with VB. You could look at Lset
and Rset as one way to do this, however I would probably just code
what I wanted. Be aware that your output will need to use a fixed
pitch font for output for any of this to work. If you want more, give
us an example of a complete output line.

Neil



Tue, 17 May 2005 09:04:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help formating Numbers

2. _Office XP - Word to Outlook Text Formating - Please Help

3. _Word to Outlook text formating - Please Help

4. help in formating mail with vba / vb script

5. _Office XP - Word to Outlook text formating -Please Help

6. further help with formating pics

7. Help: ToolTipText formating & Form Shae

8. Formating to a printer(please help)

9. Help: ToolTipText formating & Form Shae

10. Please help with text box formating.

11. Help - Formating in a text box

12. Help: Formating a time

 

 
Powered by phpBB® Forum Software