current

current(value: Any output): Boolean;

The current method of the JadeIteratorIF interface defines the behavior that retrieves the current element in the iterable sequence. If a current element is available, it should be assigned to the output value parameter and the method should return true. If no current element is available, the method returns false.

If the current method is called before the JadeIteratorIF interface next method has been called at least once, it should not find a current element. Similarly, if the next method has returned false, any calls to the current method should also return false.

The following example shows the use of the current method.

writeCustomerDetails(iterator: JadeIteratorIF);
vars
    customer: Customer;
begin
    if iterator.current(customer) then
        write customer.getDetails();
    endif;
end;

In this example, the current method has been implemented to return a Customer instance. If this current method implementation assigns something other than a Customer instance to the output value parameter, the behavior is undefined when the current method is called.

2020.0.01 and higher