Lua error like "expected near ..."

Hi everyone. I recently started learning to write scripts and immediately face with the following error: expected near ‘=’

There is part of a code:

AvengerFrame.texture:SetTexture(1,1,0);
AvengerFrame.texture:SetAlpha(50)
AvengerFrame.texture:SetBackdrop(StaticPopup1:GetBackdrop (bgfile=“interface/AddOns/Avenger/forsaken.tga”))

The error is in the third line. May be anyone knows what’s the deal?

This does not look like Corona SDK code.  Are you using some form of library?  Can you post the whole error (copy/paste the text please)?

Rob

So I googled SetTexture, SetAlpha and SetBackdrop, and ended up on an interesting journey. Apparently, addons for World of Warcraft are written in Lua. That’s pretty cool. I didn’t know that. The OP’s snippet seems to be from a WoW addon.

@smallgrown, these forums are about a mobile game development tool called Corona SDK, and not about the Lua language in general. You can of course ask Lua questions, but it’s unlikely that anyone here can help you with a WoW addon, if that’s what your code is related to.

This

(bgfile="interface/AddOns/Avenger/forsaken.tga")

is not valid Lua. (If you’re curious, it tries to put a statement, in this case assignment, when only an expression is legal.)

However,

{bgfile="interface/AddOns/Avenger/forsaken.tga"}

IS valid, and fits the context (make a table, pass it as the sole argument).

EDIT : They don’t stand out, but they’re curly braces, not parentheses, here.

This does not look like Corona SDK code.  Are you using some form of library?  Can you post the whole error (copy/paste the text please)?

Rob

So I googled SetTexture, SetAlpha and SetBackdrop, and ended up on an interesting journey. Apparently, addons for World of Warcraft are written in Lua. That’s pretty cool. I didn’t know that. The OP’s snippet seems to be from a WoW addon.

@smallgrown, these forums are about a mobile game development tool called Corona SDK, and not about the Lua language in general. You can of course ask Lua questions, but it’s unlikely that anyone here can help you with a WoW addon, if that’s what your code is related to.

This

(bgfile="interface/AddOns/Avenger/forsaken.tga")

is not valid Lua. (If you’re curious, it tries to put a statement, in this case assignment, when only an expression is legal.)

However,

{bgfile="interface/AddOns/Avenger/forsaken.tga"}

IS valid, and fits the context (make a table, pass it as the sole argument).

EDIT : They don’t stand out, but they’re curly braces, not parentheses, here.