Simple Chat

version 4 by Mark Tilford

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Readchoice I6 routine

    Include (-
    [ ReadChoice low high i;
    for (::) {
    print ">> ";
    KeyboardPrimitive (buffer, parse);
    i = TryNumber (1);
    if (i >= low && i <= high) return i;
    else print "[Please answer by typing a number between ", low, " and ", high, ".]^";
    }
    ];
    -).

    To decide what number is the choice made from (low value - a number) to (high value - a number): (- ReadChoice ( {low value}, {high value} ) -).