|
Ciels wrote: I want to use the figures in the way they've been given to me, some with decimals and the others without
I assume that you want to remove decimal points when presenting this data in your report? If so, read up on the Format() function. For example:
Format(123.456, "###0")
will output the string
"123"
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
You can't remove a decimal place from a numeric type - it just makes no sense at all. If you use types that are not floating point, you won't get a decimal. Your basic problem is that VB is weakly typed and probably turns integer values into floating point for you, by magic.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well, from what you've described, you've got some debugging to do because your code is doing something other than what you think it should be. Since you're using Long's (an Integer type), it's impossible for VB to put any kind of a decimal point anywhere in the number. So, there's nothing to "get rid of".
The description of the problem is just plain impossible based on the code you've posted. The decimal point is comming from something else...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi there.
I am performing certain operations on dataset which is loaded with xml as the input. i have done so many changes to it "step by step".
"how to rollback each and every step"
thanks in advance..
bharath.s
|
|
|
|
|
You don't. Changes made to a DataSet are not transactional so, therefore, there's nothing to rollback. Only when the changes are written back to the datastore can anything be wrapped in a transaction.
The only way to "rollback" the changes to the DataSet object is to clear the DataSet object and reload the data from the XML file.
You might be able to come up with something like an Undo command to "rollback" changes. This would require you to implement the Command pattern, wrapping the DataSet. Sorry, I don't have any examples specific to your problem, but there are plenty of examples implementing Undo in a Text Editor. All you have to do is Google for "command pattern undo"[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 11:43 Thursday 16th March, 2006
|
|
|
|
|
Hi there,
A really quick question
I have something like this in my shared dll.
Imports System.Runtime.Remoting
Public Interface ISKMDialog
Function showDialog(ByVal id As Integer, ByVal guid As System.Guid, Optional ByVal needResult As Boolean = True, Optional ByVal queueit As Boolean = True, Optional ByVal urgent As Boolean = False) As requestResult
Enum requestResult
OK = 1
WAIT = 2
DIALOG_NOT_FOUND = 3
End Enum
End Interface
Public Class CSKMDialog
Inherits MarshalByRefObject
Implements ISKMDialog
Public Delegate Sub dialogRequest(ByVal id As Integer, ByVal needResult As Boolean, ByVal queueit As Boolean, ByVal urgent As Boolean)
Public Event dialogShowEvent As dialogRequest
Public Function showDialog(ByVal id As Integer, ByVal guid As System.Guid, Optional ByVal needResult As Boolean = True, Optional ByVal queueit As Boolean = True, Optional ByVal urgent As Boolean = False) As ISKMDialog.requestResult Implements ISKMDialog.showDialog
RaiseEvent dialogShowEvent(id, needResult, queueit, urgent)
End Function
Public Overrides Function InitializeLifetimeService() As Object
Return Nothing
End Function
End Class
And in my main class I am doing something like this
Private WithEvents sharedObject As New dialogShared.CSKMDialog
Private Shared ref As ObjRef
Private chan As TcpChannel
Private Sub MarshallSharedObject()
chan = New TcpChannel(15090)
ChannelServices.RegisterChannel(chan)
ref = RemotingServices.Marshal(Me.sharedObject, "dialog")
ref.URI = "tcp://localhost:15090/dialog"
End Sub
In my constructor am calling above function,
Problem is remote object’s lifetime, even though am overriding InitializeLifetimeService() function and returning nothing but still my object get destroyed. If after 10 minute I call in my main class something like this
Dim o As System.Runtime.Remoting.Lifetime.ILease = sharedObject.GetLifetimeService()
MsgBox(o.CurrentLeaseTime.ToString)
It returns a negative lifetime value. If I try to get this object from my other app after 10-15 minute it says “unable to find service”. My main application is a gui app.
Any ideas, am stuck with this.
Qaiser.
|
|
|
|
|
Problem get solved,
It was my own silly mistake.
|
|
|
|
|
Hi!
I am writing a commport app. who recives a bytearray trough the com port.
Now i whant to assert that the first character is ascii HEX (start of text) and the last is ascii ETX(end of text) in the array. I have been stucked with this for a while,
and i am new to programming so i would relly appreciate help.
Any one now where i can find help? Or help me with the some sample(easy way out)
Sture
|
|
|
|
|
I have no idea what ASCII value for HEX is. I think you're talking about the ASCII character code STX, which is 2 and ETX, which is 3. All you have to do is scan the array you have and compare each value to 2 to find the start of the string, then keep comparing until you find 3, the end of the string.
Other than that, you'll have to be more specific about what your having a problem with...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave you are so right. But not so easy when your a naab.
This i what i'm trying to do.
Dim Buffer() As Byte
Buffer = Encoding.ASCII.GetBytes(source.InputStreamString)
Dim a As Byte = 2 '= Buffer(0)
Dim b As Byte = 3 '= Buffer.Length - 1
If a = Buffer(0) And b = Buffer(Buffer.Length - 1) Then
lbHex.Items.Add("WIIIIIIIIII: " & source.InputStreamString)
sture
|
|
|
|
|
Hi
I developed an application using VB.NET with VS 2005.
I add xml comments as needed to every method/class/members etc.
Now i want to create an help file based on this comments.
I found a convertion tool for C# (NDoc) but not for VB.NET.
I need a simple tool to create a MSDN like help file based on VB.NET xml coments.
Tnx
|
|
|
|
|
NDoc works with the documentation XML file generated at compile time, not the source code files. So, NDoc will work with VB.NET comments, to a point. Check out this[^] article here on CP for more information.
Google results for "vb.net ndoc"[^]...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
anyone know the command to pause the media player and continue playing?
|
|
|
|
|
|
yes i seen tis b4 i try to .play but error pop up said it not a memeber of the axmediaplayer...
|
|
|
|
|
1. how to write and create a ms word document usign vb 6.0
2. how to read and write to and from a txtfile
3. how to create a program using vb 6.0 that reads all the tables and their fieldnames on a database, and put them on a txtfile or in a textbox
thank you!!!!
adikkaymonic
|
|
|
|
|
Based on your questions, I can't figure out your level of experience. Based on question #2, I think your totally new to programming, but I can't be sure. So don't take this the wrong way when I say "Google is your friend!".
Google results for "vb6 read text file[^].
"vb6 create Word document"[^]
#3 depends heavily on the "table" you're using, be it an Excel worksheet, Access database, SQL Server, or something else...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i use access database
adikkaymonic
|
|
|
|
|
Good Day,
Can I add custom tool strips other than the ones in VS2005?
Where can I download them from?
Regards
Leavashni
|
|
|
|
|
What do you mean by "custom tool strips"??? If you're looking for different prebuilt controls you can check to see if any of the big vendors has what you're looking for. Like Infragistics, ComponentOne, ... I think you'd be looking for Layout Managers or something similar.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i have a stastic method in tha calss, how to invoke constructor,
when called with class name in VB.NET
Thanks in advance
Understanding comes form failures
Sucesses comes form understandinf failures
|
|
|
|
|
in my above question ...
I am sorrry Shared Method...........
|
|
|
|
|
Shared (Static in C#) methods don't belong to any instance of a class, so there is no constructor to call...
When calling a Shared method, you do not have to create an instance of the class that's hosting the method. You just call it! For instance, the Environment[^] class is full of Shared methods. You can call any of them at any time, without creating an instance of the Environment class first:
Dim myPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
how to upload files into webserver that is in to our project folder
thanks..
|
|
|
|
|
A little searching of the articles goes a long way!
File Upload with ASP.NET
[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|