September 2017
Beginner
402 pages
9h 52m
English
In the previous sections of this chapter, we did not say anything about the types of the $a and $b parameters of the add function. The code of the sub assumes that the arguments should be numeric because the + operator is used. Calling a function with two strings as arguments, for example, add('Hello', 'World'), will generate the following runtime error:
Cannot convert string to number: base-10 number must begin with valid digits or '.' in 'Hello' (indicated by
)
This exception happens at runtime. Although the compiler sees that ...
Read now
Unlock full access