Hello,
Just curious if there's any drawbacks/issues with using #break in a script? For reference here is my script use case:
#foreach ($item in $customerProfilesList )
#if ( ( $item.age <=15 && $item.age >=13 ) && ( $item.membershipStatus.equals("Member") ) && ($item.financialEducationSOAREXPLORERGraduate.equals("0")) )
$item.fullName##
#break
#else
Wings Member##
#break
#end
#end
Basically I am looking to pull one name value (even if multiple records exist) since it's going within the same household and also to only pull one instance of the default if needed. Just curious if this has any potential ramifications? Testing-wise it seems to work correctly.
Solved! Go to Solution.
AFAIK if the break statement meets your needs, I think you should be good with using it. However, IMO you might not want to overuse breaks in your code because they introduce more exit points. We generally want to keep exit points to a minimum since multiple exit points complicate logic and make it more difficult to comprehend code.
AFAIK if the break statement meets your needs, I think you should be good with using it. However, IMO you might not want to overuse breaks in your code because they introduce more exit points. We generally want to keep exit points to a minimum since multiple exit points complicate logic and make it more difficult to comprehend code.