File Handling in DAX 2012

Writing to a Text File

static void textFileWrite(Args _args)

{

TextBuffer tb = new TextBuffer();

;

tb.appendText(“Hello World!”);

tb.appendText(“nWelcome to MIT”);

tb.appendText(“nHyderabad”);

tb.toFile(“c:\Sample.txt”);

}

Reading from a Text File

static void textFileRead(Args _args)

{

TextBuffer tb = new TextBuffer();

;

if(WinApi::fileExists(“c:\Sample.txt”))

{

tb.fromFile(“c:\Sample.txt”);

info(tb.getText());

}

else

{

info(“No file exists”);

}

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: