Checking for all null values in a field, record or array elementΒΆ

isblank()

Check for all null values in a field, record or array element


SYNTAX

isblank(field_id | record_id)

isblank(field_id[index] | record_id[index])

This function checks for null values, returning TRUE if all values found are null, otherwise FALSE. Null values are defined as follows:

Field type

Null value

Numeric

zero

Alpha

all spaces

Binary

all bytes binary zero

The fields or elements to be checked are determined from the arguments to the function, as follows:

field_id

All elements of the field

field_id[index]

The specified element of the field

record_id

All elements of all fields in a !record structure

record_id[index]

The specified element of all fields in the record whose dimension is greater than or equal to index.


NOTES

  • The behaviour of this function with fields that have more than one dimension is undefined.


EXAMPLE

Test for an all null record before inserting it:

!file NamesFile "C:/Tim/SCULPTOR/ProgGen/testfiles/names"
!record TmpNames = NamesFile

!function OKInsert() {

     if (isblank(TmpNames)) {
          prompt "", \
               " Insert a record with all null values - are you sure? " \
                    button = " Yes " \
                    button = " No  ", INSERT_CONTINUE
     }

     NamesFile = TmpNames
     insert NamesFile re = INSERT_RE riu = INSERT_RIU traps = INSERT_TRAPS

RELATED TOPICS

Data fields

Field dimensions