首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CommaIO类和Comma7IO类有什么不同?

CommaIO类和Comma7IO类有什么不同?
EN

Stack Overflow用户
提问于 2011-06-06 08:34:48
回答 2查看 1.9K关注 0票数 3

帮助文件中没有关于Comma7IO类用途的文档,只说明它扩展了CommaIO类。

有什么关系?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-06-07 08:47:47

为了支持不同格式的外部文件的读写,MorphX提供了一系列不同的Io类;CommaIo用于逗号分隔的文件,Comma7Io用于逗号分隔的7位文件,BinaryIo用于二进制文件,AsciiIo用于纯文本文件。

From this link: RE: [Axapta-Knowledge-Village] Somthing cool - IO

票数 2
EN

Stack Overflow用户

发布于 2011-06-07 20:32:10

运行此作业

代码语言:javascript
复制
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“。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6246893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档