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

'then' expected

Started by AbCraft. NET Studios, 20 December 2013 - 07:50 PM
AbCraft. NET Studios #1
Posted 20 December 2013 - 08:50 PM
I have this simple installation code but it just dosen't work I have it on Pastebin.

http://pastebin.com/WYyPW4FP

Just in case, I will place the code below here:

——————————————————————————
print 'BOOT INSTALLER VERSION 0.0.1 Alpha'
print ' '
print 'Trademark AbCraft. NET Studios 2013'
print ' '
print 'Please choose a software version you would like to install.'
print ' '
print '1: V0.1 Alpha'
local input = read()
if input = '1' then
local PasteBinCode = 'FEdJpcsu'
end
print 'INSTALLING SOFTWARE'
shell.run('pastebin','get',PasteBinCode,'startup')
print ''
print 'Installation complete. If there are any errors, please make sure enableAPI_http = 1 or true.'
reboot

——————————————————————————

It gives me an error. This error is:

bios:337: [string "install"]:9: 'then' expected

I have changed the color of the error into red.
Lyqyd #2
Posted 20 December 2013 - 09:31 PM
Check out the Common Errors section of the Read This Post Before Asking Questions sticky, this exact issue is covered there.
Zudo #3
Posted 21 December 2013 - 07:27 AM
= should be ==
TheOddByte #4
Posted 21 December 2013 - 08:59 AM
It should be

if input == '1' then

Tip: Put your code in code tags [-CODE] Code here [-/CODE] ( Without '-' )
Alice #5
Posted 22 December 2013 - 07:49 PM
^And spoilers. [-spoiler]
Spoiler
This will nicely hide the code if the program is a long wall of text.