Question
Strange Comparison Issue
Day 2 of testing CF 2021 and I'm puzzled by what seems to be another bug. Consider the following:
<CFSet A='147.xxx.yyy.zzz'>
<CFOutput>
#A#---<br>
Left 4: #Left(A,4)#---<br>
Left 4 eq: #iif(Left(A,4) eq '147.',DE('Yes'),DE('No'))#<br>
Left 4 is: #iif(Left(A,4) is '147.',DE('Yes'),DE('No'))#<br>
Left 4 equal: #iif(Left(A,4) equal '147.',DE('Yes'),DE('No'))#<br>
Left 4 CFIf eq: <CFIf Left(A,4) eq '147.'>Yes<CFElse>No</CFIf><br>
Mid dot: #iif(Mid(A,4,1) eq '.',DE('Yes'),DE('No'))#<br>
Left 3 Compare: #iif(Left(A,3) eq '147',DE('Yes'),DE('No'))#<br>
First Item in List: #iif(GetToken(A,1,'.') eq '147',DE('Yes'),DE('No'))#<br>
</CFOutput>
This outputs the following in CF 2021 (update 4):
147.xxx.yyy.zzz---
Left 4: 147.---
Left 4 eq: No
Left 4 is: No
Left 4 equal: No
Left 4 CFIf Compare: No
Mid dot: Yes
Left 3 Compare: Yes
First Item in List: Yes
But in CF 2016:
147.xxx.yyy.zzz---
Left 4: 147.---
Left 4 eq: Yes
Left 4 is: Yes
Left 4 equal: Yes
Left 4 CFIf eq: Yes
Mid dot: Yes
Left 3 Compare: Yes
First Item in List: Yes
Here's a CFFiddle of it .
Of course the solution is clear: just use GetToken and be done, but I don't want to have to review all the code before the upgrade to CF 2021.
Any thoughts?
