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’
- PHP “php://input” vs $_POST
- Why am I getting InputMismatchException?
- Why would we call cin.clear() and cin.ignore() after reading input?
- Getting Keyboard Input
- Split a string using string.gmatch() in Lua
- Inline conditions in Lua (a == b ? “yes” : “no”)?
- Reading in from System.in – Java
- 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++
- How do I check if the user is pressing a key?
- C++ – pointer being freed was not allocated error
- Phone mask with jQuery and Masked Input Plugin
- Input Type URL – Says “Please enter a URL” if HTTP is not included
- 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
- Multiple inputs on one line
- Lua operators, why isn’t +=, -= and so on defined?
- Is there a float input type in HTML5?
- 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
- 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.
- Correct Approach for Validating Custom Field Input
- Get all posts from custom post type and insert in select input as metabox
- 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
- Sanitizing comments or escaping comment_text()
- How do I setup nested repeatable option fields?
- Custom Post Type, Saving Multiple Checkboxes
- 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
- 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
- WordPress (admin) posts search GET request filter
- Sizing textarea field in custom metabox
- Allow HTML in Settings API input field
- Remember form field values with page navigation
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- Frontend Category Checkbox
- get value from selected input
- WP Page Options Array
- Input with pattern not working
- How to make blog post entries appear as input form instead of just text?
- Adding a single text input field to a custom Dashboard widget
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Display custom-post type based on the Title matching the current selected value
- Adding text box with add_meta_box
- $_POST field value gets altered after “init”
- Add a second rich text input to post editor, and make that content available in post template
- How to use jQuery(…).material_chip inside WordPress?
- Custom Formdata matching with user table
- Back button not working after input / search submit
- getting the values of hidden inputs to use them in a php mysql query
- New term taxonomy and description in front page. Input’s
- Remove active cursor from form field
- If input field has value Require another field – PHP
- How to change number field to text field using JS
- Plugin option for input box validation
- Simple email input store in database
- Create input select image URL?
- add new input field like category?
- Notices when submitting custom post type from front-end
- How to save checkbox choice in wordpress
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- How to add input search field with roudned corners?
- wp_usermeta key problem