read_multilines: Read one or more lines from the console for the first...

View source: R/extra-websocket.R

read_multilinesR Documentation

Read one or more lines from the console for the first successful parse

Description

read_multilines reads one or more lines from the terminal (in interactive use).

Usage

read_multilines(prompt = "")

Arguments

prompt

the string printed when prompting the user for input. Should usually end with a space " ".

Details

This function repeatedly calls readline until enough inputs are provided to reach a successful parse.

This can only be used in an interactive session.

Examples

## Not run: 
# In an interactive session
read_multilines()
1 + 2  # expect immediate success

read_multilines()
1 +
2 +
3  # expect success here

## End(Not run)


sketch documentation built on Oct. 23, 2022, 5:07 p.m.