Re: [RESOLVED] Advice needed for a message box if not enough data entered.
Did you manage to solve your issue? Since you are a beginner i would just point out two thing's with the function you are using. Unless you plan on using it else where in your project it should be private. Nothing else has any business knowing it exists. The second issue is this line
Code:
If IsDataEnough() = True Then
IsdataEnough is a Boolean. You are comparing this to true twice.
Code:
If IsDataEnough() Then
It's also worth saying i would strongly suggest using the validating event of each textbox. When you are ready then call Me.ValidateChildren()
I find looping the textbox controls a really messy way of validating the values.
Re: [RESOLVED] Advice needed for a message box if not enough data entered.
Quote:
Originally Posted by
ident
The second issue is this line
Code:
If IsDataEnough() = True Then
IsdataEnough is a Boolean. You are comparing this to true twice.
Code:
If IsDataEnough() Then
I'd be surprised if the compiler reads that line of code any differently tho, the VB.net compiler can't be that stupid, can it?
Re: [RESOLVED] Advice needed for a message box if not enough data entered.
Ident, thanks for the tips, much appreciated.
Incidentals, plenty of hair to pull, but it's all grey. I may PM you, but I don't want to be a pain in the backside. It is my very first project, unfortunately I found some of this code on the web, written by a person who never actually got it to work, he had all the Pythagoras coding wrong, it took me two weeks to figure it out, but I was delighted when I did. But, as you are now aware, it is time to put in tests and message boxes, which for me, is proving a difficult task. But I will continue on.
Steve.
Re: [RESOLVED] Advice needed for a message box if not enough data entered.
Quote:
Originally Posted by
Edgemeal
I'd be surprised if the compiler reads that line of code any differently tho, the VB.net compiler can't be that stupid, can it?
I'd be interested in knowing but from what i was taught so can only go by that, the compiler read's If (express = true) = true. regardless it add's more noise to your code.
Re: [RESOLVED] Advice needed for a message box if not enough data entered.
@SteveHeather
I have created my implementation for right triangle calculator check it out, you are free to improve it as you wish.
Re: [RESOLVED] Advice needed for a message box if not enough data entered.
Quote:
Originally Posted by
4x2y
@
SteveHeather
I have created my implementation for right triangle calculator
check it out, you are free to improve it as you wish.
Yes I like it very much, it has certainly shown me how to improve on my one, this example will help me out a lot, thanks 4x2y.
Edit: I have noticed that you have achieved all this without having to use Pythagoras Theorem, that it is good also, it cuts out a lot of code. You have used Pythagoras as a way of checking that the three sides make a right-angled triangle. Great way of doing it.
Re: [RESOLVED] Advice needed for a message box if not enough data entered.
Quote:
Originally Posted by
SteveHeather
Yes I like it very much, it has certainly shown me how to improve on my one, this example will help me out a lot, thanks 4x2y.
To simplified the code, i didn't implement heavy checks on entered data, but you can do to make it super intelligent e.g. show a separate warning message for
If the user input sideA or sideB >= sideC as it is impossible in right triangle
If the user input 0 on any field
If the user input negative on any field
If the user input letters on any field
etc...
Quote:
Originally Posted by
SteveHeather
Edit: I have noticed that you have achieved all this without having to use Pythagoras Theorem, that it is good also, it cuts out a lot of code.
I worked on this code with a lot of pleasure as it is refresh my memory and back me to high school days :)
Re: [RESOLVED] Advice needed for a message box if not enough data entered.
Quote:
Originally Posted by
4x2y
I worked on this code with a lot of pleasure as it is refresh my memory and back me to high school days :)
Well that is good then, but it will help me in future projects, I can learn a lot from examples like yours.