Hi Christian,

please have a closer look at my last example. As you can see the
statement is embedded into a complete method. In general the first
argument of runbunf() is a valid X++ method source followed by
additional arguments representing the parameterlist of this method.
The return code of runbuf() represents the return code of the method
being executed. I agree with Anders to check the source with
xppcompiler class before execution. A shorter example comes here:


static void Job29(Args _args)
{
    custtable   ct;
    str         Stmt = "select Custtable";
    str         Proc;
    xppCompiler xppC = new xppCompiler();


    Proc = "Common f() {CustTable CustTable; " + // Wrapping m.
           Stmt +                                // STATEMENT
           "; return Custtable;}";               // Wrapping m.

    if(xppC.Compile(Proc))
    {
        ct = runbuf(Proc);
        print ct.AccountNum;
    }
    pause;
}


Another runbuf() example can be found in sources of table browser.
Please have a look at:
\Forms\SysTableBrowser\Designs\Design\Group:SqlGrp
\Group:Group\Button:ExecuteSql\Methods\clicked

Regards,
Onno







Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to