[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Btree.extract problems .... (AREV Specific) ==== === At 13 AUG 1999 01:31:50PM German Gonzalez wrote: === {{tag>"AREV Specific"}} I have problems with the subroutine Btree.extract, when taking several values with several indexes, this it sends an error. Example: search_val=TITULAR_NVO_XREF²GERMAN GONZALEZ²JORGE DIAZ²JUAN CARLOS':@FM:'SOLICITANTE_XREF²;GERMAN GONZALEZ²JORGE DIAZ²JUAN CARLOS':@FM:'TITULAR_ANT_XREF²;GERMAN GONZALEZ²JORGE DIAZ²JUAN CARLOS':@FM btree.extract(search.val, bdata, bdict, keys, option, flag) ' BTREE.EXTRACT' Line 2. B17 Subscript valued out of range. Line 2 ' BTREE.EXTRACT' broke because to run cheats error was encountered. ! But if the search.val value is search_val= 'TITULAR_NVO_XREF²GERMAN²JORGE²JUAN':@FM:'SOLICITANTE_XREF²;GERMAN²JORGE²JUAN':@FM:'TITULAR_ANT_XREF²;GERMAN²JORGE²JUAN':@FM or search.val is search_val=TITULAR_NVO_XREF²GERMAN GONZALEZ²JORGE DIAZ²JUAN CARLOS':@FM The routine works perfectly. Why this error does it happen? ---- === At 14 AUG 1999 02:05PM akaplan@sprezzatura.com - [url=http://www.sprezzatura.com]Sprezzatura Group[/url] wrote: === Don't know why the routine is breaking, but the first set of lines is incorrect. You're seaching on a cross-reference index, which usually delimits along spaces. The text you are looking for, "GERMAN GONZALEZ" does not exist in the index. "GERMAN" does and "GONZALEZ" does, since the system breaks up the string into sections and indexes only the section. I seem to remember ARev 2.11 or 2.03 breaking when users would try and enter multiple words into the xref look-up fields from a catalyst B type lookup. Eventually shelled to to split them into a logical AND. If you want lookups using both formats, you'll have to create a Btree on the field as well and use the btree for the full name and the xref for the partial name. akaplan@sprezzatura.com [url=http://www.sprezzatura.com]Sprezzatura Group[/url] [img]http://www.sprezzatura.com/zz.jpg[/img] ---- === At 16 AUG 1999 10:52PM German Gonzalez wrote: === Hi Aaron, the routine is working, when we use only 1 index lookup at a time. The lookup is made through btree.extract (not via catalyst). According to the documentation syntax should be as follows str1=FIELD_NAME1_XREF':@VM:'LOOKUP VALUE1':@VM:'LOOKUP VALUE2':@FM str2=FIELD_NAME2_XREF':@VM:';LOOKUP VALUE1':@VM:'LOOKUP VALUE2':@FM str3=FIELD_NAME3_XREF':@VM:';LOOKUP VALUE1':@VM:'LOOKUP VALUE2':@FM search_val=str1:str2:str3 in my example: search_val=TITULAR_NVO_XREF²GERMAN GONZALEZ²JORGE DIAZ²JUAN CARLOS':@FM:'SOLICITANTE_XREF²;GERMAN GONZALEZ²JORGE DIAZ²JUAN CARLOS':@FM:'TITULAR_ANT_XREF²;GERMAN GONZALEZ²JORGE DIAZ²JUAN CARLOS':@FM 1) If I do the lookup of several names in 1 index only, the function returns the correct values. 2) Lookup of 1 name in several indexes works fine. 3) Lookup of several (1 word) names on several indexes works also with above syntax. 4) Lookup of several (multiple word) names in several indexes breaks. According to your answer option 1 should not work either, however it does. (The documentation for btree.extract mentions an example with multiple words separated by spaces.) Using a btree for the full name and xref for the partial name is no option, because we may have several names in 1 field, and the arrangement may be firstname+lastname, or lastname+firstname. In our application it is important to have OR-logic between index fields and AND-logic with each index_field. Do you have any other suggestion or place to ask. Best regards German PD: It is strange to me that 1-4 works fine using btree.extract in Open Insight!!! [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=CC290EB1AA6BFCE7852567CC00604C96|View this thread on the forum...]]