The issue you're encountering, where the Command parameter seems to be set to 0 instead of the passed value when training a script, might be related to the way command-line parameters are handled in Zorro, especially in different modes (like training versus running).
In Zorro, command-line parameters are accessible through the Command array in the script. However, there are some nuances to be aware of:
Initialization Timing: The command-line parameters are usually parsed and initialized before the run function is executed. However, if you're observing that the parameters are not correctly initialized during training, it could be a timing or initialization issue specific to the training mode.
Correct Parameter Index: Ensure that you're using the correct index for accessing the command-line parameters. Command is the first command-line parameter, Command is the second, and so on.
Parameter Parsing: Check if the command-line parameter is correctly parsed and converted to the desired data type. For instance, if you're passing a date like 20230930, you might need to convert it from a string to an integer or a specific date format that Zorro understands.
Batch File Syntax: Ensure the batch file is correctly formatted and passing the parameters as intended. The command should look something like this:
Zorro.exe -run MyScript -i 20230930
Zorro Version: You mentioned using Zorro version 2.56 with an S License. It's worth checking the release notes or updates for your version to see if there are any known bugs or changes regarding command-line parameter handling.
Debugging: Use print statements to debug the script. Print out the value of Command at different points in your script to check when it gets initialized and what value it holds.
Alternative Approach: As a workaround, you could try using a different method to pass the end date. For example, you could read the end date from a file at the start of your script if the direct command-line approach continues to pose issues.