tymznd
03-19-2003, 12:47 AM
There has to be an easier way to convert data type[] to strings:
Here is part of my code:
//build cluster name
select $curselected[$i];
string $cluster_name = ($null_name + "_cluster");
// check to see if cluster already exists
$cluster_check = `listRelatives -c $null`;
for ($child in $cluster_check) {
if ($child == $cluster_name)
continue;
}
Here are my questions:
1 - so I am assuming that when you do a --for-- in -- operation on an array[] type that the value for each iteration is still an array?? why would this be? if you are iterating through each element in an array, in what scenario would it make sense that the data type stays of type array[]??
2 - Am I missing some sort of command like "ToString" to convert the data type?
3 - Basically I am trying to create a cluster under a null, but I want to check first to see if the cluster already exists... and if it does, to not proceed with creating the cluster(hence the "continue").... so I also wanted any input if there was a better way to do the pre-check. I was going to go with objExists but I may have the same named objects under different nulls and wasn't sure if that would work
Here is part of my code:
//build cluster name
select $curselected[$i];
string $cluster_name = ($null_name + "_cluster");
// check to see if cluster already exists
$cluster_check = `listRelatives -c $null`;
for ($child in $cluster_check) {
if ($child == $cluster_name)
continue;
}
Here are my questions:
1 - so I am assuming that when you do a --for-- in -- operation on an array[] type that the value for each iteration is still an array?? why would this be? if you are iterating through each element in an array, in what scenario would it make sense that the data type stays of type array[]??
2 - Am I missing some sort of command like "ToString" to convert the data type?
3 - Basically I am trying to create a cluster under a null, but I want to check first to see if the cluster already exists... and if it does, to not proceed with creating the cluster(hence the "continue").... so I also wanted any input if there was a better way to do the pre-check. I was going to go with objExists but I may have the same named objects under different nulls and wasn't sure if that would work
