Need help with the function error

Post Reply
Dragos
Posts: 1
Joined: Tue Feb 10, 2015 9:16 pm

Need help with the function error

Post by Dragos »

Getting the following error Lua syntax error:[string "library = library or {}..."]6: unfinished string near '")'

Here is the fuction. It's the Echolink line. Any hlp would be appreciated.

function library.bookSearch(criteria)

for t,n in ipairs(library.list) do
if string.findPattern(library.list[t].title, criteria) then
cecho("\nCriteria matched. Book Number is ")
echoLink(library.list[t].number, [[send("read " .. ]] .. library.list[t].number .. [[, false)]], "Read "..library.list[t].title.")
end
end
end

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Need help with the function error

Post by Vadi »

Where's line 6 in this?

hogarius
Posts: 35
Joined: Mon Nov 21, 2011 8:35 pm

Re: Need help with the function error

Post by hogarius »

The echoLink line has an odd number of quote marks.

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: Need help with the function error

Post by Belgarath »

You had a misplaced period. Here:
Code: [show] | [select all] lua
function library.bookSearch(criteria)
  for t,n in ipairs(library.list) do
    if string.findPattern(library.list[t].title, criteria) then
      cecho("\nCriteria matched. Book Number is ")
      echoLink(library.list[t].number, [[send("read " .. ]] .. library.list[t].number .. [[, false)]], "Read "..library.list[t].title)
    end
  end
end

Post Reply