PGetConvertStr

Converts the specified measurement to twips (the PageMaker internal measurement system).


Constructor

PGetConvertStr(const char * sMeasurement, short cMeasureUnits = -2);
const char * sMeasurement;
Measurement to convert with or without the unit abbreviation.
short cMeasureUnits; // default: -2
Measurement units of the value if the units are not specified in sMeasurement. Options are:

kMeasurementInches
kMeasurementDecimalInches
kMeasurementMetric
for millimeters
kMeasurementPica for picas and points
kMeasurementCicero
kParmDontCare
(-2) to use the default measurement system


Query results

The query returns a short value, representing the measurement in twips.

Specifying units for sMeasurement. You can specify the measurement units of sMeasurement either with the cMeasureUnits parameter or by including a unit abbreviation with the value, as shown below:

Units Abbreviation Example
Inches i "5.625i"
Millimeters m "25m"
Picas p after number "18p"
Points p before number "p6"
Picas and points p between numbers "18p6"
Ciceros c after number "5c"

Note: Do not insert a space between the measurement and the abbreviation.

Example. This function uses the PGetConvertStr class to return the twips for a given string. This twips() function is included in the SDK in the file "Twips.cpp".


long twips(const char * ch)
{
    try {
        PGetConvertStr result(ch, kParmDontCare);
        return result;
    }
    catch (PMErr) {
       return 0;
    };
}


See also

The PGetConvertTwips query


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support