// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // // // // float floatArrayContains(float $item, float[] $list) // // // Return true if array contains the item. // // The array may contain more than one occurrence of the item. // This procedure will return true as soon as it finds one // occurrence. // // // float $item The float item to search for in the float array. // float[] $list A list of float values. // // // float : True if the float array contains the item. // // // float $list[] = { 1., 2., 3. }; // // ,Result:, 1 2 3 // // int $found = floatArrayContains( 1.0, $list ); // // Result: 1 // // $found = floatArrayContains( 2.0, $list ); // // Result: 1 // // $found = floatArrayContains( 0.0, $list ); // // Result: 0 // // // // global proc int floatArrayContains(float $item, float $list[]) { float $listItem; for ($listItem in $list) { if ($item == $listItem) return true; } return false; }