Initializing function parameters
It's because when u give default values for passed parameters there cannot be gaps from the right. So for example u need to have:
void CreateVlineObject(int Window_,datetime time1, color linecolor,int linewidth,int linestyle, string LabelPrefix="", string sObjectName="", bool ray=false,bool background=false)
Instead of:
void CreateVlineObject(int Window_,string LabelPrefix="",string sObjectName="",datetime time1, color linecolor,int linewidth,int linestyle, bool ray=false,bool background=false)So that all params with default values are rightmost... Hope my explanation is clear.
I am writing some utility functions that I can add to any experts/indicators I create via an include file. For example:
Why is it the compiler demands that I initialize all the parameters in the first function (I haven't yet), but doesn't mind in the second?