-
FlexPro
- At a Glance
- Features & Options
- Applications
- All Advantages
- What’s New in FlexPro 2021
- Try FlexPro For Free
- FlexPro View OEM Freeware
- Buying Guide
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Products
- News
- Support
- Company
- Contact
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
Home > Community > FPScript > Equal To Operator > Reply To: Equal To Operator
You can do this computation much more efficiently if you use the index operator and event isolation functionality to avoid loops on individual values:
Dim idx
// setup data series of proer length
Dim Turbinendrehzahl = 0. # NumberOfRows(Vges)
// Find all positions where 1st gear was used
idx = ValuesInInterval(Gangpos, 1, 1, EVENT_INDEX)
// set all these postions to a fixed value
Turbinendrehzahl[idx] = Radwellendrehzahl / 'Gang 1'
// do the same for the 2nd gear.
idx = ValuesInInterval(Gangpos, 2, 2, EVENT_INDEX)
Turbinendrehzahl[idx] = Radwellendrehzahl / 'Gang 2'
// continue for further gears
// would "Radwellendrehzahl" and "Gang x" be data series, you could have a loop running across the gears.
...
// return the result
return Turbinendrehzahl