Re: Import data in 4D format using XML

2018-05-01 Thread Lee Hinde via 4D_Tech
http://doc.4d.com/4Dv16R6/4D/16-R6.1660/Not-for-32-bit-versions_3546700.999-857020.en.html
 


Just swap the url to the language you want.

> On May 1, 2018, at 7:03 AM, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> The link you have provided, unfortunately, is in Japanese ;-)

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

Re: Import data in 4D format using XML

2018-05-01 Thread Two Way Communications via 4D_Tech
Hi Keisuke,

The link you have provided, unfortunately, is in Japanese ;-)

Are we talking about the same command? Because in the v16R6 documentation, it 
says:

If you pass an empty string to fileName 
, IMPORT 
DATA displays the standard save file dialog box, allowing the user to define 
the name, type, and location of the import file. Once the dialog box has been 
accepted, the Document system variable contains the access path and the name of 
the file. If the user clicks Cancel, the execution of the command is stopped 
and the OK system variable is set to 0.

Turns out this is a bug in the 64bit versions of 4D (I have tested with 4D 
v16R5 and v16R6). It DOES work in 32bit versions; I have tested with 15.5.

The workaround is:

$doc:=Open document("") 
If (ok=1)
CLOSE DOCUMENT($doc)
IMPORT DATA(document;$ref)
End if 


Regards,

Rudy Mortier
Two Way Communications bvba 



> On 1 May 2018, at 00:47, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> the docs reads:
> 
> When you pass this parameter, the import is carried out directly, without any 
> user intervention (unless you use the * option, see below).
> 
> http://doc.4d.com/4Dv16R6/4D/16-R6.1660/Not-for-32-bit-versions_3546700.999-857020.ja.html
> 
>> 2018/04/29 20:39、Two Way Communications via 4D_Tech <4d_tech@lists.4d.com> 
>> のメール:
>> However, If I use it in 4D v16R5,  the ‘Import Data’ command does not open 
>> the file dialog, but returns ok=0?
>> Has anything changed?
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: Import data in 4D format using XML

2018-04-30 Thread Keisuke Miyako via 4D_Tech
the docs reads:

When you pass this parameter, the import is carried out directly, without any 
user intervention (unless you use the * option, see below).

http://doc.4d.com/4Dv16R6/4D/16-R6.1660/Not-for-32-bit-versions_3546700.999-857020.ja.html

> 2018/04/29 20:39、Two Way Communications via 4D_Tech <4d_tech@lists.4d.com> 
> のメール:
> However, If I use it in 4D v16R5,  the ‘Import Data’ command does not open 
> the file dialog, but returns ok=0?
> Has anything changed?




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

Import data in 4D format using XML

2018-04-29 Thread Two Way Communications via 4D_Tech
Hi all,

In 4D v15.5, this code is working flawlessly:

$ref:=DOM Create XML Ref("settings-import-export")
DOM SET XML 
ATTRIBUTE($ref;"table_no";$Current_LB_table;"format";"4D";"char_display_format";"decimal";"platform";"automatic";"import_mode";"create")
  //
  // Definition of fields to export
For ($j;1;Get last field number($Current_LB_table))
If (Is field number valid($Current_LB_table;$j))
$elt:=DOM Create XML 
element($ref;"field";"table_no";$Current_LB_table;"field_no";$j)
End if 
End for 

IMPORT DATA("";$ref)


However, If I use it in 4D v16R5,  the ‘Import Data’ command does not open the 
file dialog, but returns ok=0?

Has anything changed?


Regards,

Rudy Mortier
Two Way Communications bvba 



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