Clear method

Official Content
This documentation is valid for:

Clears or empties the variable based on an Extended data type, to which you apply the method.

Syntax

&VarBasedOnExtendedDataType.Clear()

Type returned:
Numeric

Scope

Extended data types: ExcelDocument, MailRecipientCollection, StringCollection, WebSession
Generators: .NET.NET Framework, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

Description

This method clears or empties the variable based on an Extended data type, to which you apply the method.

In the case of:

  • ExcelDocument: It deletes the contents of all cells in the active worksheet.      
  • MailRecipientCollection/StringCollection: It empties the collection. All collection elements are deleted.
  • WebSession: It clears the web session variables.
Note:This method returns an error code, so it is possible to call it as a function (&Err = &DataType.Clear()).

See Also

ExcelDocument data type
MailRecipient Data Type
MailRecipientCollection Data Type
StringCollection Data Type