Вопрос

I'm very sorry to bother you on this outdated language, but is there any way to check if the particular array element is empty in pascal? It's an integer array, so checking element against empty string causes type mismatch (I love this language!). Thanks for your time.

Это было полезно?

Решение

An integer value cannot be empty. It always holds a value. It's not like a nullable type in certain modern languages.

Sometimes, by convention, certain values are used as sentinels, but you obviously need to apply this convention consistently across all uses of the variable. What's more, a sentinel is only viable if you have some spare values that do not have a meaning in whatever calculation you are performing.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top