tsui@silver.bacs.indiana.edu (07/29/89)
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
englandr@phoenix.Princeton.EDU (Scott Englander) (07/29/89)
It's hard to tell exactly what you're doing, and what i know is based on fairly little experience with the Mac version 2.0 of Fox, but here's my $0.02. Shortening line length of conditions: I have run into this on the Mac; the limit is 255 characters. On thing i discovered about expressions is that spaces are absolutely extraneous. So strip them, if you haven't already. Also, why do you need the ()s around the field names? -- - Scott
tsui@silver.bacs.indiana.edu (07/29/89)
/* Written 9:04 pm Jul 28, 1989 by englandr@phoenix.Princeton.EDU in silver:comp.databases */ It's hard to tell exactly what you're doing, and what i know is based on fairly little experience with the Mac version 2.0 of Fox, but here's my $0.02. Shortening line length of conditions: I have run into this on the Mac; the limit is 255 characters. On thing i discovered about expressions is that spaces are absolutely extraneous. So strip them, if you haven't already. Also, why do you need the ()s around the field names? - Scott /* End of text from silver:comp.databases */ I have already striped the spaces. The reason why I put ()s there is that The users can put ! to stand for .NOT. For example: filed[2] input : !This is right then the code becomes: condition = condition + ".not."+.... Sorry I did not specify that. --yufeng
paul@csnz.co.nz (Paul Gillingwater) (08/04/89)
In article <20900010@silver> tsui@silver.bacs.indiana.edu writes: >Hello everybody! > I have to locate records according to arbitrary number of fields in the >database, the database is decomposed into several files to avoid redundency. >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... >FOXBASE+ 2.01 (?) single user, runing on an AT. >--yufeng >tsui@silver.bacs.indiana.ede I solved this problem for dBase III in London a few years ago. I still have the source, which I am happy to post to those who would like it. Basically what it does is build a customised procedure by outputting code to a text file, then executing the code. The procedure output by the program consists of a series of tests that cause it to exit with a status flag set to failed unless it gets past the last IF. Since you can't assume that any field is indexed you have to do a sequential search, then call the procedure for each record. I tried to solve it using the macro approach as well, but ran into the 255 byte command limitation problem, because of user input and an arbitrary number of fields available for searching. -- Paul Gillingwater, Computer Sciences of New Zealand Limited Bang: ..!uunet!dsiramd!csnz!paul Domain: paul@csnz.co.nz Call Magic Tower BBS V21/23/22/22bis 24 hrs +0064 4 767 326
tsui@silver.bacs.indiana.edu (08/05/89)
/* Written 5:56 pm Aug 3, 1989 by paul@csnz.co.nz in silver:comp.databases */ /* ---------- "foxbase problem, need help" ---------- */ I solved this problem for dBase III in London a few years ago. I still have the source, which I am happy to post to those who would like it. Basically what it does is build a customised procedure by outputting code to a text file, then executing the code. The procedure output by the program consists of a series of tests that cause it to exit with a status flag set to failed unless it gets past the last IF. Since you can't assume that any field is indexed you have to do a sequential search, then call the procedure for each record. ... -- Paul Gillingwater, Computer Sciences of New Zealand Limited Bang: ..!uunet!dsiramd!csnz!paul Domain: paul@csnz.co.nz Call Magic Tower BBS V21/23/22/22bis 24 hrs +0064 4 767 326 /* End of text from silver:comp.databases */ Please! Post it . I think lot of people will encounter this problem unless foxbase can eliminate its limitation. Thanks! --yufeng tsui@silver.bacs.indiana.edu
wangh@iris.ucdavis.edu (Hongtao Wang) (08/16/89)
Dose anybody know how to use the "lnprofor" for linking the profortran executable file and object file and a library in a VMS environment? My problem is: we created a profortran file , say test.pfo, which calls several subroutines in a user defined library, say named userlib.olb, after we get the object file test.obj, how should we do the "lnprofor" to create the executable file test.exe? (or, how do we "lnprofor" test.obj and an option file?) Your help is very much appreciated. Thanks.