BLANK function

BLANK() BLANK()

Returns

A blank value.

Returns a blank value.

Fields without an assigned value are said to be blank, and fields with an assigned value are said to be defined. A field without an initial value is considered to be blank before a user types a value into it.

Use ISBLANK and ISDEFINED to check if a value is blank and if a value is defined, respectively.

This formula returns FALSE:

ISDEFINED(BLANK())ISDEFINED(BLANK())

This formula returns TRUE:

ISBLANK(BLANK())ISBLANK(BLANK())

IFBLANK is a convenient way of returning a different value if a value is blank, or the value itself otherwise:

IFBLANK(Field1, 0)IFBLANK(Field1; 0)

The preceding formula returns the value of Field1 (Field1.ValueField1,Value) if it isn't blank, and 0 otherwise.

While Calcapp does not allow parameters to functions to be omitted entirely, BLANK()BLANK() can be used for all parameter values. Most functions have required parameters, though, and functions will likely return an error when your app is run if a required parameter is blank.

This function is specific to Calcapp.

Assigning a blank value

Action formulas, which are run when events are triggered (including when a button is pressed), can assign values to fields using the assignment operator :=.

These equivalent formulas both assign 0 to the value of Field1:

Field1 := 0Field1 := 0
Field1.Value := 0Field1,Value := 0

These formulas instead assign a blank value to the value of Field1:

Field1 := BLANK()Field1 := BLANK()
Field1.Value := BLANK()Field1,Value := BLANK()

Examples

BLANK()BLANK()

Returns a blank value.

ISDEFINED(BLANK())ISDEFINED(BLANK())

Returns FALSE.

ISBLANK(BLANK())ISBLANK(BLANK())

Returns TRUE.

IFBLANK(BLANK(), 4)IFBLANK(BLANK(); 4)

Returns 4.

IFBLANK(Field1.Value, 4)IFBLANK(Field1,Value; 4)

Returns Field1.ValueField1,Value if said value is defined, and 4 if the value is blank.

{ 2, 4, IF(Field1 > 20, 6), 8 }{ 2; 4; IF(Field1 > 20; 6); 8 }

Returns the array { 2, 4, 6, 8 }{ 2; 4; 6; 8 } only if Field1 has a value that is greater than 20. Otherwise, the array { 2, 4, 8 }{ 2; 4; 8 } is returned. In other words, IF inside of an array can be used to determine if an array element should be part of the array by leaving out the third parameter to IF.

{ 2, 4, IF(Field1 > 20, 6, BLANK()), 8 }{ 2; 4; IF(Field1 > 20; 6; BLANK()); 8 }

Returns the array { 2, 4, 6, 8 }{ 2; 4; 6; 8 } only if Field1 has a value that is greater than 20. Otherwise, the array { 2, 4, BLANK(), 8 }{ 2; 4; BLANK(); 8 } is returned. This example illustrates that leaving out the third parameter to IF results in the element being omitted entirely from the array, whereas using BLANK()BLANK() as the third parameter instead includes a blank value.

Field1 := BLANK()Field1 := BLANK()

Assigns a blank value to the value of Field1. The assignment operator := may only be used from an action formula, such as a formula associated with the OnPress property of formula buttons.