Personally, I'd just do something like this in the simplest repeatable way possible:
For a quick and easy tool like this, why bother to choose an operator? Just give both results and save the work, with the process inside a loop to keep it going until you're finished with it.
And that's not to say that the original code is wrong, or bad, in any sort of way. The important thing in coding is to end up with a *finished product that works and does the job desired*. It does that, and it does it nicely. There's nothing in the world wrong with it. It's just nice to sometimes see how other people would handle the same task, and compare methods so that we can optimize our own way of thinking and learn from them, or teach them a trick or two which they may not have thought of for themselves.
*YOUR* way works just fine. *My* way works just fine. Neither is better. I just personally prefer to make my programs where they require the least possible amount of input and effort at run time. I don't to choose an op here, I just provide a simple number; and I don't need to restart to produce a second number. Run it, let it go until I hit <enter> or try and convert a value of 0, and then I can simply type in one value at a time and just glance at the screen as to what my desired converted number is.
I'm lazy. I like to program in a manner that supports me being as lazy as possible.
Code: (Select All)
Do
Input "Give me a value =>"; value#
Print Using "###.## inches = ######.## millimeters"; value#, value# * 25.4
Print Using "######.## millimeters = ###.## inches"; value#, value# / 25.4
Loop Until value# = 0
For a quick and easy tool like this, why bother to choose an operator? Just give both results and save the work, with the process inside a loop to keep it going until you're finished with it.
And that's not to say that the original code is wrong, or bad, in any sort of way. The important thing in coding is to end up with a *finished product that works and does the job desired*. It does that, and it does it nicely. There's nothing in the world wrong with it. It's just nice to sometimes see how other people would handle the same task, and compare methods so that we can optimize our own way of thinking and learn from them, or teach them a trick or two which they may not have thought of for themselves.
*YOUR* way works just fine. *My* way works just fine. Neither is better. I just personally prefer to make my programs where they require the least possible amount of input and effort at run time. I don't to choose an op here, I just provide a simple number; and I don't need to restart to produce a second number. Run it, let it go until I hit <enter> or try and convert a value of 0, and then I can simply type in one value at a time and just glance at the screen as to what my desired converted number is.
I'm lazy. I like to program in a manner that supports me being as lazy as possible.