SetClient

From SCAR Divi Manual
Jump to: navigation, search

Definition

function SetClient(const Client: TSCARClient): TSCARClient;

Availability

SCAR Divi 3.35 > Current

Description

Sets a given TSCARClient Client as the currently active target client for the script's execution. The previously active client object is returned.

Example

begin
  SetClient(TSCARWindowClient.Create(GetDesktopWindow)).Free;
end.

Example (Return Value)

var
  Client, NewClient, StoredClient: TSCARClient;

begin                   
  ClearDebug;
                          
  Client := GetClient;
  NewClient := TSCARWindowClient.Create(GetDesktopWindow);
 
  StoredClient := SetClient(NewClient); 
  WriteLn(StoredClient = Client);  
  WriteLn(StoredClient = NewClient);   
   
  StoredClient := SetClient(Client); 
  WriteLn(StoredClient = Client);  
  WriteLn(StoredClient = NewClient);
end.

See Also