I need some information
I need some information
31 Mar 2020, 17:47
Dear,
I am new coder in cAlgo, I am getting a problem. I can't pass var veriable type into function parameter.
I below code you will see i can't send 'pendingOrder' to another function as parameter. current code give this error "Error CS0825: The contextual keyword 'var' may only appear within a local variable declaration"
In below code how can i fix this problem, Please help anyone help me ....
foreach (var pendingOrder in PendingOrders)
{
if(pendingOrder.Id>0)
{
if (doMagic(pendingOrder) && pendingOrder.SymbolName == Symbol.Name)
{
}
}
}
bool doMagic(var order2)
{
if(UseNoMagicNumber) return(true);
if(order2.Label == Magic) return(true);
return(false);
}
Replies
PanagiotisCharalampous
02 Apr 2020, 08:32
Hi Capilta,
You cannot use var as a parameter type in a method variable declaration. The correct type is PendingOrder.
Best Regards,
Panagiotis
@PanagiotisCharalampous
Capilta
01 Apr 2020, 08:29
RE:
Capilta said:
Is anyone help me
@Capilta