Crash with function hour() in Zorro 1.66.5

Posted By: fran

Crash with function hour() in Zorro 1.66.5 - 11/10/17 21:22

Hi,
The next line of code makes Zorro crash:
printf("Hour=%d",hour());

I get the next error:
"Error 111: Crash in script: run()"

Is this a bug right?
Posted By: jcl

Re: Crash with function hour() in Zorro 1.66.5 - 11/11/17 12:07

I see no bug in that line. Correct C syntax, although I would add a line feed. So the crash happens elsewhere.
Posted By: fran

Re: Crash with function hour() in Zorro 1.66.5 - 11/11/17 22:16

The bug is not in the code, the bug is in the hour() function. If I comment the line or change hour() by second() it works, so I assume the problem is the hour() function. Maybe it depends on the MT version I have, I do not know.
Posted By: jcl

Re: Crash with function hour() in Zorro 1.66.5 - 11/12/17 09:23

Bugs are not as simple as that. You must really look for and fix them. That it immediately crashes when you print the hour will help finding it, but a bug in the hour function is not really likely. And it's not your MT version either.

First find out which line crashes, by the method with _POS described in the manual. If it is really the printf line, outcomment systematically code parts until it does not crash anymore. If only the printf remains and still crashes, last hiding place of the bug is your price data - maybe it contains nonsense instead of valid time stamps.

Back to work!
Posted By: pascalx

Re: Crash with function hour() in Zorro 1.66.5 - 11/12/17 12:46

There is a simple way to verify the suspected cause:
Create a new script and only put the printf("Hour=%d",hour()); in there and see if it crashes.
Posted By: Spirit

Re: Crash with function hour() in Zorro 1.66.5 - 11/12/17 13:33

If you have a crash that no one else has, maybe its a damaged file? If all else fails, try installing it again.
Posted By: johnnyp

Re: Crash with function hour() in Zorro 1.66.5 - 11/13/17 09:58

If your script is HUGE (like some of mine for exporting data to csv) then that alone can cause an Error 111.
Posted By: fran

Re: Crash with function hour() in Zorro 1.66.5 - 11/13/17 19:28

I do not get the crash know, I think this was because of the data price as jcl said. Thanks for your help.
© 2024 lite-C Forums