Local variables retain the type that is first assigned. For example:
EXPORT t2()returns
BEGIN
LOCAL aa;
aa := [1,2,3];
print(aa);
aa := 3;
print(aa);
END;
[1,2,3]which is bound to catch people out.
[[3]]
The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key 255353 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
|
HP Prime - local variables retain their initial type
|
|
« Next Oldest | Next Newest »
|