I am assuming he is displaying system delimiters, in which case use
REMOVE.  Then you don't have to worry about what the delimiter may be.

CNT = 0
LOOP
REMOVE VALUE FROM VALUES SETTING MORE
    IF VALUE = 0 THEN
      CNT += 1
    END
WHILE MORE DO
REPEAT

Marc Rutherford
Senior Programmer/Analyst
Advanced Bionics LLC
661) 362 1754

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kevin King
Sent: Wednesday, January 06, 2010 3:04 PM
To: U2 Users List
Subject: Re: [U2] Count question

Are those the real delimiters?  I would think you're going to need a
couple
of loops to do what you want.  COUNT will only count the number of times
a
character/string appears inside of another one and DCOUNT counts the
number
of delimited strings.

Perhaps something like this:..assuming VALUES is the incoming string and
TARGET is the target > value:

CNT = 0
VALUES.CNT = DCOUNT(VALUES,'}')
FOR VALUES.LOOP = 1 TO VALUES.CNT
  VALUE = FIELD(VALUES,'}',VAL.LOOP)
  VALUE.CNT = DCOUNT(VALUE,'|')
  FOR VALUE.LOOP = 1 TO VALUE.CNT
    VAL = FIELD(VALUE,'|',VALUE.LOOP)
    IF VAL > TARGET THEN
      CNT += 1
    END
  NEXT VALUE.LOOP
NEXT VALUES.LOOP

Assuming i haven't jacked up anything too heinously, that should about
cover
it.  And it'd be a lot easier with system delimiters.

On Wed, Jan 6, 2010 at 3:45 PM, Ed Hess <[email protected]> wrote:

> Hi all,
>
> Using UniVerse 9.6 on AIX4.1,
>
> I'm trying to write a routine to count the number of occurrences of
> values > than 0, for example,
>
> against this attribute:
>
>
>
> 0011: 4|0|0|0}4|23|4|0
>
>
>
> I'd like to return a value of '4' for the 4 values > 0.
>
> Not having much luck with COUNT or DCOUNT.
>
>
>
> Any help is greatly appreciated.
>
>
>
> Ed Hess
>
>
>
>
>
> _______________________________________________
> U2-Users mailing list
> [email protected]
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>



-- 
-Kevin
http://www.PrecisOnline.com
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to