CommaIo.writeExp Method [AX 2012]
Writes the content of a container to a file.
This example uses a CommaIO object to read from the example file.
{
container c;
CommaIo myfile;
FileIoPermission perm;
#define.ExampleFile(@"c:\myfile.txt")
#define.ExampleOpenMode("w")
// Set code access permission to help protect the use
// of CommaIO.new
perm = new FileIoPermission(#ExampleFile, #ExampleOpenMode);
perm.assert();
myfile = new CommaIo(#ExampleFile, #ExampleOpenMode);
// Assign the entries in the container according to record layout.
c = [1,"MyText",1.324,"Last field"];
// Write this record according to file format
// (record/field delimiters).
myfile.writeExp(c);
// Close the code access permission.
CodeAccessPermission::revertAssert();
}
Community Additions
ADD
Show: