The program will not stop because you have uninitialized values.
All variables start out uninitialized.
There is an implied contract when you call a function. The function agrees to do it’s job when you supply it with all the required arguments, of the correct type, and in the specified order.
Often passing uninitialized values violates that contract.
It’s your job as a programmer to adhere to all of the terms and conditions of a function’s contract … or find another function!
In this case the contract is with the + operator which requires all arguments be a number.
Without you doing initialization it’s ambiguous what the correct answer is.
In your example:
var = var + 1
Some might think that with an un-initialized variable the result should be 1.
Others would argue the result should be un-initialized.
You should code this as:
if (var) then
var = var + 1
else
var = 1
end
So is there a instruction to set all empty values to zero in case of error
No and there never will be. If you were going to operate on strings the variables would need to be initialized to empty strings .... This is your responsibility as a programmer to do the appropriate initialization.