Redefined with different type: g

Posted By: WaltT

Redefined with different type: g - 08/20/22 13:09

I'm new to Zorro, and I'm moving a script over from MQL4, and I've encountered this error: "Redefined with different type: g".

It refers to a line where I define an int:

int Slippage = 3;

I don't understand what the error is trying to tell me. It seems like it's saying that I've already defined Slippage earlier in the script, but I haven't. Would someone please clarify?
Posted By: AndrewAMD

Re: Redefined with different type: g - 08/20/22 14:51

Slippage is an already taken global variable. Use a different name.
https://zorro-project.com/manual/en/spread.htm
Posted By: WaltT

Re: Redefined with different type: g - 08/20/22 15:46

Ah, thanks! Is there a list of predefined global variables somewhere? I couldn't find such a list.
Posted By: AndrewAMD

Re: Redefined with different type: g - 08/20/22 18:04

Yes, they are all listed under the variables.h header under the include directory. Also, the manual.
Posted By: WaltT

Re: Redefined with different type: g - 08/20/22 18:39

Thank you! That list in variables.h is very helpful!
© 2023 lite-C Forums