ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage properties / Various properties
  • Looper, List Box, Combo Box and Table control
  • Chart control
  • Using the Empty property on a report
  • Empty property used in the arrays and in the associative arrays
  • Limits
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The Empty property is used to determine if:
  • a Looper, Table, List Box or Combo Box control is empty. The field can be a file or memory field.
  • a Chart control contains no series.
  • a report control is empty (control linked to an item).
  • an array (or an associative array) contains no element.
  • an element of an associative array exists or not.
  • a queue, a list or a stack contains no element.
For a report, the Empty property is used to determine if the value of an item bound to a control has been specified for the current record.
New in version 2025
WEBDEV - Browser code This function is now available in browser code for File and Pile variables.
Example
// This control becomes visible 
// if the value of the item linked to the "EDT_Phone" control
// is not specified for the current record 
IF EDT_Phone.Empty = False THEN
	SAI_Telephone.Visible = False 
END
// If the "TABLE_CustomerTable" control is empty, 
// add a new row into this control
IF TABLE_CustomerTable.Empty = True THEN
	TableAddLine(TABLE_CustomerTable, "Davis", "Peter")
END
Syntax
<Result> = <Element used>.Empty
<Result>: Boolean
  • True if the specified element is empty,
  • False otherwise.
<Element used>: Type of element
Name of the element to be used.
Remarks

Looper, List Box, Combo Box and Table control

The Empty property is used to determine if the control is empty (the Empty property returns True).
This property applies to the Table, TreeView Table, List Box, ListView, Combo Box and Looper controls (see Limits).
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadIOS WidgetUser code (UMC)PHPAjax

Chart control

The Empty property is used to determine if the Chart control contains no series (the Empty property returns True).
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadIOS Widget

Using the Empty property on a report

For a report, the Empty property is used to determine if the value of an item bound to a control has been specified for the current record.
Note If the value of the item linked to the specified field, for the record currently being printed, corresponds to an empty string (""), this value is not considered empty.

Empty property used in the arrays and in the associative arrays

The Empty property is used to determine:
  • If an array or associative array is empty (Empty property returns True).
    Example:
    // Associative array of file sizes
    aaFileSize is associative array of int
    ...
    IF aaFileSize.Empty = False THEN
    	Info("The array contains at least one element")
    END
  • Whether an element of an associative array exists or not. For an associative array without duplicates, the Empty property is set to False if the element exists. For an associative array with duplicates, the Empty property is set to False if at least one element exists.
    Example:
    // Associative array of integers 
    // indexed on strings and with duplicates
    aaIDPerCustomer is associative array of int
    // Add the identifier of customer "A"
    aaIDPerCustomer["A"] = 55
    // Add the identifier of customer "B"
    aaIDPerCustomer["B"] = 321
    
    IF aaIDPerCustomer["A"].Empty = False THEN
    	Info("At least one element A exists")
    END

Limits

WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadIOS Widget In the code of reports, the Empty property cannot be used on:
  • a report,
  • a report block,
  • a Check Box control,
  • a Shape control,
  • an Internal Report control,
  • an RTF control.
The property Empty property can only be used on fields linked to an item (Calculated control, Bar Code, etc.).
WINDEVWINDEV Mobile The Empty property applies only to:
  • Table (and TreeView Table) controls,
  • List Box (and ListView) controls,
  • Combo Box controls,
  • Looper controls,
  • Chart controls,
  • Array and Associative Array variables.
  • Queue, List or Stack variables.
WEBDEV - Server code The Empty property applies only to:
  • Table controls,
  • TreeView Table controls,
  • List Box controls,
  • Combo Box controls,
  • Looper controls,
  • Chart controls,
  • Array and Associative Array variables,
  • Queue, List or Stack variables.
WEBDEV - Browser code The Empty property applies only to:
  • Table controls,
  • TreeView Table controls,
  • List Box controls,
  • Combo Box controls,
  • Looper controls,
  • Array and Associative Array variables.
  • New in version 2025
    variables of type File and Pile.
Java The Empty property can only be used with the following elements:
  • List Box controls,
  • Combo Box controls,
  • Table controls,
  • Array and Associative Array variables,
  • Queue, List or Stack variables.
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo Empty
// Exemplo Empty

IF COMBO_NoName1..Empty THEN
EDT_Text1="COMBO_NoName1 Vazio"+CR
ELSE
EDT_Text1="COMBO_NoName1 Tem Dados"+CR

END
IF COMBO_NoName2..Empty THEN
EDT_Text1+="COMBO_NoName2 Vazio"+CR
ELSE
EDT_Text1+="COMBO_NoName2 Tem Dados"+CR

END
IF TABLE_Bancos..Empty THEN
EDT_Text1+="TABLE_Bancos Vazio"+CR
ELSE
EDT_Text1+="TABLE_Bancos Tem Dados"+CR
END
IF TABLE_NoName1..Empty THEN
EDT_Text1+="TABLE_NoName1 Vazio"+CR
ELSE
EDT_Text1+="TABLE_NoName1 Tem Dados"+CR
END

// Blog com Video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/11/aula982-dicas-009-empty.html

https://www.youtube.com/watch?v=dJzHDZ2-hD8

De matos
04 Dec. 2016

Last update: 10/23/2024

Send a report | Local help