static void ExecuteCodeFromFile(Args _args)
{
#File
AsciiIo asciiIo = new AsciiIo("c:\\findCustomer.xpp",#io_read);
XppCompiler xppCompiler = new XppCompiler();
Source source;
str line;
CustTable custTable;
;
if (asciiIo)
{
asciiIo.inFieldDelimiter(#delimiterEnter);
[line] = asciiIo.read();
while (asciiIo.status() == IO_Status::Ok)
{
source += #delimiterEnter;
source += line;
[line] = asciiIo.read();
}
if (!xppCompiler.compile(source))
error (xppCompiler.errorText());
custTable = runbuf(source,'4000');
print CustTable.Name;
}
else
print "Could not open file";
pause;
}
/*
The external file c:\temp\findCustomer.xpp:
CustTable findCustomer(CustAccount _accountNum)
{
return CustTable::find(_accountNum);
}
*/
No comments:
Post a Comment