How Do I Retrieve a List of All Running Contexts? (Magic xpa 3.x)

While you ware working in the Debugger, you view all the existing contexts on the Context pane of the Debugger. However, if you would also like to retrieve a list of all the running contexts from within your program at runtime, you can use the CtxGetAllNames() function. This returns an array of context names, and you can manipulate the array with the usual array functions.

If you would like to display the contexts onscreen, you can concatenate the array into a comma-delimited list, as shown here.
The Online Samples project (program MT02)