Hi there,
I'm very begginer at Java and I want to modify a code. Here is the entire code:
Actually i want to make this code as short as possible... maybe using for loop to prevent from repeating some statements... can anyone help me?var NodeName1 = "Curve1"; var NodeName2 = "Curve2"; var NodeName3 = "Curve3"; var NodeName4 = "Curve4"; var NodeName5 = "Curve5"; var NodeName6 = "Curve6"; var count = ag.fm.FeatureCount; var num1 = 0; var Yes = agc.Yes; for (var i = 0; i < count; i++) { var current = ag.fm.Feature(i); var Name = current.Name; if (Name.toLowerCase() == NodeName1.toLowerCase()) { current.CurveRefresh = Yes; num1 += 1; } else if (Name.toLowerCase() == NodeName2.toLowerCase()) { current.CurveRefresh = Yes; num1 += 1; } else if (Name.toLowerCase() == NodeName3.toLowerCase()) { current.CurveRefresh = Yes; num1 += 1; } else if (Name.toLowerCase() == NodeName4.toLowerCase()) { current.CurveRefresh = Yes; num1 += 1; } else if (Name.toLowerCase() == NodeName5.toLowerCase()) { current.CurveRefresh = Yes; num1 += 1; } else if (Name.toLowerCase() == NodeName6.toLowerCase()) { current.CurveRefresh = Yes; num1 += 1; } else if (num1 == 6) { break; } } agb.regen();