|
I tried the bottom part, and it didn't work, I am asking if anyone knew what I needed to do to change it so that it will work in contrast with the top part.
|
|
|
|
|
Code is-
If Text3.Text > 42949672945 Then
MsgBox "Should be between 0 to 4294967295"
When I save it, a # is added to the 42949672945 and code becomes like this-
If Text3.Text > 42949672945# Then
MsgBox "Should be between 0 to 4294967295"
Text3 is a simple data type whose format is Number.
It is the problem of data type that VB does not support.?
Plz guide me what may be the problem?????
Thanks in adv...
|
|
|
|
|
Text3.text is a String data type, so you need to convert that string to a value to do a comparison with your 429....number.
|
|
|
|
|
jainiraj wrote: 42949672945
you should avoid those magic constants. If they are the result of some calculation, just write the calculation; and if there is a symbol for them, use the symbol.
Here you seem to want (1<<32)-1 which is UInt32.MaxValue
Furthermore, 42949672945 isn't an acceptable value, as numeric constants by default are signed integers, so they can't exceed (1<<31)-1 which is Int32.MaxValue
Finally, you need to convert your Text3 content to a number; there are .NET methods for that purpose.
And since you are accepting the entire range of unsigned integer, it can all boil down to:
Dim val as UInt32;
Dim OK as boolean=UInt32.TryParse(Text3.Text, val)
if Not OK Then MsgBox(...)
|
|
|
|
|
Thanks for ur reply..
But it is not working and give an error "No user defined UInt32" data type exist.
Can u help me how to find max length of UInt32??
|
|
|
|
|
System.UInt32.MaxValue
which is 4,294,967,295. The problem with using UInt32 is that it's not CLS-compliant, so you might get some warnings about that.
|
|
|
|
|
Actually problem may be that I am using VB 6.0 and there is no UInt32 data type.
Is it correct??
|
|
|
|
|
yes.
if you are enquiring about VB6 you should put "VB6" in your message and subject line. Always.
|
|
|
|
|
Yep. VB6 has no unsigned integer data types and doesn't have an integer type that supports a number that large. So, it's appending the "#" character to the number to force it to be treated as a Double, which is a floating point type.
I highly suggest abandoning any new developement in VB6 and move to VB.NET.
|
|
|
|
|
Hi,
I am able to extract the text from the PDF file using the PDFStripper, but I would like to read the Table of content of the PDF document. How can I do that? How do I know the Page I am reading is Table of Contents? and also how to differentiate the Chapter heading and the subsection of chapter of the Table of Content?
Any help in this is highly appreciated.
Thanks
Neil
|
|
|
|
|
Do NOT cross post in multiple forums. I makes collaborating on an answer near impossible.
|
|
|
|
|
I have found a code from the net, but its not working properly.
It is related to UDP socket creation.
Senario is like when we click on "send data" button a "hello" string should pass from client to server which are on the same machine.
Problem is when I click on "send data" button it gives an error-
code is-
Private Sub Form_Load()
' Set the control objects when the form loads.
Set wsClient = Me!axWinsockClient.Object
Set wsServer = Me!axWinsockServer.Object
' Set the protocol for client and server.
wsClient.Protocol = sckUDPProtocol
wsServer.Protocol = sckUDPProtocol
' Set the host and ports for client and server. Because client
' and server are the same computer in this example, set RemoteHost
' equal to LocalIP.
wsServer.RemoteHost = wsClient.LocalIP
wsServer.RemotePort = 1007
wsClient.Bind 1007
End Sub
Private Sub CmdSend_Click()
' Send a broadcast message from the server.
wsServer.SendData "Hello"
End Sub
Private Sub axWinsockClient_DataArrival(ByVal bytesTotal As Long)
Dim strServerMsg As String
' When a message arrives from the server, display it in a text
' box.
wsClient.GetData strServerMsg, vbString
Me!Text1.Value = strServerMsg
End Sub
Here axWinsockClient and axWinsockServer are the socket control or winsock on the same form. and "hello" string should be print in text box.
On debugging I found it is not calling axWinsockClient_DataArrival() method.
What may be the problem.
Thnks in adv..
modified on Friday, September 3, 2010 8:11 AM
|
|
|
|
|
You left out the most important part of the question. WHAT'S THE ERROR YOU'RE GETTING??
|
|
|
|
|
|
Perhaps you should post what the error was and what you did to fix it so that other people with the same problem can benefit from your post
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
Give him a break, he was just reminded about errors.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I wasn't trying to be sarcastic, but someone could actually benefit from it
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
Somehow, I doubt it. If all it took was to read the eorror message, I think the solution was obvious from whatever the message was.
|
|
|
|
|
Yeah good point, sorry
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
|
No I am not going to click a suspicious link.
See if you can crack this: fb29a481781fe9b3fb8de57cda45fbef
The unofficial awesome history of Code Project's Bob!
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
Hi, dear all,
I create a database using Access database.
There are some fields with data type Yes/No, I want to know to tell the difference of Null and False.
Right now even if I never set value for these field, they return false to me. I wants to clarify the difference.
I use the following code, but doesn't work, suppose I have a field called Marriage which is type Yes/No.
if user never fill in value for it, it should return Null, otherwise, return true or false
Dim obj as Object
obj = ResultSet.Tables(0).Rows(0).Item("Marriage")
If IsDBNull(obj) Then
return Nothing
ElseIf obj.ToString() = "True" Then
return True
Else
return False
End If
it always reutrn "False" to me.
Thanks!
|
|
|
|
|
I hope you were smart enough and googled your question. an adequate suggestion is readily available.
|
|
|
|
|
I search from google first, but didn't find any answer.
|
|
|
|
|
for decimal data type, everything is ok, only for Yes/No data type, if you didn't set value for it, it return False to you.
|
|
|
|