Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / February 2004



Tip: Looking for answers? Try searching our database.

Format function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WStoreyII - 28 Feb 2004 20:50 GMT
I was looking up info on how to use the format function on msdn.  I found
that you need format(expression, style) i have a list of preset styles and
it says that you cna make your own styles and gives you a list of character
to use however it does not tell me how to name my new format so that i may
reference it when i call the format function?  how do i do this ?

WStoreyII
Joe - 28 Feb 2004 20:58 GMT
> I was looking up info on how to use the format function on msdn.  I found
> that you need format(expression, style) i have a list of preset styles and
> it says that you cna make your own styles and gives you a list of character
> to use however it does not tell me how to name my new format so that i may
> reference it when i call the format function?  how do i do this ?

A "style" can be any old string variable or constant.

--
Joe Foster <mailto:jlfoster%40znet.com>  Sacrament R2-45 <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!
WStoreyII - 28 Feb 2004 21:06 GMT
> > I was looking up info on how to use the format function on msdn.  I found
> > that you need format(expression, style) i have a list of preset styles and
[quoted text clipped - 8 lines]
> WARNING: I cannot be held responsible for the above        They're   coming  to
> because  my cats have  apparently  learned to type.        take me away, ha ha!

ok but how do you set it for example I am suing

Private Sub TxtBxEq1_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TxtBxEq1.LostFocus
TxtBxEq1.Text = Format(TxtBxEq1.Text, "99a 99a 99a 99a = 99a ")

End Sub

when ever i take the focus off of the text box is just prints 99a 99a
instead of formating the text ?????
Joe - 28 Feb 2004 21:15 GMT
> > "WStoreyII" <papastoreyii@sbcglobal.net> wrote in message
> <news:Ka70c.31703$G44.9565@newssvr25.news.prodigy.com>...

> > A "style" can be any old string variable or constant.

> ok but how do you set it for example I am suing
>
[quoted text clipped - 6 lines]
> when ever i take the focus off of the text box is just prints 99a 99a
> instead of formating the text ?????

"Handles"?  "System.EventArgs"?  This is a Visual Basic, not B#, newsgroup.
Look for the "dotnet" newsgroups infesting the msnews.microsoft.com server.

--
Joe Foster <mailto:jlfoster%40znet.com>     Got Thetans? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!
WStoreyII - 28 Feb 2004 21:18 GMT
> > > "WStoreyII" <papastoreyii@sbcglobal.net> wrote in message
> > <news:Ka70c.31703$G44.9565@newssvr25.news.prodigy.com>...
[quoted text clipped - 19 lines]
> WARNING: I cannot be held responsible for the above        They're   coming  to
> because  my cats have  apparently  learned to type.        take me away, ha ha!

what aer you talking about i am posting visual basic questions?????  i dotn
even know what b# is
Joe - 28 Feb 2004 21:39 GMT
> > "Handles"?  "System.EventArgs"?  This is a Visual Basic, not B#, newsgroup.
> > Look for the "dotnet" newsgroups infesting the msnews.microsoft.com server.

> what aer you talking about i am posting visual basic questions?????  i dotn
> even know what b# is

B# is the crippled macro preprocessor for C# that Micro$haft insists on
passing off as "Visual Basic .NET".  It is certainly not Visual Basic.

--
Joe Foster <mailto:jlfoster%40znet.com>   L. Ron Dullard <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!
WStoreyII - 28 Feb 2004 21:50 GMT
> > > "Handles"?  "System.EventArgs"?  This is a Visual Basic, not B#, newsgroup.
> > > Look for the "dotnet" newsgroups infesting the msnews.microsoft.com server.
[quoted text clipped - 11 lines]
>
> well know that we have that straightened out could you please help me out
with my format() function questions or could you send me to a good tutorial
that will help me out on this function?
Rick Rothstein - 29 Feb 2004 02:25 GMT
Almost everybody in this newsgroup is using VB6 or lower. While you may get
a stray answer to VB.NET questions here, you should ask them in newsgroups
devoted exclusively to .NET programming. Look for newsgroups with either the
word "dotnet" or "vsnet" in their name.

For the microsoft news server, try these newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general

There are some others, but these should get you started.

Rick - MVP

> > "WStoreyII" <papastoreyii@sbcglobal.net> wrote in message
> <news:5B70c.31709$YA4.9749@newssvr25.news.prodigy.com>...
[quoted text clipped - 22 lines]
> with my format() function questions or could you send me to a good tutorial
> that will help me out on this function?
Steve Gerrard - 29 Feb 2004 01:30 GMT
> TxtBxEq1.Text = Format(TxtBxEq1.Text, "99a 99a 99a 99a = 99a ")
>
> when ever i take the focus off of the text box is just prints 99a 99a
> instead of formating the text ?????

If it was a VB6 program, that would be correct output. '9' and 'a' are
not format string characters, so they would just get printed out.

I would be suprised if that was a useful format string in VB.Net, though
all things are possible. Lookup the format function and identify the
formatting characters used for numbers, letters, etc. In VB6 they would
be '0' or '#' for digits, @ for characters, etc.
Jim Y - 29 Feb 2004 01:12 GMT
Try

Const INFLATION_MONEY = "#00,,"

then you can use

Format(Amount, INFLATION_MONEY)

To my knowledge there is no standard convention for creating your name.  The above was taken from:

   Visual Basic from the Ground UP, Gary Cornell, ISBN 0-07-882508-3

and that was all the text showed.  Hope that helps.

Jim Y

> I was looking up info on how to use the format function on msdn.  I found
> that you need format(expression, style) i have a list of preset styles and
[quoted text clipped - 3 lines]
>
> WStoreyII
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.