Tuesday 13 May 2014

Pack and Unpack

Pack and Unpack


ClassDeclaration

class Tutorial_RunbaseBatch extends RunBaseBatch
{
    // Packed variables
    TransDate       transDate;
    CustAccount     custAccount;

    // Dialog fields
    DialogField     dlgCustAccount;
    DialogField     dlgTransDate;

    #define.CurrentVersion(1)
    #define.Version1(1)
    #localmacro.CurrentList
        transDate,
        custAccount
    #endmacro
}

Dialog


public Object dialog()
{
    DialogRunbase       dialog = super();
    #resAppl
;
    dialog.addImage(#ImageEmployee);
    dialog.addInfoImage();
    dlgTransDate = dialog.addFieldValue(typeid(TransDate),transDate);

    dialog.addTabPage("@SYS76580");
    dlgCustAccount = dialog.addFieldValue(typeid(CustAccount),custAccount);

    return dialog;
}

Pack

public container pack()
{
    return [#CurrentVersion,#CurrentList];
}



Unpack

public boolean unpack(container packedClass)
{
    Version version = RunBase::getVersion(packedClass);
;
    switch (version)
    {
        case #CurrentVersion:
            [version,#CurrentList] = packedClass;
            break;
        default:
            return false;
    }

    return true;
}

Main


static void main(Args args)
{
    Tutorial_RunbaseBatch    tutorial_RunBase;
 
;
    tutorial_RunBase = Tutorial_RunbaseBatch::construct();

    if (tutorial_RunBase.prompt())
    {
        tutorial_RunBase.run();
    }

No comments:

Post a Comment

SQL/SSRS Interview questions I thought of blogging some SQL/SSRS interview questions.

Below are some. I will add more, when I complete the compilation 1. What is OLTP(Online Transaction Processing)? OLTP stands ...