День добрый!
Я зачастую использую Byte, Word, LongWord в качестве флагов.
Прилагаю снимок экрана. И я хотел бы узнать, тот код, что выделен, в таком варианте и попадает в программу?
Если да, то по какой причине, проверка осуществляется в процессе исполнения программы? Почему эта проверка не происходит на этапе компоновки, когда ещё программа не скомпилирована.
Я специально проверил, да, программа вылетает по ошибке, сообщая, что было переполнение. Но не было ни какого предупреждения, что число взято больше чем возможно взять.
В данном случае, я думаю, изначально должно идти предупреждение и, если программист (человек создающий программу) не хочет обращать внимания на то что ему сообщил компилятор, то просто "обрезать" ему это число.
Данная проверка, ни как не поможет ни разработке программы, ни её работе, ни поиску произошедших ошибок. Но может добавить ошибку при отладке!
google translate:
Good afternoon!
I often use Byte, Word, LongWord as flags.
Attached is a screenshot. And I would like to know the code that is highlighted, in this variant and gets into the program?
If so, for what reason, the check is carried out during the execution of the program? Why does this check not occur at the link stage, when the program has not yet been compiled.
I specifically checked, yes, the program crashes by mistake, reporting that there was an overflow. But there was no warning that the number was taken more than it was possible to take.
In this case, I think, initially there should be a warning, and if the programmer (the person creating the program) does not want to pay attention to what the compiler told him, then simply "cut off" this number for him.
This check will neither help the development of the program, nor its work, nor the search for errors that have occurred. But may add an error when debugging!
Sorry! Error = 201.