View Full Version : Why are vfp-forms imported in a vfp-section and not in a canvas section?

2012-11-11, 17:09
I know, that lianja stores a canvas section in XML and imported vfp-forms are stored in a prg. But why?
Is it not possible to translate a form (scx) or a form-class (vcx) into xml?
I work on a project where we have round about 1000 forms, 1000 reports and an uncounted number of lines of code.

If it would be possible to have an import-tool right into "real" lianja, that would be very helpfull for us.
If there are no technical reasons for not having such a tool, maybe we could implement a tool for our needs.

2012-11-11, 18:52
Well, the converter is in the library directory, you can look at how that works and produce a page and/or section template.

if you save a page or section as a template, look in the c:\lianja\templates directory and you can see the XML format.

it would require you to create a custom library for the section also which contains the delegate procedures that are referenced from the section XML.

not all vfp controls are currently available in canvas sections although they are in custom sections. So those that are missing would need to be ignored or added as a label with the correct width and height as a placeholder.

in Beta10 you can import a .scx file and use it in a custom section.

You could write a script that does them all, creating .scp files just by calling the convert script for each file in a directory.

In a custom section you can call a custom section proc e.g newCustomForm("scxname", "objname") that does.

// if &scxname.scp does not exist convert it from the scx first
set classlib to &scxname additive
m_&objname = createObject(objname)
return m_&objname

The form should now be contained inside the custom section.

This is also the case with .vcx files. Same principle.