Re: Strings and the like.

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Wed, 8 Dec 1999 19:43:30 -0500, Lucius L. Hilley III <lhilley at CDC.NET>
wrote:

>  The error in using the below code is that it doesn't check to see if there
>is a sequence inside s.  And if there is.  It fails to check it properly as
>well.
>
>Run this example:
>
>type whole_set(sequence s)
>  return find(0, s = floor(s))
>end type
>
>? whole_set({1, 2, 3})
>? whole_set({1, 2, {3}})
>? whole_set({1, 2, {3.14}})
>
>of course you could try this.
>
>type whole_set(sequence s)
>  return (compare(repeat(1, length(s)), s = floor(s)) = 1)
>end type
>

All examples with either type definitions return 0's and I'm not quite sure
what that means. Your original premise, though, I agree with. The likelyhood
of sub-sequences in a string is fairly low, however, especially if we are
talking about externally supplied data.

Everett L.(Rett) Williams
rett at gvtc.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu