Menu

#7 Support for enumerated "sets"

open
nobody
core (6)
5
2003-04-05
2003-04-05
No

It has been discussed and requested from outside and in.

It would be beneficial to add support for enumerated
sets. Such as is needed for font states (ie. [fsBold,
fsItalic]).

Additionally, support would be needed for Internal
functions like "Include()", "Exclude()" and a keyword
of "in". The following functions would need to be part
of the requirement...

1) if fsBold in FontState then...

2) FontState := FontState + fsBold (same as Include())

3) FontState := FontState - fsBold (same as Exclude())

4) Exclude(FontState, fsBold) (same as "-")

5) Include(FontState, fsBold) (same as "+")

Anything else needed? How difficult is this?

-Mark E.

Discussion

  • Mark Ericksen

    Mark Ericksen - 2003-04-05
    • summary: Support for enumerated "sets" --> Support for enumerated "sets"
     
  • Mark Ericksen

    Mark Ericksen - 2003-04-05

    Logged In: YES
    user_id=193173

    Need to add ...

    6) if FontState1 = FontState2 then....

    I think the data could be supported by using the Data to be
    an array of enumerated types. Then an 'in' operation would
    iterate the array looking for the enumerated type. Include
    (+) would need to check for the enumerated type already
    being listed before trying to add it.

    The less obvious part would be how to do '=' evaluations? Do
    you just compare the sets contents? or does the array need
    to be sorted? (lowest enum to highest) Would order play a
    role in this evaluation?

    Another thing to consider is how this would work with
    external types. How would a wrapped TFont.Style property get
    the values into/out of the script objects?

    Any other thoughts?

    -Mark E.

     

Log in to post a comment.