Sort a list of object identifiers: Difference between revisions

no edit summary
m (→‎{{header|REXX}}: align comments.)
No edit summary
Line 580:
for _, oid in pairs(OIDs) do print(oid) end
</lang>
 
=={{header|M2000 Interpreter}}==
In this example we have to change dot to #, to make each number as an integer one.
<lang M2000 Interpreter>
Module CheckIt {
Flush ' empty stack of values
Data "1.3.6.1.4.1.11.2.17.19.3.4.0.4" , "1.3.6.1.4.1.11.2.17.19.3.4.0.1", "1.3.6.1.4.1.11150.3.4.0.1"
Data "1.3.6.1.4.1.11.2.17.19.3.4.0.10", "1.3.6.1.4.1.11.2.17.5.2.0.79", "1.3.6.1.4.1.11150.3.4.0"
\\ Inventories of type queue can get same keys, and have sort where numbers (float type) as part of key count as numbers
Inventory queue OID
\\ prepare keys (replace dot to #)
While not empty {
Append OID, Replace$(".","#", letter$)
}
Sort Ascending OID
n=Each(OID)
a$=""
While n {
\\ replace # to dot
a$+=Replace$("#",".", Eval$(n))+{
}
}
Clipboard a$
Report a$
}
Checkit
</lang>
{{out}}
<pre>
1.3.6.1.4.1.11.2.17.5.2.0.79
1.3.6.1.4.1.11.2.17.19.3.4.0.1
1.3.6.1.4.1.11.2.17.19.3.4.0.4
1.3.6.1.4.1.11.2.17.19.3.4.0.10
1.3.6.1.4.1.11150.3.4.0
1.3.6.1.4.1.11150.3.4.0.1
</pre>
 
=={{header|Perl}}==
Anonymous user