Datapool iterations - using the next record
I don't know why I am having such a "Brain Fart" on this but I cannot get my code to work.
Here is my scenario -
Suppose I have a datapool of names that already exists and is attached to the script.
Now the functionality works like this. I can search for a name in the application and I get two results back - either that the name exists in the application or that the name does not. I am pulling names off of my datapool that is attached to the script.
This is my dilemna: If I get a result back that the name exists in the application, then I want the datapool to simply move onto the next name in the list and start the search over. No further action is necessary. If the name does exist, then continue with the action of adding the name into the app.
I cannot get the dpNext() method to work. What would be your suggestion?
I probably could have asked this question more gracefully, but like I said, I am having a "Brain Fart".
Re: Datapool iterations - using the next record
You can achieve this as follows:
java.io.File dpFile = new java.io.File((String)getOption(IOptionName.DATASTO RE),
IDatapool dp = dpFactory().load(dpFile, true);
IDatapoolIterator dpIter = dpFactory().open(dp, null); // use default iterator class
dpIter.dpInitialize(dp); // use default equivalence class
while ( !dpIter.dpDone() )
// Insert actions using dpIter based references to the datapool
// Check if dtIter.dpString("Name") exists in the application
// If exists
// Do Nothing
// Do your action
} //End of while loop