Utility.Empty(Check)
.Empty() returns true or false depending if the parameter passed is empty. This is the scripting version of the Functions and Operators > Empty() function.
Note: This should only be used to test DEACOM Element value properties. It will not work on basic JavaScript Arrays, Objects, or undefined variables.
Applies To
Properties and Methods
None
Available
The .Empty(Check) method is available in:
- 15.03.016
- All newer builds
Type
Boolean
Syntax
Utility.Empty(Check);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
Check |
Yes |
Deacom element value property |
Example
var ldStartDate = Event.Form.Inputs('Input_cCONTMAN_startdate').Value
var lcText = undefined;
var laArray = [];
var loObj = {};
Event.Form.MessageBox('String with one or more space(s): ' + Utility.Empty(' ') +
'\nNumber set to 0: ' + Utility.Empty(0) +
'\nEmpty Date Element: ' + Utility.Empty(ldStartDate) +
'\n\nWill not work on the following:' +
'\nUndefined variable: ' + Utility.Empty(lcText) +
'\nEmpty Array: ' + Utility.Empty(laArray) +
'\nEmpty Object: ' + Utility.Empty(loObj));
/* Expected Prompt Response:
String with one or more space(s): true
Number set to 0: true
Empty Date Element: true
Will not work on the following:
Undefined variable: false
Empty Array: false
Empty Object: false
*/