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