Use io.read() Beware that the function can be customised with different parameters. Here are some examples.
s = io.read("*n") -- read a number s = io.read("*l") -- read a line (default when no parameter is given) s = io.read("*a") -- read the complete stdin s = io.read(7) -- read 7 characters from stdin x,y = io.read(7,12) -- read 7 and 12 characters from stdin and assign them to x and y a,b = io.read("*n","*n") -- read two numbers and assign them to a and b
Related Posts:
- Concatenation of strings in Lua
- How to remove a lua table entry by its key?
- What is a good game engine that uses Lua?
- “attempt to index a nil value”-error in Lua
- How to get number of entries in a Lua table?
- How to dump a table to console?
- Lua – if statement with two conditions on the same variable?
- Lua string to int
- Does Lua have OR comparisons?
- Lua – Number to string behaviour
- Lua: Rounding numbers and then truncate
- How to math.floor to a decimal in Lua?
- How do I append to a table in Lua
- Lua Semicolon Conventions
- Logitech/LGHUB Lua – Loop with break
- Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- Why use conio.h?
- What is EOF in the C programming language?
- PHP “php://input” vs $_POST
- What is EOF in the C programming language?
- Is there any way to change input type=”date” format?
- Why am I getting InputMismatchException?
- Lua Program Delay
- How to prompt for user input and read command-line arguments
- Why would we call cin.clear() and cin.ignore() after reading input?
- Getting Keyboard Input
- How to read groups of integers from a file, line by line in C++
- Split a string using string.gmatch() in Lua
- Lua replacement for the % operator
- Inline conditions in Lua (a == b ? “yes” : “no”)?
- Lua string.format options
- What does Scanner input = new Scanner(System.in) actually mean?
- Reading in from System.in – Java
- What does CreateFile(“CONIN$” ..) do?
- Creating a timer using Lua
- How to add a “sleep” or “wait” to my Lua Script?
- Reading from .txt file into two dimensional array in c++
- What is the difference of pairs() vs. ipairs() in Lua?
- Check if input is integer type in C
- What does Scanner input = new Scanner(System.in) actually mean?
- java.util.NoSuchElementException – Scanner reading user input
- How would I use a while loop to keep requesting user input
- How do I check if the user is pressing a key?
- C++ – pointer being freed was not allocated error
- Lua read beginning of a string
- Phone mask with jQuery and Masked Input Plugin
- How to delete a specific line in a file?
- Input Type URL – Says “Please enter a URL” if HTTP is not included
- Why does Lua have no “continue” statement?
- Using a do-while loop to check a User’s input in Java
- Resource leak: ‘in’ is never closed
- Lua String replace
- How to iterate through table in Lua?
- CSS/HTML: Create a glowing border around an Input Field
- Using cin to input a single letter into a char
- Multiple inputs on one line
- Mask for an Input to allow phone numbers?
- Lua operators, why isn’t +=, -= and so on defined?
- Is there a float input type in HTML5?
- input() error – NameError: name ‘…’ is not defined
- istream and ostream problem – C++
- What’s a Good Javascript Time Picker?
- How to use redirection in C for file input
- How to empty input field with jQuery
- wp_insert_post add meta_input
- Sanitizing integer input for update_post_meta
- Send attachments via wp_mail from temporary folder
- Add extra field to users
- Custom Post Type with Input fields to seperate table on database.
- Get user id from email?
- Correct Approach for Validating Custom Field Input
- Get all posts from custom post type and insert in select input as metabox
- How to get the image url in the input box from media library?
- WordPress widget / plugin….fields not appearing in my widget
- Refresh page after update_post_meta
- Quicktags on all textarea.. Not working on plugin?
- Add input field to ‘Pages > Edit Page’ through functions.php
- Let users create a new custom taxonomy entry from frontend (without creating a post)
- Add description text under input field for new profile fields
- How to replace a javascript select box onchange event to a form submit action?
- Sanitizing comments or escaping comment_text()
- Get data from dropdown and update page
- How do I setup nested repeatable option fields?
- Custom Post Type, Saving Multiple Checkboxes
- Add field to dashboard to update embedded URL on homepage?
- plugin settings – uploading multiple files with a single button
- using checked function to verify value against an array
- WSoD being caused by this piece of code
- How to save data of an input field to an array
- New custom theme option (text input) giving index error
- input data and output table [closed]
- how to upload a image from frontend with wp_insert_post and also update_post_meta?
- Enter name and email on the Product page and keep the input data on the Checkout page
- Add select input with pre defined classes to insert image screen?
- Override admin submit_button() functionality
- Plugin settings page checkbox not saving – one options array with sub array
- Why Won’t My Inputs in a form with a Get method work together?
- WordPress (admin) posts search GET request filter