Actually an example of both would be nice. Thanks
justmeTW
Posts
-
How to count character, words, sentences and paragraphs -
How to count character, words, sentences and paragraphsI have a really big problem here. This is what I need to do: Create a Class Library (I did that)in this class it will open a *.* file and once that file is open it needs to read that file and then count the number of characters, words, sentences and Paragraphs. I created a ReadOnly Property for each: Ex: Public ReadOnly Property as Characters as Integer For each of these properties they need to have hidden variables for the ReadOnly property to return. The hidden variables is where I need the calucaltion to be at to count the characters, words,...ect. Can someone just give me one code for either one of the above counts and I should beable to go from there? Thanks in advance!
-
over/under flow questionSo to use the try/catch for the over/underflow the code should be something like this: Try myAnswer = myNumber1 / myNumber2 MessageBox.Show(msg1, "Invalid format") Catch ex1 as System.OverflowException msg1 = "Error: Invalid Arguement," & vbCrLt _ & ex1.message End Try Is this what I would use to bypass the overflow and underflow error exception? apferreira wrote: I would suggest using an extended textobx control that would validate user input instead of using try/catch clauses. Can you go a little more into depth? And if possible an example code. If I see the code I understand more. Thanks so much for the help
-
over/under flow questionI basically have three problems here. First I have created a Calculator but it uses error handlers. I have searched to find codes to create a overflow exception code and underflow exception but found no luck. What I want to do is create an overflow and underflow code so that if the interger is over or under the input then it will bypass the following message: "Unhandled exception of type "System.Overflow" occurred in microsoft.visualbasic.dll" And the same for the underflow exception error too. The last problem I need help on is creating another code so that if the user inputs 1.1.1.1 then an error message will occur. The user is only allowed to enter one decimal point and if the user inputs more than one in the text field then I would like an error message to appear. I know how to create an error message but don't know what code to use if there is more than one decimal inputted. I would also like all the codes to use the Try/Catch statements. Can anyone help me? Thanks in advance
-
ASAP How to create Strings/SubStringsColin wrote: If the user gets it wrong, by all means, focus on the control, but don't delete the text - What if the user just mistyped one character? Do they want to have to type it all in again, or just correct the erroneous character. If the input is not valid I am to clear the textbox and set focus back to it and have then re-enter the phone number. That is why I did it that way, it's part of the assignment. I know there is a way to have the error part to be selected instead of the whole thing but right now I am just trying to get the required part done and understand how to do it. My main problem is with creating the substrings and how to get the IsNumeric function to skip the dashes and only read the numbers. I forgot to add that it only clears the box if the txtTel.Text is a letter char, if it is a number is won't clear it.
-
ASAP How to create Strings/SubStringsI'm in a Programming class that is suppose to be step-by-step, but it's not, that is why I am having so much difficulty. Colin wrote:What output are you getting? When I type in a letter char I'm suppose to get a error message, if I just use the following code it works: If IsNumeric(txtTel.Text) = False then txtTel.Text = Nothing txtTel.Focus msgbox("Please enter a numeric value") end if Is works as long as I don't have the dashes in the text box. What my assignment calls for is to create a string for the phone number 999-999-9999 then create 3 substrings for each part of the orginal string (999-999-9999). The first substring should be "999", second substring "999" and third substring "9999" but my book doesnt explain how to create the substrings. I have search throught the VB help and every other resource I have found, but still don't understand how to create the substrings and then use them for the IsNumeric function. Colin wrote: If the user gets it wrong, by all means, focus on the control, but don't delete the text - What if the user just mistyped one character? Do they want to have to type it all in again, or just correct the erroneous character. If the input is not valid I am to clear the textbox and set focus back to it and have then re-enter the phone number. That is why I did it that way, it's part of the assignment. I know there is a way to have the error part to be selected instead of the whole thing but right now I am just trying to get the required part done and understand how to do it. My main problem is with creating the substrings and how to get the IsNumeric function to skip the dashes and only read the numbers.
-
ASAP How to create Strings/SubStringsThis is the code I have but I'm not getting the output correct. What am I doing wrong? Dim MyString As String Dim intLen As Integer MyString = (999 - 999 - 9999) MyString.Substring(0, 2) MyString.Substring(4, 6) MyString.Substring(8, 11) intLen = Len(MyString) If IsNumeric(MyString.Substring(0, 2)) = False Then txtTel.Text = Nothing txtTel.Focus() MsgBox("Please enter a numeric value") End If If IsNumeric(MyString.Substring(4, 6)) = False Then txtTel.Text = Nothing txtTel.Focus() MsgBox("Please enter a numeric value") End If If IsNumeric(MyString.Substring(8, 11)) = False Then txtTel.Text = Nothing txtTel.Focus() MsgBox("Please enter a numeric value") End If What am I not doing right?
-
ASAP How to create Strings/SubStringsHow do you create the string and substrings for a valid entry?
-
Changing letter casingThis is great, only one small problem, I dont know how to create substrings to work correctly, any ideas?
-
ASAP How to create Strings/SubStringsHow do you create a string with 3 substrings to validate a telephone number. I know I can use the MaskEdit tool but I can't in this program. I have to use the IsNumeric function to determine is the textbox has the correct data. The telephone number is in the format of 999-999-9999, where 9 is represented by any number. I have to create 3 substrings for each part of the number. Also when I click on my button to exe the IsNumeric function I get my error message I created "Please enter a numeric value" because the dashes are not a number, how do I stop the error message without removing the IsNumeric function. HELP PLEASE ASAP Thanks in advance
-
Changing letter casingMy problem is how to test it, what code or codes do I use to test it, so it will automatically change the first char to an upper.
-
Changing letter casing:(( I am using VB.NET and I have tried to find how to format a textbox to automatically change the first letter into a uppercase when someone types in the textbox. For example, I start typing in, food, when the first letter isnt capitalized I want it to automatically convert that first letter to uppercase, Food. Can anyone help? :confused: Tonnie