12. März 2010 19:03
Writing Data to an OutStream
Here we want to create an OutStream to stream data out of a BLOB field for storage in an external object.
recEmployee."No." := '5555';
// We now load the XML DOM, which will pass the OutStream to the external object.
XMLDom.load('SomeData.xml');
recEmployee.Picture.CREATEOUTSTREAM(StreamOutObj);
StreamOutObj.WRITE('Ver. 1.00');
// Write version.
StreamOutObj.WRITE('Company Ltd.');
// Write (c).
StreamOutObj.WRITE(TODAY);
// Write a DATE (today).
// The following information will be written as plain text.
StreamOutObj.WRITETEXT('Dear Customer,');
StreamOutObj.WRITETEXT();
// This inserts a carriage return and a new line.
StreamOutObj.WRITETEXT('We would like to thank you for your help.');
StreamOutObj.WRITETEXT();
StreamOutObj.WRITETEXT('We hope to see you soon!');
StreamOutObj.WRITETEXT();
XMLDom.save(StreamOutObj);
recEmployee.MODIFY();
RecItem.Picture.CREATEOUTSTREAM(StreamOutObj);
StreamOutObj.WRITE('123');
RecItem.MODIFY();
15. März 2010 12:38
XMLDom.load('SomeData.xml');
recEmployee.Picture.CREATEOUTSTREAM(StreamOutObj);
StreamOutObj.WRITE(TODAY);
XMLDom.save(StreamOutObj);
BLOB.EXPORT('XMLdata.xml');
BLOB.IMPORT('XMLData.xml');
z.B. reEmployee.Picture.Export('SomeData.xml');
15. März 2010 18:37
IF ISCLEAR(XMLDom) THEN CREATE(XMLDom);
XMLDom.load('D:\SomeData.xml');
RecItem.Picture.CREATEOUTSTREAM(StreamOutObj);
StreamOutObj.WRITE('This is a test');
XMLDom.save(StreamOutObj);
SOMEDATA.XML
<?xml version="1.0" encoding="UTF-8"?>
<note>
<body>Test</body>
</note>
RecItem.Picture.EXPORT('D:\Neu.xml');
NEU.XML
This is a test <?xml version="1.0" encoding="UTF-8"?>
<note>
<body>Test</body>
</note>