Export (0) Print
Expand All

Args Class

The Args class is used to pass arguments such as a name, a caller, and parameters between application objects.


class Args extends Object

Called

Method

Description

arrIdx

caller

Gets or sets the instance of the object that created this instance of the Args class.

cancelTimeOut

Cancels a previous method call to the Object.setTimeOut Method. (Inherited from Object.)

dataset

Gets the table ID of the table in which the caller object is working.

designName

Gets or sets a string that indicates a design on a report or form.

equal

Determines whether the specified object is equal to the current one. (Inherited from Object.)

extType

finalize

Removes the current instance of the Args class from memory.

getTimeOutTimerHandle

Returns the timer handle for the object. (Inherited from Object.)

handle

Retrieves the handle of the class of the object. (Inherited from Object.)

initialQuery

lookupField

Gets or sets the field ID in a table to use to look up a specified record.

lookupRecord

Finds a record in the specified table.

lookupValue

Gets or sets a string to use with the LookupField method to find a value in a field of a table.

menuItemName

Gets or sets the name of a menu item to use to start the application object.

menuItemType

Gets or sets the type of the menu item to use to start the called application object.

name

Gets and sets the name of the application object to call.

new

Overridden. Constructs an instance of this class, which is used to pass information to high-level classes such as FormRun and ReportRun.

notify

Releases the hold on an object that has called a wait method on this object. (Inherited from Object.)

notifyAll

Releases a lock on the object that was issued by a wait method on this object. (Inherited from Object.)

object

Gets and sets the application name of the object of which to open a new instance.

objectOnServer

Determines whether the object is on a server. (Inherited from Object.)

owner

Returns the instance that owns the object. (Inherited from Object.)

parentWnd

parm

Gets or sets a string that specifies miscellaneous information for the called object.

parmEnum

Gets or sets the enumeration value of the enumeration type that is specified in the parmEnumType method.

parmEnumType

Gets or sets the ID value of any enumeration type.

parmObject

Gets or sets an instance of any object to pass to the called object.

record

Gets and sets the record from the table on which the caller object is working.

refField

selectField

setTimeOut

Sets up the scheduled execution of a specified method. (Inherited from Object.)

setupArgs

toString

Overridden. Returns a string representation of an instance of the Args Class.

usageCount

Returns the current number of references (the value of the reference counter) that the object has. (Inherited from Object.)

wait

Pauses a process. (Inherited from Object.)

xml

Returns an XML string that represents the current object. (Inherited from Object.)

Forms, reports, and queries all use this class as the first argument in the constructor. The preferred way to use this class is to construct an Args object, supply a name-string, and then pass the Args object to the forms constructor or a ClassFactory Class method.

There are four methods that can be used to pass extra information to the new class:

If you need to refer to the Args object passed to a class, it can be reached using the args method of that class.

The instance of the Args class that is sent from the caller can be created automatically by the kernel or explicitly by the caller. When the caller uses a menu item to call an object, an instance of the Args class is created by the kernel code. The menu item name will be set to the name of the menu item used. If the menu item has values for the Parameters, EnumParameter, or EnumTypeParameter properties set, the kernel will set the values of the corresponding Parm, ParmEnum, or ParmEnumType properties for this instance of the Args class.

The following example demonstrates how to explicitly create an instance of the Args class:

public static void main(Args args)
{
    BankPaymCancel  bankPaymCancel;
    Args    localArgs = new Args();
    ;
 
    // Check the instance of the args class passed into this main method.
    if (args && args.record())
    {
        bankPaymCancel = BankPaymCancel::newBankPaymCancel(args.record());
 
        if (bankPaymCancel.prompt())
        {
//The following lines set the caller and record methods on the instance of the localArgs class.
            localArgs.caller(bankPaymCancel);
            localArgs.record(args.record());
            BankPaymCancel::serverRun(localArgs);
        }
    }
}

The following code example consumes an instance of the Args class:

public void  init()
{
    super();
 
    //Check to see if the parmEnumType method has been set.
    if (element.args().parmEnumType())
    {
        //Get the enum value specified in the parmEnum method.
        salesUpdate = element.args().parmEnum();
        selectionUpdate.selection(salesUpdate);
    }
 
    //Get the TableId value of the table record passed in the record method.
    switch(element.args().record().TableId)
    {
        case tablenum(SalesTable)       :
            break;
 
        case tablenum(SalesParmTable)   :
            salesParmTable= element.args().record();
            selectionUpdate.allowEdit(false);
            selectionUpdate.skip(true);
            selectionUpdate.visible(false);
            groupSelectionUpdate.visible(true);
            break;
 
        case tablenum(SalesBasket)   :
            salesBasket= element.args().record();
            selectionUpdate.allowEdit(false);
            selectionUpdate.skip(true);
            selectionUpdate.visible(false);
            groupSelectionUpdate.visible(true);
            break;
    }
}

Community Additions

ADD
Show:
© 2014 Microsoft