Thursday, May 27, 2010

create text file in axapta


Use BinData class to create a simple text file using axapta.
Firstly create an instance of a TextBuffer class and append text using textBuffer.AppendText. Pass it to binData what you want to write using binData.setStrData and then write using binData.saveFile.

Sample

BinData binData;
TextBuffer textBuffer;

textBuffer = new TextBuffer();
textBuffer.setText('This is a demo program');

binData = new BinData();
binData.setStrData(textBuffer.getText());
binData.saveFile(@"c:\sohail.txt");

Demo is attached here.

No comments:

Post a Comment