|
Hi, well there are a few ways to get by...
dim decValue as Decimal
decvalue = format(yourvalue, "#.##0.00")
use this example to return the value as 0.25
for more decimal points, add more 0
the yourvalue, is the value you want to convert
hope this help
Arno
|
|
|
|
|
Hi,
Somebody help me what code for this.
I have the illustration of my text file below. All under <b>123 </b>contains the value of <b>a,b,c,d </b>and <b>456</b>, contains the value of <b>e,f,g,h</b>. I use mid fuction to read each line but my problem is how can I code that <b>b,c,d</b> is still under <b>123</b> and <b>f,g,h</b> is still under 456?
The purpose of my program is to get the center and its coressponding Account and Amount.
Appreciate your quick response. Thanks in advance.
Illustration of my text file.....
Center Account Amount1 Amount2
123 a xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
b xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
c xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
d xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
456 e xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
f xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
g xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
h xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
-- modified at 23:00 Tuesday 25th October, 2005
|
|
|
|
|
blums wrote: I use mid fuction to read each line
A regex wouild serve you better, IMO
blums wrote: I use mid fuction to read each line but my problem is how can I code that b,c,d is still under 123 and f,g,h is still under 456?
You're trying to get the letters to line up ? Try using tabs instead of spaces, perhaps ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
blums...
Can you email me your text file so I can see the file instead of a representation of it?
Thanks ... George
|
|
|
|
|
blums...
First, a caveat. Since I didn't have the entire report to work with, I suspect there may be some additional total and grand total lines at the end of the report that my code may not detect. If that's a problem, please let me know.
Download this Visual Studio project from my web site:
http://www.2goodsoftware.com/snippets/reportextract.zip
Before running the project, place the filedemo.txt file in the project bin folder. I didn't include it in the zip file since the report looks very confidendial (I have deleted my copy).
The code you want from the project is the two functions ReportDataLine and CleanString. The rest of the project is just a test bed.
|
|
|
|
|
I have an app that uses multiple forms. I first created them with a parent MdiContainer. This works fine, but I hate having the container.
I don't want the user to be able to minimize the form that is being displayed within the container, but I havn't been able to figure out how to remove the caption bars on the forms being displayed within the container. I can disable their functionality, but my app really needs the space the caption bar uses.
I can display the forms without using a container, but then I lose the benefit of having a container that helps manage the position and size of the forms residing within and I can't have forms scattered all over the screen.
Any ideas on how to achieve what I am trying to do?
Thanks
-Kevin
|
|
|
|
|
Have you considered one form with control tabs?
|
|
|
|
|
I was thinking about using a control tab, but the tabs would have to be on the side instead of the top. I have come accross some custom controls like that, but havn't really liked the way they looked.
If it is possible to hide the tabs, I suppose I could hide the tabs and then use buttons to toggle through the pages?
Any additional input would be helpful.
Kevin
|
|
|
|
|
As an example, Lavasoft's Ad-aware pictured at the link below has a box on the right, and buttons on the left. Pressing any one of the buttons on the left displays changes what is viewed in the box. My assumption is that this window is a form, containing buttons and some kind of control in which other controls can be embedded. What is this control or is it custom? I need some kind of framework that resembles this.
Note: I site this only as an example of a good UI and my program in no way resembles Lavasoft's Ad-aware program, nor what it does.
http://www.enterprisestorageforum.com/img/scr-adaware.jpg
Kevin
|
|
|
|
|
Ok, I think I have a solution...
Since I have all these forms made already, it would be helpful to be able use these forms. I did some experimenting and found I can create a form, then place a panel within it, and then add all my forms (setting the border to none and toplevel to false) to the panel's Controls Collection, and then display the forms as I wish.
Any problems to this approach? Better Ideas?
Kevin
|
|
|
|
|
i have a dll with .h file and .lib file (i have source files too).
I want to use this dll in my vb.net project.
how can i do?
(this is first week i study vb.net)
how can i use this .h file inside vb.net project? (i need to do it?)
Thank you.
emanuele
El Gaucho della livida Palude
|
|
|
|
|
You have to reference the compiled DLL then use API style declarations to call functions it exports. See Primary Interop topics on MSDN.
|
|
|
|
|
Hey, I'm a beginner with vb.net. i want to apply a chunk of code to a string only if the string has the text "B800_" in it, so i used an if statement:
If sNewName = "B800_" Then
blahblahblah
End If
My problem is, i need any string that include "B800_" not equals it, so i need it to apply to strings like "B800_this" or "B800_12345"
Is there a way to make this happen? If there is a way to create an open string, or maybe something that checks if sNewName includes "B800_" then i could do something like
If sNewName Includes "B800_" Then
or
If sNewName = "B800_" & "anything" Then
Thanks for the help guys!
|
|
|
|
|
I would look at the IndexOf method from the String class.
|
|
|
|
|
|
What are you talking about? There is no map between user names and what machines they're logged into.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I need write a progam in .Net (c# or vb.net):
The program should display in a monitor(tv) files(e.g. *.avi, *.mpg, ...) and also display TV channnels(analogical signal) depending on a schedule(user defined)
what I must use? ... ¿Managed DirectX?
Helpme please
|
|
|
|
|
Managed Direct X will play your files, but it is crap. You should instead COM interop to plain DirectX yourself, or you should use the Windows Media Player as a control.
No amount of code will change the fact that your PC does not have the hardward to recieve a TV signal. I don't know if there's a standard API between TV card, but you definately need the card before you do anything else.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi I am HaresH, Please help to make application in tapi
because i am developing TAPI application,
so anybody have this type of sample appication please send me
on my mail id
hareshmca@yahoo.co.in
mca.haresh@gmail.com
Thanks in advance
HaresH
|
|
|
|
|
http://www.vbip.com/miscellaneous/tapi-01.asp
Found with google. Try it yourself. It'll save you a lot of time.
|
|
|
|
|
Hi I am HaresH, Please send me TAPI sample code in vb.net
Thanks in advance
HaresH
|
|
|
|
|
Becuase your question covers such a HUGE topic, this is probably the only response your going to get.
Google results[^] for "vb.net tapi"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need help to write a program that includes two functions named calc_avg() and varience(). The calc_avg() function should calculate and return the average of the values stored in a static array called testvals. The array should be declared in main() and include that values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The varience is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calc_avg() and varience() should be displayed in main()???
|
|
|
|
|
Written for console app....
static void Main(string[] args)
{
int[] testvals = { 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, 73 };
int avg = calc_avg(testvals);
Console.WriteLine("The average value is : " + avg);
int var = calc_var(testvals);
Console.WriteLine("The variance is: " + var);
Console.ReadLine();
}
private static int calc_avg(int[] testvals)
{
int tmpSum = 0;
for(int x = 0;x<= testvals.Length - 1;x++)
tmpSum += testvals[x];
return tmpSum / testvals.Length;
}
private static int calc_var(int[] testvals)
{
int[] tmpVal = testvals;
int tmpSqr = 0;
int tmpAdd = 0;
int avg = calc_avg(testvals);
//subtract average from each value
for (int x = 0; x <= testvals.Length - 1; x++)
tmpVal[x] = testvals[x] - avg;
//square each value in tmpVal
for (int x = 0; x <= tmpVal.Length - 1; x++)
{
tmpSqr = tmpVal[x] * tmpVal[x];
tmpVal[x] = tmpSqr;
}
//Add the values up
for (int x = 0; x <= tmpVal.Length - 1; x++)
tmpAdd += tmpVal[x];
//Divide result buy number of elements in testvals
return tmpAdd / testvals.Length;
}
|
|
|
|
|
Congratulations! You just did his homework for him!
Now, he hasn't learned a damn thing and will copy and paste you code into a project, turn it in as his own work, and get a failing grade for it! I hope your proud of yourself!
On top of that, this is the VB.NET Forum, not C++ or C#.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 11:51 Tuesday 25th October, 2005
|
|
|
|
|