This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
jtdavis99's profile picture

io.read() ?

Started by jtdavis99, 04 March 2012 - 01:27 AM
jtdavis99 #1
Posted 04 March 2012 - 02:27 AM
I know that in order to receive an input, it has to be input = read() or Input = read(), I think o.O. However, I recently saw a piece of code that used y = io.read(). I'm assuming this is the same thing as an input, but it labels that input as y or whatever the variable is?
FuzzyPurp #2
Posted 04 March 2012 - 02:29 AM
just changes that function to a variable :unsure:/>/> which in that case was y
jtdavis99 #3
Posted 04 March 2012 - 02:31 AM
just changes that function to a variable :unsure:/>/> which in that case was y
Ah, okay. Thanks!
Espen #4
Posted 04 March 2012 - 02:54 AM
Also, since you talked about read() and io.read():
The former is a customized version of io.read(), created with / made for ComputerCraft (see "bios.lua" in .minecraftmodsComputerCraftlua) and makes it possible to have an input history and/or define a replacement character.
If e.g. you'd use this…
local myInput = read( "*" )
… then it will display every entered character as an asterisk, effectively masking what you type.
jtdavis99 #5
Posted 04 March 2012 - 10:48 PM
If e.g. you'd use this…
local myInput = read( "*" )
… then it will display every entered character as an asterisk, effectively masking what you type.

Right, right. I was just wondering if io.read() is the only read() function that can label an input a variable.