I need to sort a single dim string array. I'd like to NOT use an index for this.
product_name[n]
Any sugestions or code snippets would be appreciated.
product_name[n]
Any sugestions or code snippets would be appreciated.
<MvFUNCTION NAME = "qsort" PARAMETERS="array VAR" STANDARDOUTPUTLEVEL = "">
<MvASSIGN NAME = "l.a" VALUE = "1" >
<MvASSIGN NAME="l.max" VALUE="{ miva_array_max( l.array) }">
<MvWHILE EXPR = "{ l.a LE l.max }">
<MvIF EXPR = "{ l.array[l.a] }">
<MvASSIGNARRAY NAME="l.sorted_array" VALUE="{ l.array[l.a] }">
<MvMEMBER NAME="{ l.array[l.a] }">
<MvDIMENSION INDEX="{ miva_array_max( miva_variable_value('l.sorted_array:'$ l.array[l.a]))+1 }">
</MvASSIGNARRAY>
</MvIF>
<MvASSIGN NAME = "l.a" VALUE = "{ l.a+1 }" >
</MvWHILE>
<MvFUNCRETURN VALUE="{ miva_array_deserialize(trim(l.sorted_array)) }">
</MvFUNCTION>
Comment