-
FlexPro
- Auf einen Blick
- Features & Optionen
- Einsatzgebiete
- Alle Vorteile
- Neu in FlexPro 2021
- FlexPro gratis testen
- FlexPro View OEM Freeware
- Kaufberatung
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produkte
- News
- Support
- Unternehmen
- Jobs
- Kontakt
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
Home > Community > FPScript > Arrays und Schleifen > Antwort auf: Arrays und Schleifen
Februar 20, 2009 um 11:41 pm Uhr
#8780
Bernhard Kantz
Teilnehmer
First you should be aware that each formula can return only one result (besides if you are using a list result).
The shortest way to solve the first issue is something like this (we assume that all datasets have the same length):
Result = TransposeMatrix({ Dataset1, Dataset2, Dataset3})
The result can than be found in Result[0], Result[1] and Result[2]. If you only need a specific index you could proceed like this:
Create a new formula called ‘DataSetFromIndex’:
Arguments Datasets, Idx
Dim MaxLen, Result
// To simplify things we assume that all datasets have the same length
MaxLen = NumberOfRows($Datasets[0]$)
// pre-allocate the result
Result = 0. # NumberOfRows(Datasets)
For Each Row i In Datasets Do
Result = ($Datasets$)[Idx]
end
Result
Then call it from another formula like this (for the index 1):
DatasetFromIndex({ "Dataset1", "Dataset2", "Dataset3" }, 1)
The second issue could be solved like this (assume Sig for your Signal, to avoid name clashes with the built-in function Signal):
Signal(Dataset1, Sig[0] # NumberOfRows(Dataset1))
Signal(Dataset2, Sig[1] # NumberOfRows(Dataset2))
...
Support
support@weisang.com