regarding the subject, if I had the list of items below I could have saved myself a whole day working almost none stop trying to find a bug in one of my very complex 1 second bar chart scripts I had created from the exact same script running in the other charts I used (1 week, 1 day, 30 minute, 15 minute, 5 minute, 1 minute). There have been other times this list could have saved annoyance and debugging work as well.
I think this covers it. If you have any other items please let us know.Change LastBarOnChart to LastBarOnChart_s.
Change DateTime2ELTime(MouseClickDateTime) to DateTime2ELTime_s(MouseClickDateTime). Note: DateTime2ELTime is in the Help but DateTime2ELTime_s is not.
Change the built in function "TimeToMinutes" to "TimeToSeconds".
Change the built in function "MinutesToTime" to "SecondsToTime_s". Note: There is a built in function called "SecondsToTime" but it will truncate the seconds so do not use it.
Change time to time_s
Note:
If all the variables that get the value of Time_s are named such that they end with the word Time (example FutureTime) then change these to end with Time_s (example FutureTime_s). The reasons to do this is because it makes it easier to get all the associated commands mentioned below changed for both Time_s and FutureTime_s. Specifically you do one string search at the end for Time_s and you will find all the associated commands mentioned below.
Where ever the time command needs to be replace with the time_s command the associated command (Text_New, TL_new, etc) needs to be replaced with the _s version as well.
Where ever the value of time_s was moved to a work field you also need to change the associated commands (Text_New, TL_new, etc).
Regards,
John