Post 9 made on Thursday July 29, 2010 at 10:43 |
Guy Palmer Active Member |
Joined: Posts: | June 2008 648 |
|
|
Miwi,
Yes, the basic logic and syntax of your script is right.
A few minor comments about good practice:
1. If statements based on hardcoded positions are a bit error prone. Rather, I would search for ":" and then substring up to there. So, for example:
EndPos = myTime.indexOf(":") myHour=myTime.substring(0,EndPos);
2. myHour=myHour-0 is apparently a more efficient way of turning a string into a number than myHour=1*myHour.
Finally, to debug: by using the System.print() command in your script, you can run the script in the simulator and see the values that your variables are taking.
|
|
|