From 1ac66258b5aad36a0f5dffee08982007c5baf07a Mon Sep 17 00:00:00 2001 From: jnthn Date: Fri, 13 Feb 2009 22:23:33 +0100 Subject: [PATCH] Implement prompt built-in. --- src/builtins/io.pir | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/builtins/io.pir b/src/builtins/io.pir index 639664f91de..87c957ba04e 100644 --- a/src/builtins/io.pir +++ b/src/builtins/io.pir @@ -148,6 +148,19 @@ It is an error to use bare C without arguments. .end +=item prompt + +Shows the supplied message and then waits for input from $*IN. + +=cut + +.sub 'prompt' + .param string prompt + 'print'(prompt) + $P0 = get_hll_global "$IN" + .tailcall $P0.'readline'() +.end + =back =cut