Path: utzoo!attcan!utgpu!watmath!iuvax!silver!tsui From: tsui@silver.bacs.indiana.edu Newsgroups: comp.databases Subject: foxbase problem, need help Message-ID: <20900010@silver> Date: 28 Jul 89 18:02:00 GMT Organization: Indiana University CSCI, Bloomington Lines: 48 Nf-ID: #N:silver:20900010:000:1253 Nf-From: silver.bacs.indiana.edu!tsui Jul 28 13:02:00 1989 Hello everybody! I have the following problem which I can't solve and would like to hear solutions from you. I have to locate records according to arbitrary number of fields in the database, the database is decomposed into several files to avoid redundency. The condition of the fields depends on the user's input. What I did is to set up a string varible to construct a condition and then use ¯o to do the search, so it goes like this: && this assumes the database is in one file && otherewise we have to construct condition(J), an array to hold conditions use aBatabase DO initialize && initialize condition,I Do while (I <=MAXFIELDS) @somewhere get fields(i) valid somecondition if (userinput is empty for field(i)) then i = i+1 loop else condition = condition+"("+field(i)+")"+"="+userinput(i) endif i = i+1 Enddo Locate for &condition ... Everything looks fine... but sometimes it crashes with a message: line too long. The problem is that the user input can be very long, something like a string of length 60, and the MAXFIELDS is upto 12... Now how can I get around this problem? BACKGROUND: FOXBASE+ 2.01 (?) single user, runing on an AT. Thanks! --yufeng tsui@silver.bacs.indiana.ede