Prev: VB6 application with manifest file
Next: Asking Advice
From: MM on 25 Feb 2010 16:59 On Thu, 25 Feb 2010 14:38:29 -0000, "Dave O." <nobody(a)nowhere.com> wrote: > >"MM" <kylix_is(a)yahoo.co.uk> wrote in message >news:n61do5pg5ndmev3tmg89kh6jvb4o05fpe8(a)4ax.com... > >> And he would otherwise have to type the whole number into a textbox. >> However, I don't have to add any additional validating code. Your "one >> or two lines" is a tad optimistic, in my view, given that different >> ranges would require different min and max values. > >Private Function ValidateNumeric(ToTest As String, MinVal As Long, MaxVal As >Long) As Boolean >If IsNumeric(ToTest) Then ValidateNumeric = (Val(ToTest) >= MinVal) And >(Val(ToTest) <= MaxVal) >End Function > >There you are, 1 line of reusable code - I bet that is far simpler than the >code you use for your auto-complete. > >Here is a slightly more sophisticated version that'll filter out decimal >values like 25.4 > >Private Function ValidateNumeric(ToTest As String, MinVal As Long, MaxVal As >Long) As Boolean >Dim sngNum As Single >If IsNumeric(ToTest) Then > sngNum = Val(ToTest) > ValidateNumeric = (sngNum >= MinVal) And (sngNum <= MaxVal) And >(Int(sngNum) = sngNum) >End If >End Function Okay, so now I say, hey, Dave! I have this new approach that will obviate all that code AND make the app more user-friendly, then what? MM
From: Bob Butler on 25 Feb 2010 17:00 "MM" <kylix_is(a)yahoo.co.uk> wrote in message news:4esdo55d7d8b8lqk0lsjavmhi8slpsuf3o(a)4ax.com... <cut> > Correct. Totally. What I think is happening in this thread with some > respondents is that they took up an original stance and will now not > back down for fear of losing the argument. ROTFL
From: MM on 25 Feb 2010 17:00 On Thu, 25 Feb 2010 07:13:42 -0800, "Bob Butler" <noway(a)nospam.ever> wrote: > >"MM" <kylix_is(a)yahoo.co.uk> wrote in message >news:h92do5dm5tj56e6sdp56rahckfi213ugo7(a)4ax.com... ><cut> >>>If you, and your users, like the drop-downs everywhere then use them. I >>>think you've found a new-fangled hammer and are seeing lots of nails that >>>need pounding. >> >> I really do not see what you think can possibly feel awkward about >> using a combobox. They are found everywhere in software, so it's >> hardly new-fangled. > >I know you don't see. You stopped listening before you made the first post >asking for opinions on your approach. If you like it, use it, just don't be >surprised that not everybody agrees. > >Why do I feel like I'm in the Monty Python argument sketch? Dunno. Ministry of Silly Talks? MM
From: Mike Williams on 25 Feb 2010 17:32 "MM" <kylix_is(a)yahoo.co.uk> wrote in message news:4esdo55d7d8b8lqk0lsjavmhi8slpsuf3o(a)4ax.com... > Correct. Totally. What I think is happening in this thread > with some respondents is that they took up an original > stance and will now not back down for fear of losing > the argument. Isn't that what we all do ;-) Mike
From: Mike Williams on 25 Feb 2010 17:35
"MM" <kylix_is(a)yahoo.co.uk> wrote in message news:8nsdo5ht4fgttaar9l819gt1rmbf71bhdv(a)4ax.com... >>Why do I feel like I'm in the Monty Python argument sketch? > > Dunno. Ministry of Silly Talks? If anyone mentions parrots then I'm off! I can't abide all this OT stuff ;-) Mike |