Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

"unexpected symbol" fix?

Asked by 8 years ago

I recently got the errors

22:28:20.703 - Workspace.TrelloAPI:553: unexpected symbol near '='

and

22:28:20.790 - Requested module experienced an error while loading
22:28:20.791 - Script 'Players.Player.PlayerGui.Application.Frame.create.Script', Line 4
22:28:20.792 - Stack End

From the lines

552 - 560:

elseif #args==4 then
            local nam,des="",lid,url=args[1],args[2],args[3],args[4]
            dat={
            name=nam,
            desc=""..des,
            idList=lid,
            urlSource=url,
            due=nil
            }

and

4:

local ap = require(game.Workspace.TrelloAPI)
0
The second varaible on the definition line, des, is followed by [ ="" ] and then you attempt to continue to define more variables. (dismiss the square brackets, it is only to make the signs more clear) BlackJPI 2658 — 8y
0
So, remove the [""] and it should work? TheHospitalDev 1134 — 8y
0
And the equal sign, yes. Or atleast that is the source of the error you are encountering. BlackJPI 2658 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Eep, that's not how you do an assignment.

local nam,des="",lid,url=args[1],args[2],args[3],args[4]

Certainly not correct. If you wanted des to default back to "" if args[2] is nil, you could do an inline nil check with short circuit logic.

local nam,des,lid,url=args[1],args[2] or "",args[3],args[4]

More information:

Ad

Answer this question