|
I tryed this now
Private Sub TempNumH_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TempNumH.TextChanged
Dim Temp As Integer
Dim TempNum As Integer
Temp = TempSensors.Text
TempNum = TempNumH.Text
If Temp >= TempNum Then
phidgetIFK.outputs(0) = True
Else
phidgetIFK.outputs(0) = False
End If
End Sub
and this is what i get
An error occurred creating the form. See Exception.InnerException for details. The error is: Conversion from string "" to type 'Integer' is not valid.
???
i dont no how to check if phidgetIFK.outputs(0) is an actualy Boolean value
I am just starting out and i think i might be taking on to much for starters
Thanks Scott
modified on Friday, August 7, 2009 9:10 AM
|
|
|
|
|
Bob Beaubien wrote: Temp = TempSensors.Text
converting strings to integers probably fails on an empty string.
Bob Beaubien wrote: i might be taking on to much for starters
Here is my recommendation[^] for you.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi,
try this:
Dim TempSensed As Integer = TempSensors.Text
Dim TempReference As Integer = TempNumH.Text
Console.WriteLine("sensed=" & TempSensed & " ref=" & TempReference)
phidgetIFK.outputs(0)= Temp >= TempNumH.Text
and you will see what is going on.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
modified on Friday, August 7, 2009 7:12 AM
|
|
|
|
|
Hi Luc
I try what you told me to try and this is what i got
The error is: Object reference not set to an instance of an object."}
Thanks
Y
|
|
|
|
|
Do you know how to set a breakpoint and use the debugger to step through your code line by line ?
In your source code you would place the cursor on the line where you want the application to stop executing and press the F9 key; this will set a breakpoint on that line. Now run your application by pressing the F5 key and when the program hits the breakpoint, you will see your source code and you can execute the program line by line by pressing the F8 key.
You should be able to figure out your logic error using this method.
Regards,
David
|
|
|
|
|
dear all
i would like to calculate the ATAN(), but how to add math library or component to project? thanks a lot.
|
|
|
|
|
You should be able to refer to the static Math class, like this
Math.Atan() The Math class is part of the System namespace and should already be available in your project without needing to add additional references.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
|
Well for 1, if all these classes are in the same namespace you wont be able to compile.
You can't have multiple classes with the same name in any namespace (except with partial classes ... but those are really only one class spread over multiple files).
You have declared the Hello class 3 times, that is not even close to valid.
2nd;
in all your classes you override your function 'hi' with a different signature than the one defined in Hello. A signature is a combination of the name of the function and the parameters it expects. For your 'hi' function in [Hello] you declared it as not expecting any parameters, the in your inherited classes you are trying to override it with a function that expects a string as a parameter.
You should really read this article[^] to help you understand inheritance because it seems like your not totally understanding it.
so your code should look something like this; (Probably wont compile because my VB is very rusty)
public mustinherit class Hello
'What you had
public MustOverride Function hi() as string
'What i added because you were trying to override this without having it
public MustOverride Function hi(byVal name as String) as string
end class
public class NorthEasterner
inherits Hello
'this HAS to be overriden because its declared as 'MustInherit'
public Overrides Function hi() as String
'No name was passed in so just welcome the stranger
return "Hello Stranger"
end function
'this HAS to be overriden because its declared as 'MustInherit'
public Overrides Function hi(ByVal name as String) as String
return "How ya doin," & name
end function
end class
public Class DragRacer
Inherits Hello
'this HAS to be overriden because its declared as 'MustInherit'
Overrides Function Hi() As String
Return "Start your engines!"
End Function
'this HAS to be overriden because its declared as 'MustInherit'
public Overrides Function hi(ByVal name as String) as String
return "Start your engines " & name & "!"
end function
End Class
public Class Euro
Inherits Hello
'this HAS to be overriden because its declared as 'MustInherit'
Overrides Function Hi() As String
Return "Caio"
End Function
'this HAS to be overriden because its declared as 'MustInherit'
public Overrides Function hi(ByVal name as String) as String
return "Caio " & name
end function
End Class
You could put all of these classes in separate code files, just make sure they are all in the same namespace and your golden. By default all of the code files you add should share the 'Default Namespace' defined in the project properties dialog.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
|
Celina69 wrote: I have an assignment
so it is YOUR assignment. we don't do homework here, and your prof probably reads this site too.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Great ...
You NEED to read up on inheritance, especially if this is a project for school.
Inheritance is a very important aspect of the .NET framework ( or any OO language for that matter) and not understanding it will do nothing but cause headaches in the future.
I'm sure you were assigned a book to read that covers this in painful detail.
I AM NOT GOING TO COMPLETE YOUR PROJECT FOR YOU, although I can't blame you for trying.
Not to mention I'm positive your teacher is familiar with CP, and I'm also pretty sure getting code of the net for your project is a big no no.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
The obvious thing to do is to create a new project (probably a Console app) and paste the code snippets into it (one at a time).
The compiler will tell you if there any syntax errors.
You can fix those and then try running the code to see if there are any run-time errors (step through it with the debugger).
That way you will learn something.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
|
Do not repost. It is considered rude here.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
|
Sometimes silence can be deafening...
My advice is free, and you may get what you paid for.
|
|
|
|
|
I really cannot help you with your problem.
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
employee information is privileged indeed.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
As there is no information do we assume you are not employed?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
It has to be a candidate for best post ever !!!!
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I guess that you must be posting from The Empty Quarter[^]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
in vb.net how i get the start and stop time in timer control... that mean if i having two textbox. if named as start and stop. in that i need to click mean the timer to start and click stop maen the timer will stop autimatically... i need a vb.net code for this concept..
|
|
|
|
|
What have you got so far?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Very good!
Make the bugger work, I bet it is a homework problem for college.
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|