Subject applyLocate and apostrophe applylocate limit ?
From Dirk C <dirk@C.com>
Date Thu, 15 Aug 2024 21:58:15 +0200
Newsgroups dbase.getting-started

hello to you,

when in use findkeynearst : and the name in the field begins with
apostrophe :: no problem can find teh value

i have a search field using applylocate

when i change the combox and put a value in a field beginns with an
apostrophe :: applylocate gives an error :  Unallowed phrase/keyword in
command:  '

when i first give a value and change the combobox it finds the first
value beginning with a apostrophe

but let's say taking the 4th or whatever value starts with an apostrophe
and change the combobox : only get the first value with an apostrophe

even the apostrophe is in the middle of the value: applylocate doesn't
accept the '

even using the function to replace the ' or strip the '

c_Veldf = [name='] +trim(this.value)+['] or with quotes

Do Case
                 Case form.keuzedoos_sorteren.value =="firma"
                   c_Veldf = [name=']+trim(this.value)+[']
           ? c_veldf
            o_vraagb.rowset.locateOptions = 3
                 o_vraagb.rowset.beginlocate()
                            o_vraagb.rowset.ApplyLocate(c_Veldf)
                  Case form.keuzedoos_sorteren.value =="postcode"
                  c_veldp ="plz="+trim(this.value)+"'"
                    o_vraagb.rowset.locateOptions = 3
               o_vraagb.rowset.beginlocate()
                     o_vraagb.rowset.ApplyLocate(c_Veldp)
                 Case form.keuzedoos_sorteren.value =="stad"
                    c_Veldc= "city='"+trim(this.value)+"'"
                    o_vraagb.rowset.locateOptions = 3
                o_vraagb.rowset.beginlocate()
                     o_vraagb.rowset.ApplyLocate(c_Veldc)
    EndCase

thanks for more info

Dirk,