Syntax

code

Function: IsJobOpen: Wordbool;

Description

Tests whether the PlanSwift application actually has a "Job" opened in the editor.

Code Reference

  • 1. Create a New Form application
  • 2. Add a button to the form
  • 3. add Planswift to reference (Planswift9_tlb in the uses)
  • 4. copy code to button onclick event

code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

procedure TForm1.psGetProperty(Sender: TObject);

var

  ps: IPlanSwift;

  job: IItem;

  prop: IPropertyObject;

begin

//Create The Planswift Interface

ps := coplanswift.Create;

// Check if a job is open

if ps.IsJobOpen then begin

  //Get The Job Item Property Name

  prop := ps.GetProperty('Job','Name');

  //Show The Property Name, Type and Formula

  ShowMessage('Property Name is: ' + prop.Name + ' Type: ' + prop.PropertyType + ' Formula: ' + prop.Formula);

end else begin

  ShowMessage('No Job Opened');

end;

//Free the interface

ps := nil;

end;