Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Return value

string

Examples

Code Block
languagetext
// Get the string of an item in the List Box User Control

...


int $windowId;

...


int $controlId; 

...

int $i, $numItems;

...


string $itemStr;

...


 

...

// First create a User Window to place the Control on

...


$windowId = `createWindow "MyWindow"`;

...


 

...

// Create the User Control on the Window. 

...

$controlId = `createListBox $windowId`;

...


 

...

// Add some items to the List Box.

...


addListBoxItem $controlId "Item 1";

...


addListBoxItem $controlId "Item 2";

...


addListBoxItem $controlId "Item 3";

...


 

...

// Get the number of items.

...


$numItems = `getNumListBoxItems $controlId`;

...


 

...

// Iterate through the list of items.

...


for( $i = 0; 

...

     $i < $numItems; 

...

     $i += 1 )

...


 { 

...

   $itemStr = `getListBoxItem $controlId $i`; 

...


   print $itemStr;

...


 }

Additional information

Related commands

...