Jump to content




'Then' Expected


  • You cannot reply to this topic
3 replies to this topic

#1 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 23 January 2013 - 06:39 AM

It keeps crying that in line 35 a 'then' is missing.
print ("Welcome to SVOS!")
print ("Please select a language!")
print ("Available: German/Deutsch; English")
lang = read()
if lang == "German" or "Deutsch" then
  print ("Waehlen sie einen Benutzernamen:")
  name = read()
  print ("Ihr Name ist "..name.."!")
  print ("Bitte waehlen sie ein Passwort:")
  passwort = read("*")
  print ("Ihr Passwort wurde gespeichert. Passwort anzeigen?")
  pa = read()
  if pa == ("ja") then
	print ("Ihr passwort lautet: " ..passwort)
  end
  print ("Wollen sie nun speichern?")
  save = read()
  if save == ("ja") then
	print ("Speichern...")
	f = io.open("startup","w")
	f:write("os.pullEvent = os.pullEventRaw\r\n")
	f:write("print(\"Willkommen "..name.."!\")\r\n")
	f:write("print(\"Bitte Passwort eingeben:\")\r\n")
	f:write("passwort = read(\"*\")\r\n")
	f:write("if passwort == (\""..passwort.."\") then \r\n")
	f:write("  print(\"Passwort richtig!\")\r\n")
	--f:write("  shell.run(\"programs\")\r\n")
	f:write("else os.reboot()\r\n")
	f:write("end\r\n")
	f:write("shell.run(\"desktop\")\r\n")
	f:close()
  else
	print ("Fehlgeschlagen..")
  end
elseif lang == "English" then -- [size=6][color=#FF0000][b]Line 35[/b][/color][/size]
  print ("Please choose a username:")
  name = read()
  print ("Your name is "..name.."!")
  print ("Please select a password:")
  passwort = read("*")
  print ("Your password is saved. Do you want to see the password?")
  pa = read()
  if pa == ("yes") then
	print ("Your password: " ..passwort)
  end
  print ("Do you want to save now?")
  save = read()
  if save == ("yes") then
	print ("Saving...")
	f = io.open("startup","w")
	f:write("os.pullEvent = os.pullEventRaw\r\n")
	f:write("print(\"Welcome "..name.."!\")\r\n")
	f:write("print(\"Please enter your password:\")\r\n")
	f:write("passwort = read(\"*\")\r\n")
	f:write("if passwort == (\""..passwort.."\") then \r\n")
	f:write("  print(\"Correct password!\")\r\n")
	--f:write("  shell.run(\"programs\")\r\n")
	f:write("else os.reboot()\r\n")
	f:write("end\r\n")
	f:write("shell.run(\"desktop\")\r\n")
	f:close()
  else
	print ("Failure...")
  end
end

I tried a lot and asked even a friend to help, but nothing worked...
I think there is an "end" missing somewhere, but I already looked a lot and nothing

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 23 January 2013 - 07:24 AM

if lang == "German" or "Deutsch" then
should be
if lang == "German" or lang == "Deutsch" then

That didn't give me an error though.

#3 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 23 January 2013 - 07:46 AM

View PostremiX, on 23 January 2013 - 07:24 AM, said:

if lang == "German" or "Deutsch" then
should be
if lang == "German" or lang == "Deutsch" then

That didn't give me an error though.

~_~ Thanks works now for me, too

#4 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 23 January 2013 - 07:46 AM

I'm not getting any errors when I run the program...but if I type in "English", the German menu still comes up.



Edit* Nevermind, changing the code as remiX said fixed that





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users