RosettaCodeData/Task/String-comparison/Seed7/string-comparison-1.seed7

26 lines
885 B
Plaintext

$ include "seed7_05.s7i";
const proc: showComparisons (in string: a, in string: b) is func
begin
writeln("compare " <& literal(a) <& " with " <& literal(b) <&":");
writeln("a = b returns: " <& a = b);
writeln("a <> b returns: " <& a <> b);
writeln("a < b returns: " <& a < b);
writeln("a > b returns: " <& a > b);
writeln("a <= b returns: " <& a <= b);
writeln("a >= b returns: " <& a >= b);
writeln("compare(a, b) returns: " <& compare(a, b));
writeln("compare(lower(a), lower(b)) returns: " <& compare(a, b));
end func;
const proc: main is func
begin
showComparisons("this", "that");
showComparisons("that", "this");
showComparisons("THAT", "That");
showComparisons("this", "This");
showComparisons("this", "this");
showComparisons("the", "there");
showComparisons("there", "the");
end func;