Share via


Scale.UnitPrice Property

Holds the unit price of the article to be weighed.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Usage

'Usage
Dim scale1 As Scale

Dim returnValue As Decimal
returnValue = scale1.UnitPrice

Dim sampleValue As Decimal
scale1.UnitPrice = sampleValue

Syntax

'Declaration
Public MustOverride Property UnitPrice() As Decimal
public abstract decimal UnitPrice {get; set;}
public: property virtual Decimal^ UnitPrice{
    Decimal^ get();
    Void set(Decimal^);
}
public abstract System.Decimal get_UnitPrice();
public abstract void set_UnitPrice(System.Decimal);
public abstract function get UnitPrice() : Decimal;
public abstract function set UnitPrice(Decimal);

Remarks

For price-calculating scales, set UnitPrice before weighing. The scale will calculate SalesPrice by multiplying the UnitPrice with the pWeightData parameter of the ReadWeight method. So, UnitPrice contains only a factor.

If CapPriceCalculating is FALSE, the scale is not a price-calculating scale. In this case, setting a unit price is not supported and UnitPrice is always zero.

UnitPrice is initialized to zero when the device is first enabled following the Open method.

Accessing UnitPrice can cause the following exception to be thrown:

Value

Meaning

Illegal

CapPriceCalculating is FALSE or an invalid price was specified.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, and Windows 2000

Target Platforms

See Also

Reference

Scale Class
Scale Members
Microsoft.PointOfService Namespace
ReadWeight
WeightUnit
CapPriceCalculating
SalesPrice