Clear Method

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Use the Clear method to remove a section along with all its subsections and options.

Declaration

ProgObj.Clear()

ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section
Result None

Applies To

The method is applied to the following objects:

Result Value

None.

Remarks

Be careful when modifying the system registry using the Section object methods. Incorrect modifications made to the registry may affect the functionality of your operating system and the applications installed.

Example

The following code snippet deletes the specified registry key.

JavaScript, JScript

function Test()
{
  var Key;
  // Gets an object for the Windows system registry key and deletes the key
  Key = Storages.Registry("TestKey\\SubKey", HKEY_CURRENT_USER)
  // Deletes the key
  Key.Clear();
}

Python

def Test():
  # Gets an object for the Windows system registry key and deletes the key
  Key = Storages.Registry("TestKey\\SubKey", HKEY_CURRENT_USER)
  # Deletes the key
  Key.Clear()

VBScript

Sub Test
  Dim Key
  ' Gets an object for the Windows system registry key and deletes the key
  Set Key = Storages.Registry("TestKey\SubKey", HKEY_CURRENT_USER)
  ' Deletes the key
  Key.Clear
End Sub

DelphiScript

procedure Test();
var Key;
begin
  // Gets an object for the Windows system registry key and deletes the key
  Key := Storages.Registry('TestKey\SubKey', HKEY_CURRENT_USER);
  // Deletes the key
  Key.Clear;
end;

C++Script, C#Script

function Test()
{
  var Key;
  // Gets an object for the Windows system registry key and deletes the key
  Key = Storages["Registry"]("TestKey\\SubKey", HKEY_CURRENT_USER)
  // Deletes the key
  Key["Clear"]();
}

See Also

DeleteSubSection Method
DeleteSubSectionByIndex Method

Highlight search results