James1992, on 15 November 2012 - 02:08 AM, said:
Therefore, because button Find Next does not modify the values, it is in fact button Find where we would write the code for the mode (i.e. whether we want to find whole words or matchcase or both). Correct?
There are a number of ways to do this sort of thing, The Find() function takes between 2 and 4 arguments. The first two are mandatory, and the compiler will report an error without them. The second two are optional. So the call to Find() may include both offset and mode. Examples might be:
Find(needle, haystack, 25, mode)
Find(needle, haystack, , mode)
Another way to do this is to have your CheckBox.CheckedChanged subroutine handle the setting of Mode. Of course, you need to provide code for doing that within the Finder class.
Quote
Yes.
Quote
No. As lucky3 pointed out, it would make no difference to the operation of the code. However, if you work with those options Off, then turn them On, you might find that you have a lot of errors in data typing or declarations. These errors are often not a problem, except that there can be errors that are important, and that can be difficult to isolate without proper data typing. Consider the following code, working with TextBoxes:
' txtSubtotal.Text contains 40.00 ' txtTax.Text contains 5.00 txtTotal.text = txtSubtotal.Text + txtTax.Text
With Option Strict Off, txtTotal will end up containing "40.005.00", because a "+" is an overloaded operator for strings, which performs the same operation (concatenation) as an "&".
I like to advise folks to work with both the options On. It makes you think about what you are doing. And isn't as much effort to code with as the possible effort to find an obscure bug.
As I mentioned last night, I am definitely a beginner at OOP, and am hoping that someone will jump in with further comments and recommendations if they see anything that needs improving.

New Topic/Question
Reply





MultiQuote



|