10-28-2023, 07:44 PM
For example:
N# <= calculated before the loop
0000050 ENTER => 50
000050 ENTER => 50
00050 ENTER => 50
0050 ENTER => 50
050 ENTER => 50
50 ENTER => 50
0000000 ENTER => 0
000000 ENTER => 0
00000 ENTER => 0
0000 ENTER => 0
000 ENTER => 0
00 ENTER => 0
0 ENTER => 0
0000123 ENTER => 123
000123 ENTER => 123
00123 ENTER => 123
0123 ENTER => 123
123 ENTER => 123
ENTER => N#
When the ENTER key is pressed, it is supposed to take the value calculated before the loop. Then H# = N#
There is probably also a possibility, which I have not written about before, that if you press the zero (0) key, there will be an automatic exit from the loop. There is no point in entering zeros (0) before significant figures. If someone hits zero (0), you know that nothing will happen further. But this is an additional option.
<bplus> is close to solving it but for some unknown reason it doesn't want to finish the job. And I respect that.
My code works fine, I just wanted to improve it. If this is a big problem, the topic can be closed.
N# <= calculated before the loop
0000050 ENTER => 50
000050 ENTER => 50
00050 ENTER => 50
0050 ENTER => 50
050 ENTER => 50
50 ENTER => 50
0000000 ENTER => 0
000000 ENTER => 0
00000 ENTER => 0
0000 ENTER => 0
000 ENTER => 0
00 ENTER => 0
0 ENTER => 0
0000123 ENTER => 123
000123 ENTER => 123
00123 ENTER => 123
0123 ENTER => 123
123 ENTER => 123
ENTER => N#
When the ENTER key is pressed, it is supposed to take the value calculated before the loop. Then H# = N#
There is probably also a possibility, which I have not written about before, that if you press the zero (0) key, there will be an automatic exit from the loop. There is no point in entering zeros (0) before significant figures. If someone hits zero (0), you know that nothing will happen further. But this is an additional option.
<bplus> is close to solving it but for some unknown reason it doesn't want to finish the job. And I respect that.
My code works fine, I just wanted to improve it. If this is a big problem, the topic can be closed.