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

")" expected :2:

Started by ETHANATOR360, 16 September 2012 - 10:27 PM
ETHANATOR360 #1
Posted 17 September 2012 - 12:27 AM
-snip-
Grim Reaper #2
Posted 17 September 2012 - 12:46 AM
When you write a line using a quote, the interpreter will automatically look for the next quote to end the string, and anything in between those two quotes is textual data. To prevent this, you'll need to use different means of writing quotes within quotes.

You could try '' or [[ ]] to achieve what you're looking to do.

Here is a solution using '':

startup.writeLine ('shell.run("virus")')

Here is a solution using [[ ]]:

startup.writeLine ([[shell.run("virus")]])

Hope I helped! :)/>/>
MysticT #3
Posted 17 September 2012 - 12:47 AM
You have to escape quotes inside a string (or use single quotes, or multiline strings), otherwise it will think the string ends.

startup.writeLine("shell.run("virus")")
-- or
startup.writeLine("shell.run('virus')")
-- or
startup.writeLine([[shell.run("virus")]])
cant_delete_account #4
Posted 17 September 2012 - 03:15 AM
You have to escape quotes inside a string (or use single quotes, or multiline strings), otherwise it will think the string ends.

startup.writeLine("shell.run("virus")")
-- or
startup.writeLine("shell.run('virus')")
-- or
startup.writeLine([[shell.run("virus")]])
Or:
startup.writeLine('shell.run("virus")')
:)/>/>
FuzzyPurp #5
Posted 17 September 2012 - 04:02 AM
Please do not post malicious code on the forums.
You've been here long enough to follow forum rules and guidelines.
Thread Locked.