The !Rainmeter... bang prefix is deprecated, you should not use it.
Also, seem a good practice to get used to add brackets around the bangs, even if you're using just one bang. Although this is not absolutely necessary, could avoid a lot of headaches in the future.
balala wrote:Glad to help.
But I have to make two remarks:
The !Rainmeter... bang prefix is deprecated, you should not use it.
Also, seem a good practice to get used to add brackets around the bangs, even if you're using just one bang. Although this is not absolutely necessary, could avoid a lot of headaches in the future.
Thanks. I still learn syntax!
!Rainmeter - I remember that.
Without brackets conditions not working correctly. i already fix that.
Craft wrote:Without brackets conditions not working correctly. i already fix that.
I'm surprised, because it should. Eg the following two IfTrueActions should work the same way: IfTrueAction=!RainmeterSetVariable TextSwitch "Work Time" IfTrueAction=[!SetVariable TextSwitch "Work Time"]
(copied from the [TimeRemaining] measure)
Here I also removed the !Rainmeter... prefix of the !RainmeterSetVariable bang.
Using those brackets in such cases is optional. But if you have two or more bangs in the same option, the brackets become obligatory, you can't left them out.
IfCondition=(TimeToDigits > TimeToDigitsStart) && (TimeToDigits < TimeToDigitsEnd)
This requires (parentheses) around the left and right comparisons when using AND with && in a formula.
IfTrueAction=[!SetVariable TextSwitch "Work Time"]
This specific example does not "require" [Brackets] around the bang in an action, but it is a good practice to always just do so. If you ever want more than one bang, they are required, and if you want to execute a command, not a bang, like ["http://cnn.com"] or ["C:\Program Files\MyApp.exe"] they are required. It's easier to just always use them on bangs.
(Parentheses)
[Brackets or Square Brackets]
{Braces or Curly Braces}
jsmorley wrote:I think we are confusing two things here.
IfCondition=(TimeToDigits > TimeToDigitsStart) && (TimeToDigits < TimeToDigitsEnd)
This requires (parentheses) around the left and right comparisons when using AND with && in a formula.
IfTrueAction=[!SetVariable TextSwitch "Work Time"]
This specific example does not "require" [Brackets] around the bang in an action, but it is a good practice to always just do so. If you ever want more than one bang, they are required, and if you want to execute a command, not a bang, like ["http://cnn.com"] or ["C:\Program Files\MyApp.exe"] they are required. It's easier to just always use them on bangs.
(Parentheses)
[Brackets or Square Brackets]
{Braces or Curly Braces}
IfCondition=(TimeToDigits > TimeToDigitsStart) && (TimeToDigits < TimeToDigitsEnd)
This requires (parentheses) around the left and right comparisons when using AND with && in a formula.
Other code work fine.
No errors or something like that.