"this" keyword undefined in a class method
I have run into an interesting problem. I have a heavily ODT based project in which I dynamically build a test case object on the fly. One of the properties of the object is an array of class objects. Below is a sample (hard coded for illustration purposes).
// Now, populate the test case with the printer object data and install the drivers.
for (var nPrinterObject in rgPrinterObjects)
{
var rgSplitPrinterObject = rgPrinterObjects[nPrinterObject].split("|");
oTestCase.rgPrinterObjects.AddItemOfClassType("clsPrinterObject");
oTestCase.rgPrinterObjects(nPrinterObject).sDriverModel = rgSplitPrinterObject[0];
oTestCase.rgPrinterObjects(nPrinterObject).sInfPath = rgSplitPrinterObject[1];
oTestCase.rgPrinterObjects(nPrinterObject).sPortType = rgSplitPrinterObject[2];
oTestCase.rgPrinterObjects(nPrinterObject).sPortAddress = rgSplitPrinterObject[3];
oTestCase.rgPrinterObjects(nPrinterObject).sPrinterName = rgSplitPrinterObject[4];
oTestCase.rgPrinterObjects(nPrinterObject).Install();
}
If I break into the debugger, all of the properties of Item0 in my array are set (sDriverModel, sInfPath, etc...). If I break into the code in the Install() method of clsPrinterObject, the "this" keyword is undefined. According to the documentation, what I am doing should work and I am unfortunately blocked from progressing in the implementation until I can get past this.