<s> import arcpy <EOL> try : <EOL> feature , features = None , None <EOL> inTable = arcpy . GetParameterAsText ( <NUM_LIT:0> ) <EOL> inField = arcpy . GetParameterAsText ( <NUM_LIT:1> ) <EOL> inPercent = arcpy . GetParameterAsText ( <NUM_LIT:2> ) <EOL> numrows = int ( arcpy . GetCount_management ( inTable ) . getOutput ( <NUM_LIT:0> ) ) <EOL> arcpy . AddMessage ( str ( numrows ) + "<STR_LIT>" ) <EOL> upperval = <NUM_LIT:0> <EOL> count = <NUM_LIT:0> <EOL> features = arcpy . SearchCursor ( inTable , "<STR_LIT>" , None , "<STR_LIT>" , inField + "<STR_LIT>" ) <EOL> feature = next ( features ) <EOL> while feature : <EOL> count += <NUM_LIT:1> <EOL> if ( count >= numrows * ( <NUM_LIT:1> - float ( inPercent ) ) ) : <EOL> upperval = feature . getValue ( inField ) <EOL> break <EOL> feature = nextxt ( features ) <EOL> arcpy . AddMessage ( "<STR_LIT>" + str ( upperval ) ) <EOL> arcpy . SetParameterAsText ( <NUM_LIT:3> , upperval ) <EOL> except : <EOL> if not arcpy . GetMessages ( ) == "<STR_LIT>" : <EOL> arcpy . AddMessage ( arcpy . GetMessages ( <NUM_LIT:2> ) ) <EOL> finally : <EOL> if feature : <EOL> del feature <EOL> if features : <EOL> del features </s>
