Home Forums General XMetaL Discussion Using Xmetal Developer 9.0 w/MVS 2015 to debug xft Reply To: Using Xmetal Developer 9.0 w/MVS 2015 to debug xft

Derek Read

Reply to: Using Xmetal Developer 9.0 w/MVS 2015 to debug xft

When I said JS files I meant that the only known examples of using this method that I'm aware of are in the DITA customization, the majority of which is coded in JS files. If you are looking through your own customization it is less likely that JS files were used and that the code is in an MCR file. Our DITA customization is written in JS files as it helps with debugging (the MCR files we use load the JS files as a string then JScript “eval” to inject it into the MCR's JScript).

It is unsupported in as much as it is undocumented (so there's no technical support for it). We generally don't expect anyone to be able to figure out how to do things that aren't documented. The documented way for launching a form from script is to use the CreateFormDlg method. The Programmers Guide lists this example:

// XMetaL Script Language JSCRIPT:
// Call an instance of myform.xft
var dlg=Application.CreateFormDlg("C:\myform.xft");

If your form doesn't need to be non-modal then I'd use the CreateFormDlg() method above. However, if it must be non-modal then you will need to use the code you are using. The change you've made here should inject the Application object as “Application” so you can refer to it as such in your XFT code (you can change the object name when you pass it in, but I'd leave it as “Application”).

You can't debug inside an XFT. That is one reason to externalize all the code. A long time ago, before we moved to the Visual Studio integration of XMetaL Developer, we had our own debugger for XFT. However, when we moved to the Visual Studio integration that had to be dropped as it was just not compatible.

However, if you put all (or most of) the code inside your MCR file and then inject that (as you sort of seem to be doing, at least partially) then you can debug that injected code using the Microsoft debugger. The issue is that XFT is a binary format that Visual Studio can't deal with, but putting the code into a JS or MCR file allows it to load it into the debugger.