Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the CommaIO and Comma7IO classes?

Tags:

axapta

There is no documentation in the help file as to the purpose of the Comma7IO class, just that it extends the CommaIO class.

What is the difference?

like image 288
William Mioch Avatar asked Jan 27 '26 22:01

William Mioch


2 Answers

To support read and write of different formats of external files, MorphX features a range of different Io classes; CommaIo for comma separated files, Comma7Io for comma separated 7 bit files, BinaryIo for binary files and AsciiIo for plain text files.

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

like image 67
William Mioch Avatar answered Jan 30 '26 18:01

William Mioch


Run this job

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();
}

and check the content of the file: "ABCDEFG~\300\301\302\303\304\305\306\307\310\311\312\313~HIJKLMNOP". As you see, 8-bit characters have been replaced with their octal codes.

If you replace io = new Comma7Io(filename, mode); with io = new CommaIo(filename, mode); the original string will be written to the file: "ABCDEFG~ÀÁÂÃÄÅÆÇÈÉÊË~HIJKLMNOP".

like image 29
10p Avatar answered Jan 30 '26 19:01

10p



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!