OwnedResourceUnit
Resource-Specific System Function
The OwnedResourceUnit function returns the nth Resource's unit number currently owned by the Entity or downtime making the function call. The function parameter indicates the position of the Resource in the owned Resources chronological list. For example, OwnedResourceUnit(1) returns the unit number of longest owned resource in the list and so on.
Syntax
OwnedResourceUnit ({<expression>})
Examples
OwnedResourceUnit (2)
OwnedResourceUnit (ResQty())
OwnedResourceUnit ()
Parameters
({<expression>})
The nth Resource currently owned by the Entity or downtime making the function call. When this parameter is not used, the function returns the last captured Entity-owned Resource unit number. If the parameter value is not within the range of the Resource list, or if the Entity or downtime currently does not own a Resource, the function returns a 0 (zero) without a warning or error message.
Remarks
A preempted Resource is NOT removed from the list but marked temporarily to indicate that the preemptee does not own the Resource. When the Resource resumes the original process after being preempted, it retains its original position in the list.
OwnedResourceUnit is valid in Entity speed fields, traveling-time fields, Resource fields, Resource downtime logic, operation logic, Location downtime logic, routing fields, arrival logic, debug user-condition fields, and move logic.