How do I save an Xojo File in .XML format?

How do I save an Xojo File in .XML format?

I just downloaded and installed Xojo.

With REALbasic, I was able to save a Project in several different formats, including .rbp and .xml. I found the latter particularly helpful, since by manipulating the contents of the file I was able painlessly to accomplish over a hundred tasks that would otherwise be difficult or impossible to do.

Here are a few examples of tasks that .xml format for Projects allows me to do:

 1. Add automatic comment to End If line.
    Example:  End If // If Total > 200
 2. Add automatic comment to Else line.
    Example:  Else // If NOT (Total > 200)
 3. Add automatic comment to Next line.
    Example:  Next I // For I = 0 To LastLineNumber
 4. Add "boilerplate" material to beginning of procedures (e.g., header telling name of procedure, purpose, programmer, date, etc.).
 5. Add "boilerplate" material to end of procedures.
    Example:
    Exception
    MsgBox "An error occurred in Window1.EnableMenuItems."
 6. Check to see whether any Variables and any Properties have been given the same name.
 7. Check to see whether any Variables are DIMensioned but never actually used.
 8. Check to see whether any Properties in a procedure are defined but never actually used.
 9. Change font throughout to System for font and 0 for font size..
10. Comment out all source code with indenting preserved (sometimes useful if a major rewrite of a program is needed).
11. Comment out all MsgBox statements (sometimes useful if MsgBox is used only for debugging).
12. Conform keywords to standard REALbasic format regarding case (e.g., "NEXT","next", "NExt" all become "Next").
13. Display source code on screen for entire project or for a particular procedure.
14. Display XML file on screen (including any modifications that have been made to the XML code).
15. Edit XML or extracted Source or search for string or whole word in XML or extracted Source.
16. Inset a space before and after mathematical operators ( + , - , , / , = , ^ , <> , >= , <= ), before or after parentheses symbols, and/or after commas.
17. Increase indentation of source code beyond the normal indentation (sometimes makes source code more readable).
18. Remove "//", " ' ", or "REM " symbols from source code.
19. Remove all automatic "Else", "End If", or "Next" comments (see 1, 2, and 3 above).
20. Remove all blank lines from source code.
21. Remove procedure headers or footers (see 4 and 5 above).
22. Remove highlighting from entire Project, setting the cursor at the top of each Method
23. Restore indentation of source code to normsdal (see 17 above).
24. Save to disk any of several lists (Constants, Controls, Line Labels, Menu Items, Methods, Modules, Passed Parameters, Properties), 
25. Save to disk extracted ur edited source code displayed on the screen.
26. Save to disk (modified) XML file displayed on the screen (will run as a regular program).
27. Send to printer any list, source code, or XML file on the screen (see 24, 25, and 26).
28. Add appropriate counter variable to "Next" line (e.g., "Next" becomes "Next LineNumber").
29. Double- or triple-space source code.
30. Display list of modifications made to XML code by CodeHelper.
31. Obfuscate (or unobfuscate) source code by switching control names.
32. Change a "name" (variable name, property name, etc.) throughout the code (uses RegEx to change only "whole words").
33. Display project information (short or long).

Here’s my problem. I have not yet found how to save an Xojo Project in .xml format.
For that matter, I have also not yet found how to save an Xojo Project in “version control” format, another Project format that some here have found helpful.

I may be missing something simple. Can anyone tell me what it is? How do I save an Xojo Project in .XML format?

Warm regards,

Barry Traver

P.S. SInce Xojo can load in and run .xml files, it obviously understands what they mean.

Make sure your license is installed. If it’s not installed it will only allow you to save in Binary format.

The new IDE can only save to XML or VCP format if you have a build license. See: https://forum.xojo.com/139-xml-and-vcp-project-files/p1#p930

Choose “Save as…” from the File menu and there’s a popup menu for setting the project type (binary, XML, etc.)

BTW, all these various things you’re wanting to do could be easily done with IDE Scripting, and probably a lot more conveniently.

Bob, Andrew, and Marc,

Wow! I got helpful replies from all of you in the matter of minutes (of in the space of seconds?) I now have all three options where before there was only one, and the difference was that I had not yet properly installed the license keys (an area where Katherine Brown of Xojo was very helpful).

Thanks to everyone for all the assistance.

Barry Traver

Marc,

Thanks for the suggestion!

