Re: I have a line of code I need help with.

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

  • Next message: Phil: "Re: Paradox table picture statement - DBGRID delimma"
    Date: Sun, 4 Jan 2004 13:14:54 +0100
    
    

    "Dark Alchemist" <darkalchemist@mysticglow.com> wrote in message
    news:3FF80083.8659353E@mysticglow.com...
    > Maarten Wiltink wrote:
    >> "Dark Alchemist" <darkalchemist@mysticglow.com> wrote in message
    >> news:3FF7BD21.4DC43F64@mysticglow.com...

    >>> if pMsg.Member['stats'].Member[x].Member['key'] = $5 then
    >>> gd._Burden := pMsg.Member['stats'].Member[x].Member['value'];
    [...]
    >> There is some confusion here because the first two GetMember calls
    >> (property evaluations) apparently return objects, but the last one
    >> evaluates to an integer ($ is the Borland notation for a hexadecimal
    >> immediate constant). Are you sure that this is strongly typed Object
    >> Pascal and not something even more horrible like Perl?

    > Dead positive and I use the program at least 3 times a week so I know it
    > works. My issue is mainly with the .Member since C++ tells me Member is
    > not a member. I honestly think this is a rare case that getting it
    > translated will be near impossible but I do thank you. :)

    Absolutely not. There is little reason it should be hard at all. It's
    just that I don't have much to go on. Seeing properties used, especially
    array properties which must resolve to accessor methods, doesn't tell
    you anything about how they're implemented, and there are _three_ layers
    of necessarily different properties involved here. The writer didn't take
    much trouble to make his intent clear.

    Ctrl-click on pMsg and you should be taken to its declaration; ctrl-click
    on its type and you will be taken to its declaration in turn. It should be
    a class type with a Member property declared that resolves to accessor
    methods. Read the acccessor methods to see what they do; ctrl-click some
    more to see what type the property is (should be the same or a different
    class type), what its Member property does, and again for the last one.
    Mostly, it'll be tedious, and perhaps a little hard to follow because
    different class types all have identical-looking Member properties.

    Properties aren't written like this in C++; instead, paired member functions
    with identical names are used, one for reading and one for writing the
    logical property. So the square brackets would become parentheses and the
    Get/SetMember methods would simple become overloaded member() functions.
    I don't know if member is perhaps a reserved word in C++.

    Are you at all familiar with programming, Delphi, and/or C++? It would help
    to know at what level to start explainig things - and below a certain level,
    you'd be best served with some local assistance.

    Groetjes,
    Maarten Wiltink


  • Next message: Phil: "Re: Paradox table picture statement - DBGRID delimma"

    Relevant Pages

    • Re: Is PGO (Profile Guided Optimization) incompatible with stl and /MD
      ... It won't work on rvalues of non-class type, ... For rvalues of class type and operators++ which are non-members, ... For member operator++, it'll just work, because member ... and the compiler has a bug that allows binding temporaries to ...
      (microsoft.public.vc.language)
    • Re: LSP violation or not
      ... > form of identity so that the interface can dispatch properly. ... for the member that does CASTING in the C++ OOPL. ... Having an OOPL's class switch the class type it hands out based upon ...
      (comp.object)
    • Re: templated class design - learning project.
      ... >> will be a different class type. ... void f ... // statements using all the member functions for c1 and c2 ... class template, when instantiated, there will more code. ...
      (alt.comp.lang.learn.c-cpp)
    • Re: Function Call Problem
      ... And the Class Type should not be changed from MFC Class. ... Using the Class Wizard, add a member variable for the Tab Control, naming ... And under Variable Type, use CMyTabCtrl (scroll down). ...
      (microsoft.public.vc.mfc)
    • Re: Which variable type?
      ... that it returns an object of type CommandBarControl.) ... It would be better to include a declaration like ... > The Item method syntax has the following object qualifier and part: ... An expression that specifies the position of a member ...
      (microsoft.public.word.vba.general)