Re: Re[2]: (Another) (small) Eu 2.5 feature request.

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

On Thu, 23 Sep 2004 20:54:55 -0700, Derek Parnell
<guest at rapideuphoria.com> wrote:

> > Really? So there's no pattern whatsoever to the array? Can you expand
> > that description?
> 
> Sure. The library supports User-Defined-Properties for each control. This
> is implemented as a pair of sequences for each control. One sequence
> contains text names for each property that the user defines, and the
> other contains the value of each defined property. 

So there is a sequence containing only user defined properties for each control.
Each and every element contains a pair of sequences.
The first sequence of each and every element contains only strings.
The second sequence - each element may be whatever it likes. (object)

I'd say that's still largely homogenous...

> As we can't predict
> the order that properties are defined in, or the datatypes that they
> might have, we can end up with a sequence in which each element
> has no correlation to any other element in the same sequence.

When you get to a point where the elements of a sub-sequence don't
follow any structure, stop, and allow that to be "object".

If I was to put this in my "of" notation:
--basic stuff...
type char(integer x) 
    return x >= 0 and x <= 256 
end type
type string( sequence of char x) 
    return 1 
end type
type names_list( sequence of string x)
    return 1
end type

--specifics
type udps( sequence x ) --a single set of user defined properties.
    if length(x)=2 and names_list( x[1] ) and sequence( x[2] ) and
length(x[1]) = length(x[2]) then
        return 1
    else return 0
    end if
end type

type UserDefinedProperties ( sequence of udps x )
    return 1
end type


Quite simple, really. It makes manual checking unnecessary in many cases.

One point to note is, that should some kind of structure functionality
be introduced, it could replace the 'udps' type without any problems.



C'mon, is that the most heterogeneous thing you guys can find?? 
-- 
MrTrick

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

Search



Quick Links

User menu

Not signed in.

Misc Menu