Re: I have a line of code I need help with.
From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: 01/04/04
- Previous message: Dark Alchemist: "Re: I have a line of code I need help with."
- In reply to: Dark Alchemist: "Re: I have a line of code I need help with."
- Next in thread: Jamie: "Re: I have a line of code I need help with."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Dark Alchemist: "Re: I have a line of code I need help with."
- In reply to: Dark Alchemist: "Re: I have a line of code I need help with."
- Next in thread: Jamie: "Re: I have a line of code I need help with."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|