Restricting a numeric "range" into an input field

Thanks Beatrix,

Yes, there is part of me that is afraid of finishing this project.

Is the feature being discussed here important? Yes, I think it absolutely is. Not just because I like it that way, but there could be possible legal ramifications.

Without getting too much into the “nitty gritty” of it, there are rules and regulations regarding the angles at which a model rocket or pyrotechnic rocket should be launched. In fact, my 90 to 45 degrees is just an example for the purposes of the discussion.

In reality 90 degrees (ie. straight up) would be dangerous. So best to restrict that to 80 degrees, and then according to rules, you shouldn’t launch at less that 60 degrees.

I’ll put it this way: Imagine launching a pyrotechnic rocket, that is a rocket that has on the top of it a “shell”. The shell is filled with “stars”, meaning stars in this context are small pieces of pyrotechnic compositions that ignite and produce colour or glitter effects.

That’s what we all love to see. If that rocket containing the shell (the vessel that holds the stars) is launched straight up (ie. 90 degrees) and the “time fuse” which ignites the burst charge in the shell fails, then re-ignites, falls to the ground and explodes…

Model Rockets have a different purpose, usually altitude is the main game and a recovery system is employed. A parachute or streamers to slow down the decent.

So I have to be careful in a way. Most “pyrotechnic professionals” would already know the dangers and would probably have no interest or need to use my software. My software (will) enable professionals (and amateurs) to measure the thrust performance of the motor, and also display “prediction” of the final altitude. My philosophy is that it’s better to have more information than less.

In any case, there are MANY tutorials out there for making rockets and some failure where people get their fingers blown off, or get badly burnt.

I can’t guard against stupidity, yet I also don’t want to leave myself open for potential litigation. You may well ask “why the heck am I doing it all then?” Well, because pyrotechnics and model rocketry have been an big big interest of mine for many years, and I do enjoy software programming. My Software is just a “tool”.

A picture tells a thousand words. Some of my own experiments:

https://www.youtube.com/watch?v=P-PdhjOJd-I

https://www.youtube.com/watch?v=SNAJ4a01Guo

https://www.youtube.com/watch?v=jBk2jCoV1G0

Skip this one unless you are brave :slight_smile:

https://www.youtube.com/watch?v=t3FQD5VUo5U

6+ minutes of someone adjusting a thrust guage? What brave was required… nothing exciting occurred

I’m more the maths girl than the engineering guy. The long video was not very interesting.

I probably should have said. “Skip this one unless you enjoy watching something where nothing really happens, unless you understand the point”.

btw. It’s not a “thrust gauge” it’s a “Load Cell”.

The point of that video was to show the load cell when “loaded” and the weight is moved off axis and reads the same value. Doesn’t matter. It is an engineering point, and nothing to do with software. perhaps I should not have posted it I guess. but I just wanted to show the “evolution” and the reason why I do what I do.

I’m trying to show “context”. Obviously I’ve failed.

Does anyone have something “positive” to say?

Not about the videos, but about why I want to restrict the input.

Steve, restricting the input is a common need encountered throughout all kinds of apps.

I quickly went through this thread, and I am comfortable you have been given the means to do what you want. I have used keydown for that in my apps, and it is probably the shortest route.

Now, why should we discuss why you want to restrict the input ?

Thanks Michel,

Yes, you are correct in that “HOW” I need to restrict the input, should have nothing to do with the “WHY”.

I have gone way way off track. The WHY is of my own making, the HOW has been pointed out in many and varied ways.

Therefore, to give respect to everyone that has posted on this thread, I must at least TRY the solutions posted and report back as in how it was solved.

I’ll try my best.

[quote=422677:@Beatrix Willius]You are afraid of being finished. I get that, too. From your screenshots the app looks like version 2 or 3 and not version 1.

The most important thing you can do is to get your app to users. Is the feature you are discussing here important?

Fix some remaining - important - bugs and find some beta testers.[/quote]

That’s good advice Beatrix.

I do tend to get caught up in the details, like “what if the user did bla bla bla…” I have spent countless hours trying to come up with ways to ensure the user can’t make an input error (not just with this one). The reality is that these “what if” scenarios are unlikely to occur anyway, and I’m wasting time and diminishing my brain cells (2048 at last count).

As pointed out previously, I have an UPDATE button which will evaluate the user input anyway/s. The update button will only EVER EVER be available providing the previous steps are valid. Therefore easy enough to capture input errors. The Angle input is just one of “inputs” that will be evaluated.

What I have done is very basic to simplify the range when the user selects the UPDATE button:

// Validate Angle Input If Val(txtAngle.Text) < 45 Then txtAngle.Text = Str(45) ElseIf Val(txtAngle.Text) > 90 Then txtAngle.Text = Str(90) End If

The User has no warning of this, and the values will change (if out of range) accordingly, but it’s very simple. However, it will be explained in the Help system. The user is unlikely to cause this event anyway, if they do, then nothing bad will happen to them, and my sanity will remain intact. Perhaps forget the user experience in this case?.. If they don’t like it, then they can find something more interesting to do.

Perhaps Macrame or Reading Tarot Cards (not that there is anything wrong with that), I dunno, that’s up to them!!.. I guess I could probably facilitate this by linking them to the appropriate website… Just thinkin’…

Well, that’s where I’m at with this.