Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Q) Functions that accept different argument types.
#1
This is just hypothetical:

Is it posible, if so how?, to create multiple functions with same name that accept different argument types?
In C++ its called overloading i think :wink:

Maybe in QM its possible using a different approach?

Example what i mean:
functionA( int, [int] )
functionA( str, [int] )


I thought about this myself that maybe this way would work in QM?
function int'a|str'b [int'c]
or maybe: function [[int'a] | [str'b]] [int'c]?

Just wondering how much you can do in QM language as usual hehehe.... :lol:
Ofcourse when this is not possible a workaround is to create 3 functions where first 2 are wrappers to call the 3rd final function....
Well thats all for now, 3M
#2
QM does not support overloaded functions. You can use VARIANT. Search System for examples. Also, if an argument is str, you can also pass a number.
#3
ok thanks :wink:
Well thats all for now, 3M


Forum Jump:


Users browsing this thread: 1 Guest(s)