def ← PopUpMenu.RequestSelection[
choice: LIST["rope", "int", "char", "r", "i", "c"],
label: "Test out",
default: 0
];
SELECT def
FROM
1 => {
r: Rope.ROPE ← TerminalIO.RequestRope["rope>"];
TerminalIO.WriteRope["["];
TerminalIO.WriteRope[r];
TerminalIO.WriteRope["]\n"];
};
2 => {
i: INT← TerminalIO.RequestInt["int>"];
TerminalIO.WriteRope["["];
TerminalIO.WriteInt[i];
TerminalIO.WriteRope["]\n"];
};
3 => {
c: CHAR ← TerminalIO.RequestChar["char>"];
TerminalIO.WriteRope["\n["];
TerminalIO.WriteChar[c];
TerminalIO.WriteRope["]\n"];
};
4 => {
r: Rope.ROPE ← TerminalIO.RequestRope[];
TerminalIO.WriteRope["["];
TerminalIO.WriteRope[r];
TerminalIO.WriteRope["]\n"];
};
5 => {
i: INT← TerminalIO.RequestInt[];
TerminalIO.WriteRope["["];
TerminalIO.WriteInt[i];
TerminalIO.WriteRope["]\n"];
};
6 => {
c: CHAR ← TerminalIO.RequestChar[];
i: INT ← LOOPHOLE[c, INTEGER];
TerminalIO.WriteRope["\n["];
TerminalIO.WriteChar[c];
TerminalIO.WriteInt[i];
TerminalIO.WriteRope["]\n"];
};
ENDCASE => TerminalIO.WriteRope["skipped\n"];