JoltDelete Function

Action

Deletes an item of a Jolt object attribute. If an attribute consists of only one item, the complete attribute is deleted. This function is provided to delete items from both JoltSessionAttributes and JoltRemoteService object attributes.

Include file

Jolt.bdh

Syntax

JoltDelete( in hRemoteService : number,
            in sAttribute     : string,
            in nOccurrence    : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hRemoteService Handle to a JoltRemoteService object that was created with JoltRemoteServiceNew
nAttribute Name of the attribute that is to be modified
nOccurrence

Index of the item that is to be deleted (optional). The index of an attribute’s first item is 1 (not 0).

If this parameter is omitted, the attribute’s first item is deleted

Example

var
  hSession, hSessionAttr, hRemoteService: number;
dcltrans
  transaction TInit
  begin
    JavaSetOption(JAVA_VERSION, JAVA_V11);
    JavaSetOption(JAVA_HOME, "c:/jdk1.1.7");
    JavaSetOption(JAVA_CLASSPATH, "c:/jdk1.1.7");
    JoltInit();
    hSessionAttr := JoltSessionAttributesNew();
    JoltSetString(hSessionAttr, APPADDRESS, "//lab:8000");
    hSession := JoltSessionNew(hSessionAttr, "", "ATM", "", "");
    hRemoteService := JoltRemoteServiceNew("SUM", hSession);
  end TInit; 

  transaction TMain
  var
    nSum: number;
  begin
    JoltSetInt(hRemoteService, "IVALUE", 23, ADD_VALUE);
    JoltSetInt(hRemoteService, "IVALUE", 11, ADD_VALUE);
    JoltSetInt(hRemoteService, "IVALUE", 38, ADD_VALUE);
    JoltDelete(hRemoteService, "IVALUE", 2);
    JoltCall(hRemoteService);
    nSum := JoltGetInt(hRemoteService, "RESULT", 0);
    writeln(nSum);
  end TMain;

  transaction TShutdown
  begin
    JoltEndSession(hSession);
    JoltFreeObject(hRemoteService);
    JoltFreeObject(hSession);
    JoltFreeObject(hSessionAttr);
  end TShutdown;

See also

Java: bea.jolt.JoltSessionAttributes class, bea.jolt.JoltRemoteService class