Default arguments?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Default arguments?

Post by Foxley »

In hspeak.exe I'm getting "script mouseclicked has no default for missing argument 1" from a line that's checking an if statement. Does this mean that you can in fact make default script arguments, and if so, how do you do that?
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Code: Select all

script, myscript, arg1, arg2 = 123, begin
  # arg1 is required, but arg2 has a default value
end
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Mogri wrote:

Code: Select all

script, myscript, arg1, arg2 = 123, begin
  # arg1 is required, but arg2 has a default value
end
THAT'S what the = means in all those scripts I've read through! I feel so enlightened.
My pronouns are they/them
Ps. I love my wife
Post Reply