帮助文件中没有关于Comma7IO类用途的文档,只说明它扩展了CommaIO类。
有什么关系?
发布于 2011-06-07 08:47:47
为了支持不同格式的外部文件的读写,MorphX提供了一系列不同的Io类;CommaIo用于逗号分隔的文件,Comma7Io用于逗号分隔的7位文件,BinaryIo用于二进制文件,AsciiIo用于纯文本文件。
From this link: RE: [Axapta-Knowledge-Village] Somthing cool - IO
发布于 2011-06-07 20:32:10
运行此作业
static void TestComma7Io(Args _args)
{
str testString = 'ABCDEFG~ÀÁÂÃÄÅÆÇÈÉÊË~HIJKLMNOP';
str filename = @"C:\TMP\test1.txt";
str mode = 'W';
Io io;
container con;
FileIoPermission perm;
;
perm = new FileIoPermission(filename, mode);
if (!perm)
return;
perm.assert();
// BP deviation documented.
io = new Comma7Io(filename, mode);
if (io)
io.write(testString);
CodeAccessPermission::revertAssert();
}并检查文件的内容:"ABCDEFG~\300\301\302\303\304\305\306\307\310\311\312\313~HIJKLMNOP".如您所见,8位字符已被其octal codes替换。
如果您将io = new Comma7Io(filename, mode);替换为io = new CommaIo(filename, mode);,则原始字符串将写入文件:“ABCDEFG~#”~HIJKLMNOP“。
https://stackoverflow.com/questions/6246893
复制相似问题