Re: Invalid variant type conversion

From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: 01/21/04

  • Next message: Maarten Wiltink: "Re: How do I change a Form ancestor type."
    Date: Wed, 21 Jan 2004 21:21:55 +0100
    
    

    "Bjørge Sæther" <bjorge@hahaha_itte.no> wrote in message
    news:K7sPb.2888$Ed.46110@news4.e.nsc.no...

    > The NULL value of a database may be used for this purpose, but you can't
    > reflect this in application programming unless you limit your coding to
    > types that have a NULL value.

    Not true. Just change TAnyType to PAnyType.

    > BTW, using database fields for holding CSS data would normally be done
    > in a BLOB/MEMO field text, rather than putting CSS' properties in
    > dedicated fields. There is no such thing as a NULL value in CSS format,
    > only a missing value ("tag"), AFAIK.

    It was just an example. The example needed the assumption of storing
    single CSS properties in a field to make sense. That's not a limitation
    of the idea of adding a unique element nil to any domain; after all,
    *you* wanted an example and not an academic discussion.

    [...]
    > ...but there is one thing I don't need: 'IsNull' for string fields.
    > The empty string tells it all. I will not write an application that
    > gives NULL value of a string field any meaning.

    But I will, if it suits me.

    > Databases require NULLS for referential integrity, but the distinction
    > is superflous, since using a '' for a key value is madness.

    Who's talking about key values? Databases are for storing data, and it
    may suit me to distinguish the cases of a string field having the empty
    string or _no_ string as its value.

    > Thus, the "inherited"/"override" problem should be handled otherwise.

    What's wrong with handling it by using "no value" to denote "not an
    override in place"? You (effectively) asked for an example; I gave you
    one. Don't be too surprised if I give one that would really work.

    > How to show it in a GUI ? I developed a special vertical grid type,
    > having an extra column of check boxes indicating whether the value
    > was to be left unchanged or specifically set - e.g. to EmptyString.
    > No control can show the difference between the two for a string value,
    > unless some extra functionality is added.

    Okay, so you don't know of any currently existing (single) control that
    can. Derive one. It's not hard; one of the nice things about Delphi is
    that deriving components isn't hard. Still thinking of my CSS example,
    a different background colour could indicate that the displayed value
    is inherited, and a context menu might have an option "revert".

    > When you 'Clear' a TMemo using your keyboard, what value do you write
    > in the underlying field ? You have to decide, right ? It's not obvious
    > at all, it's an utterly meaningless ditinction.

    You keep saying that, in the face of my example, when *you*, in the best
    biblical tradition, called it "good". Let's also not forget something
    else: there need not be a one-to-one mapping between what's in the
    database and what's in the GUI. In the simplest case, "inherited" is not
    a CSS property value itself, it's a pointer to another property's value,
    and _that_ value will be used for rendering. In less simple cases, a
    database may use a very different data structure and representation than
    the one the user eventually sees in a presentation layer, with several
    more layers in between.

    Groetjes,
    Maarten Wiltink


  • Next message: Maarten Wiltink: "Re: How do I change a Form ancestor type."

    Relevant Pages

    • passing an Access variable to a page
      ... database and a third piece of information is retrieved. ... string to a webpage so it will obey the rules in the CSS. ... rows consist of the fields username, ...
      (microsoft.public.frontpage.programming)
    • Re: Selectors
      ... Sorry for my poor English but what do you mean by "string" in this ... itself more to your liking. ... I am saying that your CSS is causing a lot of trouble style-wise. ... sheet at all and to have the closest to no styles until you can ...
      (alt.html)
    • Re: Invalid variant type conversion
      ... In the case of a string property, ... The convention in CSS is that the string ... IMHO giving the NULL a specific meaning in your application, ... value of a database may be used for this purpose, ...
      (comp.lang.pascal.delphi.misc)
    • Re: Selectors
      ... Sorry for my poor English but what do you mean by "string" in this context? ... off all my style sheets, ... I am saying that your CSS is causing a lot of trouble style-wise. ...
      (alt.html)
    • Re: Finding Hyperlinkcolumn
      ... file and just put in the 2 classes inline - it does change the colors ... I assume that something in my .css file is causing the problem. ... >> Hi Tom, ... > As String ...
      (microsoft.public.dotnet.framework.aspnet)