import waba.sys.*; //import waba.ui.*; //import waba.fx.*; import waba.util.*; import waba.io.*; /** Creating catalogs in SuperWaba - the Definitive Guide. created by guich@20010217 */ public class ReaderQuestion { static final int RECORD_LENGTH = 70; // 3 question lines, 3 answers times 10 private Catalog cat; private ResizeStream rs; private DataStream ds; private Vector v; public ReaderQuestion(String title) { openCatalog(title); v = new Vector(70); } /** create and open the catalog */ public boolean openCatalog(String title) { cat = new Catalog(title, Catalog.READ_ONLY); // create the streams rs = new ResizeStream(cat,512); ds = new DataStream(rs); return true; } /** read all records in catalog */ public Vector readRecords() { for (int i = 0; i < RECORD_LENGTH; i++) { cat.setRecordPos(i); String key = ds.readString(); v.add(key); } ds.close(); return v; } }