 |
 |
|
|
Philips Pronto Professional Forum - View Post
|
|
 |
|
10/10/25 - It’s been so long since we’ve last seen you!
10/24/22 - In searching for the perfect day, Timmy discovers something unexpected!
9/04/22 - That childhood favorite is back in a new Timmy video.
7/31/22 - It’s time for my second new Just Like Timmy video!
7/12/22 - Why not check out my new YouTube animation channel, Just Like Timmy!
|
|
 |
|
The following page was printed from RemoteCentral.com:
| Topic: | Simple alarm clock This thread has 6 replies. Displaying all posts. |
|
| Post 1 made on March 11, 2024 at 02:54 |
|
Joined: Posts: RC XP: | June 2020 156 45⭐︎ |
|
|
This does not see to work for me, var alarm = System.getGlobal("alarm_set.Initialised"); var time = GUI.getDisplayTime(); CF.widget("time").label = time; CF.widget("time_alarm").label = alarm; if (alarm == time) { CF.widget("alarm_set").label = "exicute"; }else{} got it working, needed to use ===
Last edited by mpg7321 on March 12, 2024 16:59.
|
|
| Post 2 made on March 20, 2024 at 18:02 |
|
Joined: Posts: RC XP: | August 2001 13,103 300⭐︎ |
|
|
Your statement that you had to use === makes no sense. Something else in your code must be wrong. System.getGlobal 'Purpose' from DEV Guide Retrieve a string value stored in the global variables list. Return String The value of the global variable, or null if the name is not found. In your case, either the value returned was null or maybe had some extra characters on it. null == 'hello' => false null === 'hello' => false The double equal does type coercion and null and a string are not the same. Sounds like the first time you did this, maybe the global was not set prior to your executing the script but sometime after, it was.
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
| OP | Post 3 made on March 20, 2024 at 19:58 |
|
Joined: Posts: RC XP: | June 2020 156 45⭐︎ |
|
|
But the alarm clock only works with ===, I have been using it for over a week and works every time, never locks up the remote and or mis launches. That is the entire script the repeats every 50 seconds when that page is displayed. I will go back and try it with == and see if it works now, maybe I made changes after the fact and never changed it back, either way it works.
Last edited by mpg7321 on March 20, 2024 20:14.
|
|
| Post 4 made on March 22, 2024 at 08:04 |
|
Joined: Posts: RC XP: | August 2001 13,103 300⭐︎ |
|
|
All I was saying is that === vs == was not the real fix in case someone reads your first response. If you prefer, I can delete the whole thread. Lyndel
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
| OP | Post 5 made on March 22, 2024 at 12:21 |
|
Joined: Posts: RC XP: | June 2020 156 45⭐︎ |
|
|
On March 22, 2024 at 09:04, Lyndel McGee said...
All I was saying is that === vs == was not the real fix in case someone reads your first response. If you prefer, I can delete the whole thread. Lyndel I'm sure your right, I shouldn't be doing this at 2am anymore. LOL I did change it back to == and it works, like you said I must have changed something else. I also just realized that the Variable "alarm_set.Initialised" is Null when the page first loads, and stays Null till I interact with the page, so not sure if === vs == would make a difference there. Eiter way I fixed the Null factor, changed it to == and all is working. Thanks for all your help you always know best. Mike
|
|
| Post 6 made on March 22, 2024 at 20:03 |
|
Joined: Posts: RC XP: | August 2001 13,103 300⭐︎ |
|
|
On March 20, 2024 at 19:02, Lyndel McGee said...
null == 'hello' => false null === 'hello' => false The double equal does type coercion and null and a string are not the same. The === means that the left and right hand sides must be the same value AND the same type.
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
| Post 7 made on March 22, 2024 at 20:08 |
|
Joined: Posts: RC XP: | August 2001 13,103 300⭐︎ |
|
|
On March 22, 2024 at 13:21, mpg7321 said...
Thanks for all your help you always know best. Mike Not Always!!!!! Just ask my wife!
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
 |
Before you can reply to a message... |
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now. |
Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.
|
|
|
|
|