Saving VCP

As I said before… RESOURCES are not stored as clear text, RESOURCES are NOT code, I guarantee that ever line of CODE you wrote is available inside the series of VCP files as clear as the day is long.

Nothing is as clear to me as the day is long :slight_smile:

My problem was that I was saving the XojoProject into a busy folder that had many, many items in it. My eye traveled to the two files (the project file and the resource file) that had the same name as my project and I assumed that these were all that was created.

I did not see the [quote]series of VCP files[/quote]

They were interspersed among all the other files in the folder and I just did not notice them. It might be nice if when the user saved as XojoProject, that Xojo created a folder and placed all the XojoProject files in that one folder, but I do not really want to deflect blame away from my own blindness.

My second observation is that the XML file is very difficult to parse. As I say, the problem that I was finding very difficult was associating the code that is associated with the various controls. I could find the code itself and in the same general area could find the fact that it was code associated with a push button or a radio button. I could associate it with its specific window but I could not associate the code with the name of an individual control. The name of the control would be found far away in the XML document from the code of the control and I could not figure out how they were linked. Obviously Xojo must know but I could not figure this puzzle out.

Anyway, the VPS files are vastly easier to parse. Even the indentation is preserved! (not in the XML file)

Although it involves throwing away a big pile of code, I will now rewrite to parse the VCP files for my purposes which will be a vastly easier task.

I cannot thank you enough.


I just did not see the files. Very sad.

It seems the XML files have forward and backward references, making it hard as you said to relate a particular section of “code” to the correct control or form.

In XML a control comes in 2 nodes: ‘ControlBehavior’ for the event code and ‘Control’ for the property values (including name). The 2 nodes are associated by the order they are listed. So in a window block with 3 controls you’ll see this towards the end…

ControlBehavior ControlBehavior ControlBehavior Control Control Control

ControlBehavior contains a HookInstance node for each event it implements.

ControlBehavior SuperClass HookInstance

If a control doesn’t have any events a ControlBehavior is still listed for it, just without any HookInstances.

The Control node is mostly PropertyVals of what’s in the Inspector pane.

The only association between the two is that the first ControlBehavior listed are the events for the first Control listed. Depending how you parse the XML these should be easy to link up.

Thanks. This might help me walk the last mile with the code I have already written.