// create a new Jmol window
String state = ids[p].getStructureState(s).getContent();
StringBuffer newFileLoc = null;
- if (state.indexOf("load") > -1)
+ int cp=0;
+ if ((cp=state.indexOf("load ")) > -1)
{
- newFileLoc = new StringBuffer(state.substring(0, state
- .indexOf("\"", state.indexOf("load")) + 1));
+ newFileLoc = new StringBuffer(state.substring(0, (cp=state
+ .indexOf("\"", cp+1)+1)));
newFileLoc.append(jpdb.getFile());
newFileLoc.append(state.substring(state.indexOf("\"",
- state.indexOf("load \"") + 6)));
+ cp+1)));
}
else
{