#113 OTA LoadEX/Load/SaveEx/Save

1.17
open
nobody
Jacob COM (35)
5
2014-08-04
2012-12-29
BrianDrian
No

These calls dont work. Strangely if on the load call you reverse the order of the parameters it dumps everything from the database. Otherwise there are exceptions about wrong typing. I tried both the invoke and the call using an args string[] list. plus lots of other combinations using direct strings combinations etc etc. I'm guessing there are issues with the Save and SaveEX but i'm not brave enough to give it a go.

heres the code. running jacob 1.17 on XP with J7.

public static void dumpField (Dispatch testFactory, String filter, String onField) {

// for example test factory, list of items = list of tests
Dispatch listOfItems = Dispatch.call(testFactory, "NewList", "").toDispatch();
Dispatch fieldsInFactory = Dispatch.get (testFactory, "Fields").toDispatch();
int count = 0;
int fieldCount = Dispatch.get(fieldsInFactory, "Count").changeType(Variant.VariantInt).getInt();
int testCount = Dispatch.get(listOfItems, "Count").changeType(Variant.VariantInt).getInt();
for (int i = 1; i<= testCount; i++) {
Dispatch testobject = Dispatch.call(listOfItems, "Item", i).toDispatch();

String value = dispatchQCFieldQuery (testobject, onField);

if (value.equalsIgnoreCase(filter)) {
logger.info("Field Name : " + onField + "Field Value : " + value + " : " +
" : " +dispatchQCFieldQuery (testobject, "TS_NAME") +
" : " +dispatchQCFieldQuery (testobject, "TS_SUBjECT") +
" : " +dispatchQCFieldQuery (testobject, "TS_USER_03") +
" : " +dispatchQCFieldQuery (testobject, "TS_USER_04") +
" : " +dispatchQCFieldQuery (testobject, "TS_TYPE") +
" : " +count++);

Variant pStr = new Variant();
pStr.putString("null");

Variant paramVal = new Variant();
paramVal.putString("");
Variant pBool = new Variant();
pBool.putBoolean(true);
Dispatch storageObj = Dispatch.get(testobject, "ExtendedStorage").toDispatch();
Dispatch.put(storageObj, "ClientPath","D:\\QC");

// This sort of does something
// Variant[] arg = { paramVal, pBool };

Variant[] arg = {paramVal, pBool,new Variant(null),pBool};

// Dispatch.call (storageObj, "LoadEx", arg).toDispatch();
// Variant[] args = {new Variant(""), pBool, paramValue, pBool};

Variant[] args = {new Variant(""), pBool, paramVal, pBool};
Variant v = Dispatch.invoke(storageObj,
"Load",
Dispatch.Put,
new Object[] {paramVal, new Variant (true)},
new int[1]);

break;
}
}
}

Discussion


Log in to post a comment.