SetClient

From SCAR Divi Manual
Revision as of 09:49, 8 August 2012 by Freddy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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