love.filesystem.load(file)(arguments)?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
furi
Citizen
Posts: 73
Joined: Sat Feb 26, 2011 8:15 pm

love.filesystem.load(file)(arguments)?

Post by furi »

Pretty much the topic title. Is it possible to use arguments with a loaded lua file this way?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: love.filesystem.load(file)(arguments)?

Post by Robin »

Have you tried it yourself?

I'm sorry I'm not answering your question (although my guess would be that the answer is "yes"), but for things like that, it's easier to just try it out yourself.
Help us help you: attach a .love.
User avatar
furi
Citizen
Posts: 73
Joined: Sat Feb 26, 2011 8:15 pm

Re: love.filesystem.load(file)(arguments)?

Post by furi »

Robin wrote:Have you tried it yourself?

I'm sorry I'm not answering your question (although my guess would be that the answer is "yes"), but for things like that, it's easier to just try it out yourself.
I have, but what will the arguments be named within the .lua file? I can't define them myself.
User avatar
teomat
Prole
Posts: 5
Joined: Thu Mar 08, 2012 3:31 pm
Location: Italy

Re: love.filesystem.load(file)(arguments)?

Post by teomat »

They are passed in the vararg parameter '...'

Edit: To clarify, you can either push them into a table like

Code: Select all

local args = {...}
and iterate over them
or extract them to local variables like

Code: Select all

local param1, param2 = ...
User avatar
furi
Citizen
Posts: 73
Joined: Sat Feb 26, 2011 8:15 pm

Re: love.filesystem.load(file)(arguments)?

Post by furi »

teomat wrote:They are passed in the vararg parameter '...'

Edit: To clarify, you can either push them into a table like

Code: Select all

local args = {...}
and iterate over them
or extract them to local variables like

Code: Select all

local param1, param2 = ...
Thanks!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests