Beginner VB

Moderators: None (Apply to moderate this forum)
Number of threads: 1233
Number of posts: 2978

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Please say this is possible Posted by Runt1128 on 3 Apr 2002 at 9:26 AM
I am sending results (numbers mostly) to a text box. I am mostly using something like this:

NL = Chr$(13) + Chr$(10)
ReportText = ReportText + NL + "Model Number: " + comboModel + NL

Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?


Report
Re: Please say this is possible Posted by DaveR on 3 Apr 2002 at 10:09 AM
: I am sending results (numbers mostly) to a text box. I am mostly using something like this:
:
: NL = Chr$(13) + Chr$(10)
: ReportText = ReportText + NL + "Model Number: " + comboModel + NL
:
: Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?
:
:
:
i'm not exacty sure what you are asking but you can replace NL with VbCrLf same as using Chr$(13) + Chr$(10) Chr$(13) inseerts a carriage return and thats what the CR stands for Chr$(10) inserts a line feed and thats what the Lf stands for.

I i understand your question correctly you might want to try this

Format(varible,"0.00")

Report
Re: Please say this is possible Posted by KDivad Leahcim on 3 Apr 2002 at 10:09 AM
: I am sending results (numbers mostly) to a text box. I am mostly using something like this:
:
: NL = Chr$(13) + Chr$(10)
: ReportText = ReportText + NL + "Model Number: " + comboModel + NL
:
: Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?
:

For one thing, you can drop the whole NL routine if you want and use vbNewLine instead. This is a constant that is either 13,10 or 13 depending on the system.

MsgBox Format$(123.45, "0.00")

Don't know if it will mess you up, but Format$() does it's own rounding of the number.
Report
not sure about vbnewline kdl Posted by DaveR on 3 Apr 2002 at 10:12 AM
: : I am sending results (numbers mostly) to a text box. I am mostly using something like this:
: :
: : NL = Chr$(13) + Chr$(10)
: : ReportText = ReportText + NL + "Model Number: " + comboModel + NL
: :
: : Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?
: :
:
: For one thing, you can drop the whole NL routine if you want and use vbNewLine instead. This is a constant that is either 13,10 or 13 depending on the system.
:
: MsgBox Format$(123.45, "0.00")
:
: Don't know if it will mess you up, but Format$() does it's own rounding of the number.
:
i don't think VbNewLine works with the NT OS. i am not certain on this but i remeber reading somewhere saying that it isn't supported on all OS.
Report
Re: not sure about vbnewline kdl Posted by KDivad Leahcim on 4 Apr 2002 at 5:55 AM
: i don't think VbNewLine works with the NT OS. i am not certain on this but i remeber reading somewhere saying that it isn't supported on all OS.
:

That would be really weird since it's an internal constant, but I wouldn't put it past Microsoft to pull something like that.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.