Nicool
09-03-2004, 12:55 PM
Hi!
I want to create a function taht checks if a string is in a given strings array. But I have return problem. It seems I must give a return 0 statement if I want it to work, but if I give a return 0, is return always zero, so I can't check if the string is or not in the array. Urgent
global proc int isStringInArray(string $array[], string $string) {
for($arrayString in $array) {
if($string == $arrayString) {
return 1;
} else {
// return 0; If I do not add else statement, the function can't be loaded into maya
}
}
}
I want to create a function taht checks if a string is in a given strings array. But I have return problem. It seems I must give a return 0 statement if I want it to work, but if I give a return 0, is return always zero, so I can't check if the string is or not in the array. Urgent
global proc int isStringInArray(string $array[], string $string) {
for($arrayString in $array) {
if($string == $arrayString) {
return 1;
} else {
// return 0; If I do not add else statement, the function can't be loaded into maya
}
}
}
