If I recall correctly, it is possible to create a Method (or Function) with a variable number of parameters.

From memory:

Method Foo (X As Integer, Y As Integer)
Method Foo (X As Integer, Y As Integer, Width As Integer, Height As Integer)

What I forgot is how this works.

I think I have to place the code to deal with the first set of Parameters (X, Y) in another method and call it from both Methods, and add code to deal with (Width, Height) in the second Method.

My simple question is: is thats all ? (Xojo do the job by its own / silently ?)

Am I right ?

You can make a parameter optional by providing a default value

Method Foo (X As Integer, Y As Integer, Width As Integer = 400, Height As Integer = 200)

Is that what you were thinking of?

You could also make the default value -1, so you would know that it was called without those parameters.

But sometimes, separating it out into 2 methods works out best.

[quote=325601:@Emile Schwarz]Method Foo (X As Integer, Y As Integer)
Method Foo (X As Integer, Y As Integer, Width As Integer, Height As Integer)[/quote]