I learn a lot from specific examples. Could you possibly supply just one (if IDE Scripting is really an easier way to go), choosing, e.g., one of the tasks in my earlier list of about thirty tasks.

Warm regards,

Barry Traver

[quote=19777:@Barry Traver]I learn a lot from specific examples. Could you possibly supply just one (if IDE Scripting is really an easier way to go), choosing, e.g., one of the tasks in my earlier list of about thirty tasks.
[/quote]

Sure. The latest issue of xDev includes an article I wrote that talks about IDE Scripting, since it’s now a “free” feature available to everyone (Free Xojo Features).

Here’s an example from the article. It’s a tiny script that replaces a tab placeholder with chr(9) code.

if selLength > 0 then selText = selText.replaceAll("~", chr(34) + " + chr(9) + " + chr(34)) end if

To use it, I write a line of code like this:

[code]dim s as string = "item1~item2~item3~item4~item5~item6"[/code]

Then I select the line and run my script from the script menu. The code is changed to this:

[code]dim s as string = "item1" + chr(9) + "item2" + chr(9) + "item3" + chr(9) + "item4" + chr(9) + "item5" + chr(9) + "item6"[/code]

This makes it easier for me to incorporate tab-delimited items within my code without all that tedious typing.

Since IDE Scripting uses regular Xojo syntax, you can easily do things like replace ’ with // comments, etc. or whatever style of comments you’d like, insert boilerplate material, etc. I talk about more of that in the article, as well as build automation (you can use scripting to help build various versions of your application).

Marc,

Thanks very much for the helpful, detailed post.

Does the magazine have a phone number? In addition to the issue with your article in it, I’m considering getting around to ordering other issues as well, but I’m obsessive/compulsive about getting complete sets rather than “sets” that are missing magazines. I heard a rumor about complete bound volumes being available, but I’d like to confirm that by talking with a flesh-and-blood person before I place my order.

Barry Traver

P.S. My email address is barrytraverATgmailDOTcom (with AT and DOT replaced by the traditional symbol).

Sure:

Tel. 1-877-364-5922 (toll-free within the USA)
Tel. 1-831-621-1740

Note that it’s just me and if I’m not available, I’ll call you back.

We have printed books of all the finished years (10 so far; we’re currently in year 11 of publication). It’s a great way for people who prefer print to get the back issues (everything’s available digitally, too, of course).

I spoke too soon. I still can’t save an Xojo program as a .xml file as I did with REALbasic. I can save an Xojo program as an “xojo_xml_project” file, but that format is of no use to me unless I can access the contents (xml text) as I would a normal .xml file.

And if I cannot access the contents, I cannot do lots of things I was able to do easily earlier (such as check to see whether any Variables and any Properties have been given the same name or to check to see whether any Variables are DIMensioned but never actually used).

If I click on “License Keys” on the Help menu in the Xojo IDE, I see this: “Licenses: Pro (Desktop, Web, Console, Database Servers) … Expiration” 1/17/2015 … Registered to barrytraver" and my current email address. So it would seem that Xojo has me properly registered,

Back In 2009 I posted the following comment:

"I’d … like to commend REAL Software for making available the “white paper” on “REALbasic XML Project Format” at http://www.realsoftware.com/support/xml."

If you try that link now, you’ll get this response:

“Sorry! The page were looking for cannot be found.”

If that XML “white paper” is still available either at realsoftware.com or xojo.com, I was unable to find it.

Does anyone here know where the current location is and/or whether Xojo – like REALbasic – supports that same XML definition?

According to Wikipedia, “Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.” REALbasic’s .xml files were human-readable, but thus far (at least for me) Xojo’s “xojo_xml_project” format does not seem to be “human-readable.”

Bottom line: Is it possible in Xojo to save a program in .xml format as was possible in REALbasic (and what do I need to access it)?

Warm regards,

Barry Traver

Barry, welcome back to the forums. The xojo_mxl_project format is identical to the xml file format, it just has a different extension. Right click the file and use Open With to open it in a text editor. Or change the extension to .xml

that is … assuming you have an active build license. XML format is not available via the “free” IDE

Dave S,

If I click on “License Keys” on the Help menu in the Xojo IDE, I see this: “Licenses: Pro (Desktop, Web, Console, Database Servers) … Expiration” 1/17/2015 … Registered to barrytraver" and my current email address.

Does that qualify? Or do I need to check something else (and how)?

Warm regards,

Barry Traver