infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
Substitution in an 'if' statement in tcl
Keith McLeod
I have 2 expressions, one that works and one that doesn't. Any idea why the second test doesn't work? The Day variable represents Sun Mon Tue.... I loop through the hours for each day Sun(0) Sun(1)....Sat(23). The if statement determine the beginning or end of a gap.
This works:
if {[set ${Day}($i)] != 0 && [expr [set ${Day}([expr $i+1])] + [set ${Day}([expr $i+2])] + [set ${Day}([expr $i+3])]] == 0} {
This doesn't
if {$i > 2 && [set ${Day}($i)] != 0 && [expr [set ${Day}([expr $i-1])] + [set ${Day}([expr $i-2])] + [set ${Day}([expr $i-3])]] == 0} {
Find more posts tagged with
Clovertech
Comments
System
Originally posted by Anonymous
Keith,
The problem probably stems from the [$i > 2] part of the statement. Since this is regarded as an arithmetic expression, you may need to have it read as [expr $i > 2].
Hope this helps...
Thomas G. Rioux