Topic
selecting positive values
Startseite ' Community ' FPScript ' selecting positive values
- Dieses Thema hat 5 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 14 Jahren, 6 Monaten von mac ye aktualisiert.
-
AutorBeiträge
-
09.11.2010 um 02:23 Uhr #33148mac yeTeilnehmer
I got a problem in filtering positive values from a data set.
background:
A is a data set with pos and neg values. and I want to selet all the positive values and set all negative values to 0
so I create a data set B with same number of colums and initial value as 0I wrote a script in a function like this:
Dim i
For i=0 To 8000 Do
If A[i] < 0 Then B[i]==A[i] End End But it returns "no value" Would you please give me an example for this?09.11.2010 um 02:23 Uhr #33153mac yeTeilnehmerI got a problem in filtering positive values from a data set.
background:
A is a data set with pos and neg values. and I want to selet all the positive values and set all negative values to 0
so I create a data set B with same number of colums and initial value as 0I wrote a script in a function like this:
Dim i
For i=0 To 8000 Do
If A[i] < 0 Then
B[i]==A[i]
End
EndBut it returns "no value"
Would you please give me an example for this?09.11.2010 um 17:39 Uhr #33149Bernhard KantzTeilnehmerYou have to use = instead of ==.
But it’s better and faster to use the [b]ValuesBelow[/b]-function and the index operator.Example:
[code]
Dim B = A
B[ValuesBelowLevel(A, 0, EVENT_INDEX)] = 0
[/code]
support@weisang.com09.11.2010 um 18:57 Uhr #33150mac yeTeilnehmerhello, thank you for your reply!
when I use the valusebelow func, it replies:
index assignment to signals, signal serials.. are not allowed. assign the components seperately.
So do you have any further recommendation?
Thank you!
09.11.2010 um 23:58 Uhr #33151Bernhard KantzTeilnehmer10.11.2010 um 02:31 Uhr #33152mac yeTeilnehmerThank you! It works!
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.