Jump to content




Exception - bios:206: [string "startup"]:4: '=' expected. Why?


2 replies to this topic

#1 Beatsleigher

  • Members
  • 37 posts
  • LocationGermany, Osnabrueck

Posted 02 April 2013 - 03:23 PM

Hey guys,

I asked this in a thread I posted earlier, but no answers to it, so I'm asking again, in the hope someone can help me :)

I get the following exception: bios:206: [string "startup"]:4: '=' expected .

My code is as follows:

write("Would you like to load the To-D- program?")
answer = read()
if answer=="Y" then
run monitor top ToDo
elseif answer=="N" then
clear()
print "Select a program you would like to load from the list below:"
print "1. ToDo (Top monitor)"
print "2. ToDo (This computer)"
print "3. Server Rules (Top MonitorĀ“)"
print "4. Server Rules (This Computer)"
print "5. List of Permitted Users (Top Monitor)"
print "6. List of Permitted Users (This computer)"
print "7. Load Time App (Top monitor)"
print "8. Load Time App (This Computer)"
write("Write in the number of the desired program below: ")
programs = read()
if programs=="1" then
run monitor top ToDo
if programs=="2" then
run ToDo
if programs=="3" then
run monitor top Rules
if programs=="4" then
run Rules
if programs=="5" then
run monitor top PermUsers
if programs=="6" then
run PermUsers
if programs=="7" then
run monitor top time
if programs=="1" then
run time

It's basic code (I'm a n00b when it comes to Lua and Java, I can only code in Batch and VB) so I don't understand what went wrong.

Any help is much appreciated!

Thanks, Beatsleigher.

#2 faubiguy

  • Members
  • 213 posts

Posted 02 April 2013 - 05:19 PM

if you want to run a program from inside of a program, you need to use shell.run, like
shell.run('program', 'argument1', 'argument2')

So replace every line like
run monitor top ToDo
with
shell.run('monitor', 'top', 'ToDo')

You also need to have an end statement for every if statement, to mark where the code in the if statement (that you only want to run if the condition is true) ends, like
if condition then
  -- Do stuff
end


#3 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 03 April 2013 - 03:57 PM

its also useful to use elseifs instead of repeating if statements
if var==1 then
  -- suff
elseif var==2 then
  -- moar stuff
end
you can add as many elseifs you want before ending





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users