Have a ready set of nulls (of different data types) instead of using SetNull() each time you need a variable with null.
Sometimes we use variables, which are set to null - for example, to pass null to a function, or, oppositely, to return null from a function. Usually developers declare a variable and nullify it with SetNull() in the same script where they are used, but these two lines (really, hundreds lines all over the project!) can be avoided if you declare constants of different data types in a globally-accessed object. Technically, PowerBuilder doesn't allow to initialize constants with NULL, so we cannot use the method, described in the topic "Constants used all over the application" (i.e. to create an object n_null with a set of NULL constants). Instead, we will utilize any class, a global object of which is created in the application (an object, providing different technical services - like n_util - is an ideal candidate) and declare a set of public instance variables using privatewrite access modifier. Then we will nullify them using SetNull() in the Constructor. So, we will have physical variables which practically work as constants.
Step 1: Declare the NULL vars in the instance variables declaration section of the chosen class:
// NULLs of different data types: privatewrite boolean NULL__BOOLEAN privatewrite int NULL__INT privatewrite long NULL__LONG privatewrite dec NULL__DEC privatewrite string NULL__STRING privatewrite char NULL__CHAR privatewrite date NULL__DATE privatewrite time NULL__TIME privatewrite datetime NULL__DATETIME