diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java index 3eaae7c..d366626 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java @@ -20,7 +20,7 @@ public class Axel { cols=Integer.parseInt(kb.nextLine()); Spreadsheet spr=new Spreadsheet(rows,cols); //spr.put("A3", "3"); - spr.put("A2", "2"); + //spr.put("A2", "2"); spr.put("A1","=19+4"); spr.put("B9", "=41+A2"); spr.put("J5", "=7*6"); diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index 847bed2..121d67d 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -264,6 +264,8 @@ public class Spreadsheet { while (m.find()) { // m.find() must always be used before m.group() String s = m.group(); if(!s.isEmpty()) { + if((int)s.charAt(0)>=(int)'A'&&(int)s.charAt(0)<=(int)'Z' && cells[(Integer.parseInt(s.substring(1)))-1][(int)s.charAt(0)-(int)'A'].isEmpty()) + continue; if(first && (int)s.charAt(0)>=(int)'A'&&(int)s.charAt(0)<=(int)'Z') { res=Integer.parseInt(cells[(Integer.parseInt(s.substring(1)))-1][(int)s.charAt(0)-(int)-'A'].getValue()); first=false;