I tested this method on my CompPswdAge script. It worked...

code:
FOR EACH $Item IN $List.Items
$List.SetFocus
$Item.Selected = 1
$RC = IsPing($Item.SubItems(0).Text)
$PingError = @error
SELECT
CASE $PingError = 0
$PingStatus = 'On'
CASE $PingError = 1
$PingStatus = 'RAS'
CASE $PingError = 2
$PingStatus = 'Off'
CASE $PingError = 3
$PingStatus = 'Gone'
CASE 1
$PingStatus = 'PROBLEM'
ENDSELECT
$Item.SubItems(1).Text = $PingStatus
$Item.SubItems(2).Text = $AddressIP
$Item.SubItems(3).Text = $AddressName
$Item.SubItems(4).Text = $IPError
$List.Items.Selected = 0
NEXT

I agree on the 'Goto' suggestion, however.

[ 05. November 2002, 19:41: Message edited by: Chris S. ]