Example:
GTM>SET A="HELLO" XECUTE "WRITE A" HELLO GTM>
This demonstrates a simple use of XECUTE.
Example:
SET x="" F S x=$O(^%x(x)) Q:x="" X x
This $ORDER() loop XECUTEs code out of the first level of the global array ^%x. Note that, in most cases, having the code in a GT.M source file, for example TMPX.m, and using a DO ^TMPX improves efficiency.