Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Ask Reuben 87 - NULL (Test for Success)  (Read 1218 times)
Reuben B.
Four Js
Posts: 972

« on: August 17, 2021, 04:34:28 am »

I was looking at a support case recently where the value returned from a function was NULL when it was expected to contain a value.  The puzzling thing was the change that led to the function returning NULL had occurred a few years ago and we were wondering why it had not been detected earlier.  The reason it had not been detected was that a test to check the value did not consider the possibility that the value could be NULL.

In this article I show some strategies for coding expressions so that if a value is unexpectedly NULL your code will detect that the value is not as you expect, and take the right path through an IF ELSE.


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of
Contributor to
Pages: [1]
  Reply  |  Print  
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines