This method counts the number of instances of the same child application currently running within the current MDI container. It accepts a single parameter that is the name of a child application set by the ui.Interface.setName() method. It counts only the child applications with the given name, any other child applications are ignored, and returns an integer number. it returns 0, if no applications with such name are currently running.
Here is a simple example of how to use this method:
parent application:
MAIN
CALL ui.Interface.setType("container")
MENU
ON ACTION run_child
RUN "child_app" WITHOUT WAITING
ON ACTION getCI_child1
DISPLAY "child1 count is:",TRIM(ui.Interface.getChildInstances("child1"))
ON ACTION exit
EXIT MENU
END MENU
END MAIN
child application:
MAIN
CALL ui.Interface.setName("child1")
CALL ui.Interface.setType("child")
MENU
ON ACTION exit_menu
EXIT MENU
END MENU
END MAIN