New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.. Absent Member..
Absent Member..
3858 views

what is that nullsub ?

hi
I began to learn the new service manager

What is code nullsub explain to

 

Example:

not nullsub($G.bg, false)

or

 

nullsub(different.from.contact in $file, false)=true

0 Likes
2 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

It means nullsub(v1,v2) this function will return with v1 if it's not null, if v1 is null then it'll return with v2.

 

nullsub(different.from.contact in $file, false)=true this will be true if "different.from.contact in $file" = "true"

 

not nullsub($G.bg, false)  this should be a condition for something, it will be true when $G.bg=null.

0 Likes
Highlighted
Absent Member.
Absent Member.

A nullsub evaluates the first parameter, and if it does not have a value, substitues the second parameter to evaluate the expressions.

 

nullsub(different.from.contact in $file, false)=true

If different.from.contact in $file is Null, substitute false for it and evaluate the expression, else just compare against the saved value for diferent.from.contact


If different.from.contact in $file is not NULL, then the statement will evaluate:

different.from.contact in $file=true

If different.from.contact in $file is  NULL, then the statement will evaluate:

false=true    (result is false)

 

Another use would be:

service.recipient in $file=nullsub(service.recipient in $file, contact.name in $file)

In this example, if the user has not populated the service reipient field, but has populated the contact.name field, the contact.name will be copied to the service.recipient field..

But if they have specified a recipient, it would not overwrite the existing data.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.