Phantom Documentation

[Help Home] [Phantom Home]
GetPrevSibling

window window.GetPrevSibling()

Applicable Classes: All

Return Type:
window
Parameters: none

Description:

This function returns the window's previous sibling window. The previous sibling window has the same parent as this window, and is prior to this window in the parent's list of child windows. This is as determined by the window itself, not the declarations file (if used). Therefore, the sibling order will not necessarily match the window order in a window declarations file.

If the window does not have another sibling prior to it, a null window is returned.

Example Code

use "PhantomTarget.dec";
System("PhantomTarget.exe");

# Bring up a controls box
PhantomTarget._Controls.Combo_Box.Select();

# Get low level child
window W = Combo.ComboBox1;

# Give the control time to appear, else W will
# be a null window
Sleep(1);

# Go up the sibling chain. W will be 'false'
# when there is no prior sibling
while(W){
  disp("Tag: " + W.Tag + "; Class: " + W.Class);
  W = W.GetPrevSibling();
}

# Exit out
Combo.OK.Click();
PhantomTarget.Close();


See Also: GetParent, GetNextSibling


Copyright 2000-2011 Phantom Automated Solutions