private String useRbondVariables(String s, int frame) {
		int n = model.getRBondCount();
		if (n <= 0)
			return s;
		int lb = s.indexOf("%rbond[");
		int rb = s.indexOf("].", lb);
		int lb0 = -1;
		String v;
		int i;
		RBond bond;
		while (lb != -1 && rb != -1) {
			v = s.substring(lb + 7, rb);
			double x = parseMathExpression(v);
			if (Double.isNaN(x))
				break;
			i = (int) Math.round(x);
			if (i < 0 || i >= n) {
				out(ScriptEvent.FAILED, "Radial bond " + i + " does not exist.");
				break;
			}
			v = escapeMetaCharacters(v);
			bond = model.getRBond(i);
			s = replaceAll(s, "%rbond\\[" + v + "\\]\\.length", bond.getLength(frame));
			s = replaceAll(s, "%rbond\\[" + v + "\\]\\.strength", bond.getStrength());
			s = replaceAll(s, "%rbond\\[" + v + "\\]\\.bondlength", bond.getLength());
			s = replaceAll(s, "%rbond\\[" + v + "\\]\\.atom1", bond.atom1.getIndex());
			s = replaceAll(s, "%rbond\\[" + v + "\\]\\.atom2", bond.atom2.getIndex());
			lb0 = lb;
			lb = s.indexOf("%rbond[");
			if (lb0 == lb) // infinite loop
				break;
			rb = s.indexOf("].", lb);
		}
		return s;
	}