🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4101

Re: Partial decision...

#4101
From: Jurko
Date: Fri, 12 Apr 2002 13:35
48 lines
2657 bytes
> Property *Pr1;
> Variant PropValue;
> Pr1= CellSet1->Axes->get_Item(1)->
>                           Positions->get_Item(0)->
>                           Members- >get_Item(0)->Properties;
> PropValue= Pr1->get_Value(); //   WHY

This line should be causing the error...
    > Pr1= CellSet1->Axes->get_Item(1)->
    >                           Positions->get_Item(0)->
    >                           Members- >get_Item(0)->Properties;
on the left side you have a pointer to one property
and on the right side you have a pointer to a collection
of properties.

Try this (note that I'm guessing type names that you haven't
used but my intent should be clear):

{
    Properties* properties;
    Property* pr1;
    Variant propValue;

    properties =
        CellSet1->
            Axes->get_Item(1)->
            Positions->get_Item(0)->
            Members->get_Item(0)->
            Properties;
    pr1 = properties->get_Item(1); // This is the part that was missing!
    propValue = pr1->get_Value();
}

<two cents worth>
although I'd recommend making the pointers you don't need const and
making const variables for all the intermidiate temporary values. I like to
make that a general rule which I break only when I actively decide that
I'd not lose anything by not following it and that it would make my code
shorter/clearer... in the end I rarely break it at all :-)... same rule goes
for
other prog. languages... even VBScript... amazing how much you can
speed up some ASP pages that way :-) (well in a compiled lang. you'd
need a really dumn compiler and a big loop for it to make a difference
but still it can't hurt you and often makes the code clearer :-) )
</two cents worth>

HTH,
    Jurko
Technical Details
Message-ID: <dpn69a.c1g.ln@news.ve-mil.hr>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews!news.ve-mil.hr!not-for-mail
References: <3cb5bd44$1_1@dnews> <3cb6b1c4_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,699ad39162d2b5f9
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-04-12 06:37:05 PST
From: "Jurko" <Jurko@ve-mil.hr>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3cb5bd44$1_1@dnews> <3cb6b1c4_2@dnews>
Subject: Re: Partial decision...
Date: Fri, 12 Apr 2002 15:35:25 +0200
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <dpn69a.c1g.ln@news.ve-mil.hr>
NNTP-Posting-Host: 195.29.221.130
X-Trace: dnews 1018618564 195.29.221.130 (12 Apr 2002 06:36:04 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews!news.ve-mil.hr!not-for-mail