How to pass Optional argument for User Define Function

Is it possible to create a user define function with optional argument in AFL?

function Test (Var1,Var2,Var3,Var4,Var5)
 Var5 = 0;
 xyz = Var1+Var2+Var3;
 return xyz;
 Test(1,2,3,4,5);  //Default and using
 //Can this be Done ?

If yes then can you show me any example ?

function test(num_list) {
	mx = MxFromString("{{"+num_list+"}}");
	return MxSum(mx);

printf("%g\n", test("1,2,3,4,5") );
printf("%g\n", test("1,2,3,4") );
printf("%g\n", test("1,2,3") );

@fxshrat provided workaround, but generally optional arguments are supported only for internal functions and user-definable functions exposed by plugins (DLLs).

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.