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

Help

Started by Leon669, 21 February 2015 - 06:27 PM
Leon669 #1
Posted 21 February 2015 - 07:27 PM
term.setCursorPos(1,7)
write("Enter name of the Background you want to create:")

name = io.read()

shell.run"paint (name)"

how can I say the programm to open a new paint file with the previously surrounded name?
MKlegoman357 #2
Posted 21 February 2015 - 07:41 PM
Use a string concat operator ( .. ):


local name = "John"
local surname = "Smith"

local fullName = name .. " " .. surname

print( fullName ) --> John Smith
Dragon53535 #3
Posted 22 February 2015 - 01:31 AM
To translate that for your program. You'd want

shell.run("paint "..name) --#You need the space after paint
Edited on 22 February 2015 - 12:32 AM
HPWebcamAble #4
Posted 22 February 2015 - 01:34 AM
To translate that for your program. You'd want

shell.run("paint "..name) --#You need the space after paint

Or pass each as a separate argument:

shell.run("paint",name)
Leon669 #5
Posted 23 February 2015 - 04:41 PM
Have found the answer alone. But thanks :D/>