Old Russian measure of length: Difference between revisions
Content added Content deleted
imported>Thebeez |
imported>Arakov |
||
Line 1,377: | Line 1,377: | ||
{ |
{ |
||
if (program_arguments.Length != 3) |
if (program_arguments.Length != 3) |
||
{ console.writeLine |
{ console.writeLine("need two arguments - number then units"); AbortException.raise() }; |
||
real value := program_arguments[1].toReal(); |
real value := program_arguments[1].toReal(); |
||
Line 1,384: | Line 1,384: | ||
{ |
{ |
||
console.printLine("only following units are supported:", |
console.printLine("only following units are supported:", |
||
unit2mult.selectBy:(x=>x.Item1).asEnumerable()); |
unit2mult.selectBy::(x=>x.Item1).asEnumerable()); |
||
AbortException.raise() |
AbortException.raise() |
||
Line 1,391: | Line 1,391: | ||
console.printLine(value," ",unit," to:"); |
console.printLine(value," ",unit," to:"); |
||
unit2mult.forEach:(u,mlt) |
unit2mult.forEach::(u,mlt) |
||
{ |
{ |
||
console.printPaddingLeft(30, u, ":").printLine(value * unit2mult[unit] / mlt) |
console.printPaddingLeft(30, u, ":").printLine(value * unit2mult[unit] / mlt) |