Posted By: EvilSOB
Possibly Noob help needed on Overload Functions - 07/16/08 11:32
Hi all, can someone please point out what Im doing wrong here.
Ive read overloaded functions work fine, and I think Ive got
it right according to the manual, so what am I doing wrong?
If I use ANY but the first declared function, I get error
at compile time.
PS Ive tried with functions as VOID and FUNCTION and INT.
Thanks in advance
Ive read overloaded functions work fine, and I think Ive got
it right according to the manual, so what am I doing wrong?
If I use ANY but the first declared function, I get error
Quote:
'PopupMenu'. Wrong number/type of parameters
at compile time.
Code:
//Declares/Prototypes void PopupMenu(PANEL* *ReturnPanel, STRING* SourceData, var layer); //Want to keep this "default" if I can void PopupMenu(PANEL* *ReturnPanel, STRING* SourceData, var layer, var pos_x, var pos_y); void PopupMenu(PANEL* *ReturnPanel, STRING* SourceData, var layer, var pos_x, var pos_y, STRING* font); //Usage (FAILS unless I kill the first two prototypes and stick with the third) PANEL* tmpPanel; ... PopupMenu(tmpPanel,"Dummy_string_to_test_funtion",100,10,15,"Times New Roman#24b"); ... //Actual Functions void PopupMenu(PANEL* *ReturnPanel, STRING* SourceData, var layer) { PopupMenu(ReturnPanel, SourceData, layer, 0, 0, ,"Times New Roman#12b"); } // void PopupMenu(PANEL* *ReturnPanel, STRING* SourceData, var layer, var pos_x, var pos_y) { PopupMenu(ReturnPanel, SourceData, layer, pos_x, pos_y, ,"Times New Roman#12b"); } //// void PopupMenu(PANEL* *ReturnPanel, STRING* SourceData, var layer, var pos_x, var pos_y, STRING* font) { ...performed code (eventually) by all overloads... }
PS Ive tried with functions as VOID and FUNCTION and INT.
Thanks in advance