Skip to content

FxProjectID ​

This module contains functions for creating and working with ProjectID lists.

Load ​

lua
FxProjectID = require "FxProjectID";

Functions ​

FunctionDescription
Count (ProjectID)Returns the number of items in a list.
Create (ProjectID)Creates a project list.
FilterID (ProjectID, Value)Filters projects.
Get (ProjectID, Index)Returns the project from a project list at given index.
Merge (ProjectID1, ProjectID2)Merges two project lists.
Remove (ProjectID, RemoveID)Removes a project from a list.
Reverse (ProjectID)Reverses a project list.
SortID (ProjectID)Sorts a project list by ID.

Count (ProjectID) ​

This function returns the number of projects identified by the specified ProjectID.

Parameters ​

  • ProjectID: The ProjectID to identify the projects of the list

Returns ​

The number of identified projects

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
val = FxProjectID.Count("<project1,project2,project3>");
-- returns 3

val = FxProjectID.Count("/s");
-- returns number of selected projects

Create (ProjectID) ​

This function returns a valid ProjectID list identified by the given ProjectID.

Parameters ​

  • ProjectID: The ProjectID to identify the projects of the list

Returns ​

A valid ProjectID list without duplicates

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- create a list of all projects
list = FxProjectID.Create("*");

FilterID (ProjectID, Value) ​

This function returns the projects identified by the given ProjectID that have the given value in their ProjectID.

Parameters ​

  • ProjectID: The ProjectID to identify the projects of the list
  • Value: The filter string

Returns ​

A valid ProjectID list without duplicates

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = FxProjectID.FilterID("*", "city");

Get (ProjectID, Index) ​

This function returns the project at the given index from a list of projects identified by the given ProjectID. The index of the first item is 0.

Parameters ​

  • ProjectID: The ProjectID to identify the projects of the list
  • Index: The list index

Returns ​

A single ProjectID

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
list = FxProjectID.Get("<dear,bear,fox", 2);
-- returns "fox"

Merge (ProjectID1, ProjectID2) ​

This function merges the two identified ProjectID lists and returns the new list.

Parameters ​

  • ProjectID1: The ProjectID to identify projects for list 1
  • ProjectID2: The ProjectID to identify projects for list 2

Returns ​

A valid ProjectID list without duplicates

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = FxProjectID.Add("<layer1,layer2>", "layer3");
-- returns "<layer1,layer2,layer3>"

Remove (ProjectID, RemoveID) ​

This function takes the projects identified by the given ProjectID, removes all projects identified by the given RemoveID, and returns the new list.

Parameters ​

  • ProjectID: The ProjectID to identify the projects of the list
  • RemoveID: The ProjectID to identify one or more projects to remove from the list

Returns ​

A valid ProjectID list without duplicates

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = "<bus,train,car>";
list = FxProjectID.Remove(list, "car");
-- returns "<bus,train>"

Reverse (ProjectID) ​

This function reverses the order of projects identified by the given ProjectID and returns the new list.

Parameters ​

  • ProjectID: The ProjectID to identify the projects of the list

Returns ​

A valid ProjectID list without duplicates

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = "<one,two,three>";
list = FxProjectID.Reverse(list);
-- returns "<three,two,one>"

SortID (ProjectID) ​

This function takes the projects identified by the given ProjectID, sorts them alphabetically, and returns the new list.

Parameters ​

Returns ​

A valid ProjectID list without duplicates

Errors ​

Possible errors include FX_PROJECT_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = "<fish,whale,shark>";
list = FxProjectID.SortID(list);
-- returns "<fish,shark,whale>"