RosettaCodeData/Task/Sort-stability/M2000-Interpreter/sort-stability-3.m2000

27 lines
483 B
Plaintext

Module Stable2 {
Inventory alfa
Stack New {
Data "UK London","US New York","US Birmingham", "UK Birmingham"
While not empty {
Append alfa, Letter$
}
}
sort alfa
k=Each(alfa)
Document A$
NL$={
}
While k {
A$= Eval$(k, k^)+NL$
}
Clipboard A$ ' write to clipboard
Report A$
}
Call Stable2
Output:
UK Birmingham
UK London
US Birmingham
US New York