-
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
help index setting
- Dieses Thema hat 2 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 13 Jahren, 2 Monaten von ralf kang aktualisiert.
-
AutorBeiträge
-
September 27, 2011 um 9:30 pm Uhr #12748ralf kangMitglied
Dim x,i,dtr,result
result = test2
dtr=0.00005
For Each Row i In ori_dataset Do
x=ori_dataset[i-1] – ori_dataset
if x > dtr then
result=ori_dataset
end
end
Return resultthey say “wrong value in index operation”
how can i do?
:bang:September 27, 2011 um 9:30 pm Uhr #8414ralf kangMitgliedDim x,i,dtr,result
result = test2
dtr=0.00005
For Each Row i In ori_dataset Do
x=ori_dataset[i-1] – ori_dataset
if x > dtr then
result=ori_dataset
end
end
Return resultthey say “wrong value in index operation”
how can i do?
:bang:September 28, 2011 um 11:42 am Uhr #9214Bernhard KantzTeilnehmerThe problem seems to be the line
result=ori_dataset
in the If statement.
If the result dataset (initialized with test2) is smaller in length than the ori_datensatz and you try to write at an index position not present in the result dataset an error occurs.
One further problem maybe the first difference you form in the loop. For i = 0 the variable x gets the value of last value minus the first value. If the ori_dataset is assumed to be periodic, this would be exactly what you need, otherwise the first difference doesn’t make sense.
The vector features of FPScript allow you to get rid of the loop. The following expression computes a datasets of the periodic differences in one go:
Dim delta = ori_datensatz[-1] – ori_datensatz[0] : ori_datensatz[0,-2] – ori_datensatz[1,-1]
With the aid of the FPScript functions from the Event Isolation group, you can extract the desired indices; in your case the line
dim idx = ValuesBelowLevel(delta, dtr, EVENT_INDEX+EVENT_COMPLEMENT)
will select all values strictly greater than dtr.
Now useresult[idx] = ori_datensatz[idx]
to overwrite the selected values in the dataset result.
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.