ade_rtgetprop

Land Desktop Development ARX CPP SDK

Up a level
ade_rtgetprop
 
 

Gets the value of a range table property.

struct resbuf*

ade_rtgetprop(

ade_id rt_id,

char* property);

Returns a property value, or list, or NULL.

rt_id Range table ID.
property Property to get the value of. See the Range Table Properties table below.

You must release the resbuf.

Range Table Properties
name Range table name.
description Range table description.
expr Range table definition (list of range expressions).

See ade_rtdefrange for information about setting range table properties.

The following sample obtains a range table id using the sample code associated with ade_rtdefrange(). Ade_rtgetprop() uses this range table id along with the specified property parameter and fills the resbuf with the corresponding value. If the operation is successful, the resbuf is parsed and the requested information is displayed. Then it releases the resbufs, as required.

char* pszrRangeTblName = "Range_ChgColor";
char* pszrRangeTblDesc = "Change all except red to yellow";
struct resbuf* pRangeTblDef = acutBuildList(
                                RTLB,
                                RTLB,
                                    RTSTR, "=",
                                    RTSTR, "1",
                                    RTSTR, "1",
                                RTLE,
                                RTLB,
                                    RTSTR, "OTHERWISE",
                                    RTSTR, "",
                                    RTSTR, "2",
                                RTLE,
                                RTLE, 0);

ade_id rangeTableId = ade_rtdefrange(pszrRangeTblName, pszrRangeTblDesc, pRangeTblDef);
// Range Table has been defined.

struct resbuf* pRangeTblPropRb = NULL;
char* pszRangeTblPropVal = "description";
if (rangeTableId != ADE_NULLID) {
    pRangeTblPropRb = ade_rtgetprop(rangeTableId, pszRangeTblPropVal);
    if (pRangeTblPropRb != NULL) {
        acutPrintf(
            "\nThe range table \"%s\" property you requested is: \"%s\"."
            , pszRangeTblPropVal, pRangeTblPropRb->resval.rstring);
    }
    else {
        acutPrintf(
            "\nNo range table has been created.");
    }
}
else {
    acutPrintf(
        "\nNo range table has been created.");
}
acutRelRb(pRangeTblDef);
acutRelRb(pRangeTblPropRb);