Hi

I tried to write some code to convert 2 columns of data dictionary (“Fieldname” 
“Fieldtype” definitions) from iWork’s “Numbers” spreadsheet straight to a 4D 
structure but unfortunately it doesn’t work. The code simply captures a piece 
of text from the clipboard and reformats it in 4D’s XML format that it uses for 
copying a bunch of fields from one table to another.

i.e. converts this…

*****************************************************************************************
id    L
name   T
height   L
weight   R
*****************************************************************************************


…to this…


*****************************************************************************************
<?xml version="1" encoding="UTF-8"?>
<!DOCTYPE base SYSTEM "http://www.4d.com/dtd/2007/base.dtd";>
<base>
        <table name="FieldContainer" uuid="F4DD0808CB874DC295D1B8EA220C7BD8">
                <field name=“id" uuid="D79C4487C2B342C383A882D6B3DEE91F" 
type="9" never_null="true">
                <field_extra/>
                </field>
        </table>
</base>
*****************************************************************************************

I think the reason it doesn’t work might be because 4D actually checks the UUID 
and fieldname that they correspond to another table in the database and that 
you are doing a genuine “copy” operation. Maybe it doesn’t allow you to 
parachute new structure definitions in from the clipboard.

If I can get something like this to work I can save myself quite a lot of time. 
Ideally, the incremental “paste” approach to adding fields to a table would be 
preferable to creating the full blown structure export format.

Is anybody doing this type of thing already that would care to share some tips ?

Regards

Peter
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to