Keep it simple! In a program you can use SELECTINDEX and from a command line use SELECT with the SAVING UNIQUE keywords.
Jerry Banker > -----Original Message----- > From: Scott Ballinger [mailto:[EMAIL PROTECTED] > Sent: Friday, March 14, 2008 9:22 AM > To: u2-users@listserver.u2ug.org > Subject: Re: [U2] Indexes > > There is no function like the T correlative to translate to an indexed > file > from a dict item, so you will need to do in BASIC as an I-type. The > command > is BSCAN, e,g. > > BSCAN BVAL,ID.LIST FROM FV,ID USING FIELDNAME ELSE BVAL = "" > > ID.LIST contains an AM delimited list of keys to records in file FV > than > "match" ID in FIELDNAME. > BVAL is the value of the indexed attribute that matches ID. If there > was no > match, then BVAL will be the next indexed value past ID, so I always > test if > BVAL = ID. > FV is the open file variable to the indexed file. > ID is the value you are searching for in the indexed FIELDNAME. > FIELDNAME is the name of the indexed fields in FV (e.g. CREATE.INDEX > MYFILE > FIELDNAME). > > A "BY SEQ" clause is optional, SEQ is either "A" or "D" for ascending > or > descending, (ascending is the default). > > See HELP BASIC BSCAN > > I usually loop on BSCAN until BVAL NE ID. I am not sure if that is > always > necessary. > > I use I-types that incorporate BSCAN to return values from indexed > files all > the time. It works great. > > /Scott Ballinger > Pareto Corporation > Edmonds WA USA > 206 713 6006 > > > On Fri, Mar 14, 2008 at 3:03 AM, Dennis Bartlett > <[EMAIL PROTECTED]> > wrote: > > > My dumb question for the day (just cant remember how to... and the > > manual's > > example is too simplistic...) > > > > How do I programmatically get an index value out, > > eg > > I have a STOCK file, and a REPAIRS file. Whoever designed this needs > their > > head read, but the repairs file only has the stock code as a > reference in > > the record. I have indexed the repair file on stock code, and need to > > create > > a report on the stock file of how many items are under repair. > > > > 1. UniverseBASIC code? > > > > 2. is this possible from an Itype? > > ------- > > u2-users mailing list > > u2-users@listserver.u2ug.org > > To unsubscribe please visit http://listserver.u2ug.org/ > ------- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/