Syntax

code

Function: IItem.GetPropertyResultAsInteger(ItemPath, PropertyName: String; Default: Integer = 0): Integer;


Description

Attempts to return the property value as an Integer. If the calculated value can not be converted to an integer, the value given in Default is returned.


Code Reference


code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

var

  ps: IPlanSwift;

  est: IItem;

  itm: IItem;

begin

  // Create the Planswift Interface

  ps := coPlanswift.Create;

  // Get the Estimating tab

  est := ps.GetItem('Job\Takeoff');

  // Get the Selected item

  itm := ps.SelectedItem;

  // Show the Qty as Integer

  ShowMessage('Property Formula: ' + IntToStr(itm.GetPropertyResultAsInteger

        ('Qty', 0)));

  // Free Planswift

  ps := nil;

end;