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

bios:337: [string "Bilanz"]:32: ')' expected (to close '(' at line 31)

Started by Manello, 06 July 2013 - 01:47 AM
Manello #1
Posted 06 July 2013 - 03:47 AM
I cant make a new Topic, so i write here.
Here is the Error:

bios:337: [string "Bilanz"]:32: ')' expected (to close '(' at line 31)

Here is the Code Line 31 to 34

local options=(
"Finanzliste aufrufen",
"Neuer Finanzeintrag"
)

I dont know what to do now.
Cranium #2
Posted 06 July 2013 - 11:03 AM
Split into new topic.

For future reference, do not hijack another users topic. There is a place you can post new topics to if you cannot post one yourself.
Kingdaro #3
Posted 06 July 2013 - 11:04 AM
Should be:

local options={
"Finanzliste aufrufen",
"Neuer Finanzeintrag"
}
theoriginalbit #4
Posted 06 July 2013 - 11:36 AM
And to the point of what Cranium stated, the topic you were meant to post it in was literally (at the time) 4 topics above the one you posted in, and 6 above it was the forum guidelines that told you where to post.

Also the one you ended up posting in, the reply directly above your code was one I had just done which had an example of creating tables, so if you read that you would have seen your problem immediately.
Manello #5
Posted 07 July 2013 - 12:07 PM
Ok sorry.
I have a new Problem now= attempt to call nil.

Code - piece=

local n = menue(options) <<<There is the error
print(n)

I have the nil, but he cant find it???
theoriginalbit #6
Posted 07 July 2013 - 12:08 PM
look at the line above it, you're missing a () or something in a function call.
Manello #7
Posted 07 July 2013 - 12:21 PM

function mgui(m)
n=1
l=#m
while true
do
term.clear()
term.setCursorPos(1,1)
print("------------Finanzen Manager------------")
print(" ")
term.setCursorPos(1,3)
for i=1, l, 1 do
if i==n then print(i, " ["..m[i].."]") else print(i, " ", m[i]) end
end
print("")
a, b= os.pullEvent()
  if a =="key" then
    if b==200 and n>1 then n=n-1 end
    if b==208 and n<=l then n=n+1 end
    if b==28 then break end
end
end
term.clear() term.setCursorPos(1,1)
return n
end
local options={
"Finanzliste aufrufen",
"Neuer Finanzeintrag"
}
local n=menue(options)
print(n)
if n == 1 then
term.clear()
term.setCursorPos(1,1)
  print("------------Finanzen Manager------------")
  print(" ")
  print("Produkt	 Wert	 Stückzahl	 Kunde")
  print("########################################")

elseif n == 2 then
term.clear()
term.setCursorPos(1,1)
  print("------------Finanzen Manager------------")
  print("")
  print("Gebe das Produkt an.")
p = read()
  print("Gebe den Wert des Produktes an.")
w = read()
  print("Gebe die gekaufte Stueckzahl an.")
s = read()
  print("Gebe an welcher Kunde etwas gekauft hat.")
k = read()  
	   
end
That is the complete Code, i know that it is at 2 Locations not complete, but normaly the Program has to do it till the menue is on the Display. The error is in line 35, but there is nothing missing.
verdult #8
Posted 09 July 2013 - 04:09 AM
You're trying to call a function called menue with the variable option. i didn't see that function in your code