Hello to one and all,

I'm not the most gifted code writer in the world, some of you may have already noticed from some of the previous scripts I've posted, but I do give it the old college try.

I'm trying to make the following script work with an Array. But the only thing I can ever get it to print out is the number of elements in the array (not the elements itself, but the actual number of elements I've declared in the the Dimensioning of the Array).

I've looked at some examples to do it, but I'm not sure how to get it to work correctly and the manual's helpfile example is about as useful as a box of matches in the middle of a windstorm.

In the example below, I'd like to be able to read from an array and ping the various machines. For a variety of reasons I've had to replace IP addresses with "machine1, machine2, etc."

The "$scf" found in the script would eventually be replaced by the Array variable.

Thanks in advance for any and all help to one and all.

Z.

code:
;******************************** Déclaration des vairables  *********************************
;
GLOBAL
$ddl,$ddl1,$bdl1,$bdl2,$ping_file,$ping,$reponse,$scf,$scf2
;
$scf="machine1"
$scf="machine2"
$scf2="machine3"
$ddl="machine4"
$bdl1="machine5"
$bdl2="machine6"
$ping_file=c:\temp\ping.txt ;fichier de sauvegarde pour les pings
$ping="" ;variable de la ligne en cours de lecture
;
;*************************************** Vérification des réponses *************************
;
CLS
? "Pinging the $scf, please wait a moment"
shell '%comspec% /c "ping $scf >> $ping_file"'
IF Open (1,$ping_file)=0
$ping=ReadLine(1)
WHILE @ERROR = 0
SELECT
CASE INSTR($ping,"de la")
$reponse = "The $scf down"
CASE INSTR($ping,"TTL")
$reponse = "The $scf is Alive"
ENDSELECT
$ping=ReadLine(1)
LOOP
$nul=close(1)
del $ping_file
ENDIF
? $reponse