static void fileAccessTest(Args _args)
{
CommaIO commaIO;
int row;
Container c;
FileIOPermission fileIOPermission;
int recCountNotExist;
boolean errorlog;
Dialog dialog;
DialogField dialogField;
FilenameOpen filename;
;
dialog = new Dialog("Test version of File reader");
dialogField = dialog.addFieldValue(extendedTypeStr(FilenameOpen), "", "File to access");
if (dialog.run())
filename = dialogField.value();
else
throw error("No filename");
fileIOPermission = new FileIOPermission(filename,'r');
fileIOPermission.assert();
//BP Deviation documented
commaIO = new CommaIO(filename, 'r');
if (commaIO != null)
{
if (commaIO.status())
{
throw error("@SYS52680");
}
commaIO.inRecordDelimiter('\r\n');
commaIO.inFieldDelimiter(',');
}
else
{
throw error("@SYS52680");
}
c = conNull();
if (commaIO)
{
if (commaIO.status() == IO_Status::OK)
{
if (row==0)
{
c = commaIO.read();
}
info(con2Str(c));
row++;
c = commaIO.read();
info(con2Str(c));
}
}
}
{
CommaIO commaIO;
int row;
Container c;
FileIOPermission fileIOPermission;
int recCountNotExist;
boolean errorlog;
Dialog dialog;
DialogField dialogField;
FilenameOpen filename;
;
dialog = new Dialog("Test version of File reader");
dialogField = dialog.addFieldValue(extendedTypeStr(FilenameOpen), "", "File to access");
if (dialog.run())
filename = dialogField.value();
else
throw error("No filename");
fileIOPermission = new FileIOPermission(filename,'r');
fileIOPermission.assert();
//BP Deviation documented
commaIO = new CommaIO(filename, 'r');
if (commaIO != null)
{
if (commaIO.status())
{
throw error("@SYS52680");
}
commaIO.inRecordDelimiter('\r\n');
commaIO.inFieldDelimiter(',');
}
else
{
throw error("@SYS52680");
}
c = conNull();
if (commaIO)
{
if (commaIO.status() == IO_Status::OK)
{
if (row==0)
{
c = commaIO.read();
}
info(con2Str(c));
row++;
c = commaIO.read();
info(con2Str(c));
}
}
}
No comments:
Post a Comment
Thanks for visiting my blog,
I will reply for your comment within 48 hours.
Thanks,
krishna.