Complex Expression braces, whats going on inside?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ichiban
Newbie
Posts: 8
Joined: Thu Apr 10, 2008 2:57 am

Complex Expression braces, whats going on inside?

Post by ichiban » Tue May 06, 2008 11:34 pm

I need an explanation of how the complex expression braces behave. I'm trying to find an equivalent line using complex expression braces to the following line:

Let>started=%date%, %time%
...results in the watch as: STARTED=5/6/2008, 3:30:30

The following lines do not work:

Line A
Let>started={%date%, %time%}
...results in error: , not appropriate

Line B
Let>started={"%date%, %time%"}
...results in error: 5 not appropriate

Line C
Let>started={%date%", "%time%}
...results in the watch as: STARTED=5/6/2008", "3:30:30


After seeing the following behavior, I expected Line A to behave the same way:
Let>started=%date%", "%time%
...results in the watch as: STARTED=5/6/2008", "3:30:30 which appears to be identical to Line Cs result.

Thanks

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed May 07, 2008 2:15 am

Hi ichiban,
It's nice to see back in a calm manner.
Please try:

GetDate>Date
GetTime>Time
Let>Started={(%Date% + " " + %Time%)}

Hope it helps. Have a nice day.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed May 07, 2008 2:22 am

Hi ichiban,
Please kindly resond your post http://www.mjtnet.com/forum/viewtopic.p ... highlight=
The author/developer and users alike are eager to assist your technical issue, though not necessarily with an express guarantee of success. But you're rest assured we'll try very hard to help you.
Thanks for your kind understanding.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed May 07, 2008 3:57 am

Welcome back ichibon.

Generally, the braces "{....}" are used with complex IF expressions. They can be used in other situations, but I think that usage with IF is probably most common. They do work as you would think to group expressions and prioritize the sequence of calculatons.

Another variation of armsys' solution is this:

Code: Select all

GetDate>Date
GetTime>Time
Let>Started=%Date%, %Time%
MessageModal>The value of started is %Started%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts