ERASING NEG FIGURES
ERASING NEG FIGURES
As a result of calculation I get a serie which has positive and negative figures.I would like to eliminate for a PRINT of thes values, all the negatives figures (I don't need them).ABS gives the figures without sign and is not the answer. How can I do?
Code: Select all
If Value >= 0 Then Print Value
Code: Select all
For a = 0 To arrLen
If Arr(a) >= 0 Then Print Arr(a)
Next
I have left this dump.
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact:
Ok, Ummm here we go:
It easy
Do this:
Or (my pref):
The first one takes a series of values from arrayname and transfers only the ones that are 0 or postitive to arrayname2. Just have arrayname2 have the same range as arrayname. And use arrayname2 for now on or transfer the vals back to arrayname AFTER you clear it first.
The second one PRINTs out the values in arrayname only those that are 0 or positive. This way I preferr.
Well if that didn't answer you question then please explain more or provide source please...
Hey Rattrap I beat you on this one HA!
It easy
Do this:
Code: Select all
arrayname2i = 0
FOR i = LBOUND(arrayname) TO UBOUND(arrayname)
IF i >= 0 THEN arrayname2i = arrayname2i + 1 : arrayname2(arrayname2i) = arrayname(i)
NEXT i
Code: Select all
'when you want to PRINT it
FOR i = LBOUND(arrayname) TO UBOUND(arrayname)
IF i >= 0 THEN PRINT arrayname(i)
NEXT i
The second one PRINTs out the values in arrayname only those that are 0 or positive. This way I preferr.
Well if that didn't answer you question then please explain more or provide source please...
Hey Rattrap I beat you on this one HA!
"But...It was so beutifully done"
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
He posted a few soconds b4 you, oh well,.. I'm glad you 2 it first, I'd had to ponder on this one for a min,. ,. now I no have to, heh heh,.
I'm still confused, Z!re, you a boy or girl? I saw the comment, I thought you were commenting that QB Gals EM had MID$(email,,4) = "Lord" in it,..
Doesn't matter either way, I'm just screwed up, and liked to be set strait with a solid answer.
I'm still confused, Z!re, you a boy or girl? I saw the comment, I thought you were commenting that QB Gals EM had MID$(email,,4) = "Lord" in it,..
Doesn't matter either way, I'm just screwed up, and liked to be set strait with a solid answer.
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact: