|
Josh McCormick
2020-09-21 17:37:01
0
|
|
Okay! Now I see where I need to go with this.
For something like Charts.GetAllCharts(), that's a function that I'd expect (hope) would eventually give a correct response (because if it doesn't, things are really screwed and nothing else it can do will matter). I'm going to solve that one with while loop (with a sleep), and retry until it works.
I'm thinking about the rest of my code and how I'd handle something more simple like a chart.SymbolName failing (like if a chart was removed *after* Charts.GetAllCharts or Charts.GetSelectedChart was called, but *before* chart.SymbolName is called). Since chart.SymbolName returns a string, I'm assuming it'll return a blank string when chart isn't null, but instead it points to an object that no longer exists?
If so, that'll really be situational and I'll have to look at how I'm processing those. From there, two more questions come to mind:
1. The pop-up boxes are still going to happen regardless of whether I check to see if these functions have failed or not, right?
2. If I'm caught somewhere mid-script in a nested look and I decide that my best choice is it to stop what I'm doing and to start the script again from scratch, what's going to be my best way of handling this? I'm thinking...
Global.ExecuteScript ("Scripts/scriptname.azf",true,null); <--- "null" will work if there are no variables?
return;
...or is there a better way for a script to restart itself from scratch? I don't like embedding the script's name and path into the script itself, but if that's my only option, I'll take it.
Thanks,
Josh McCormick
|
|