AllExperts > FoxPro 
Search      
FoxPro
Volunteer
Answers to thousands of questions
 Home · More FoxPro Questions · Answer Library  · Encyclopedia ·
More FoxPro Answers
Question Library

Ask a question about FoxPro
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Markish
Expertise
I can answer general questions related to Foxpro from Version 2.0 to 9.0. I'll try to answer them as quickly as possible.

Experience
I've been into Dbase programming from age of 11. I've worked in versions from FoxPro 2.0 and Foxbase.
Education/Credentials
I've done my B.Tech (IT) with distinction from Anna University, Chennai - India.

 
   

You are here:  Experts > Computing/Technology > Databases > FoxPro > Incremental search

FoxPro - Incremental search


Expert: Markish - 4/25/2008

Question
sir,
i am using foxpro2.6. Please give idea or coding about incremental search. i want to use it in my application

Answer
Hi Ck,
  VFP / Foxpro don't have an incremental search built-in. Still you can code it easily. I'll give you a direction, you build on it. In FoxPro 2.6, you've to code it completely. In the sense starting from displaying it, to select it and search it..

mkey=inkey()
do while mkey<>27  && Esc
  mkey=0
  do while mkey=0
     mkey=inkey()   && Captures the key pressed
  enddo
  do case
     case mkey = 5   && Uparrow
          skip -1
          if bof()
             go top
          endif
          ** Write code here to display the appropriate record
     case mkey = 24  && Downarrow
          skip
          if eof()
             go bott
          endif
          ** Write code here to display the appropriate record
     case betw(mkey,65,90) or betw(mkey,97,122) or inli(mkey,46,127,32,64) or betw(mkey,33,57)
     if mkey#127
        if mkey#32
           mfindstr=mfindstr+chr(mkey)
        else
           mfindstr=mfindstr+" "
        endif
     else
        xx=mfindstr
        if len(xx)>0
           mfindstr=subs(xx,1,len(xx)-1)
        else
           ?? chr(7)
        endif
     endif
     mnam=mfindstr
     xxxx=subs(Str(recn()+1000000,7),2,6)
     loca for subs(upper(fname),1,len(mnam))=upper(mnam)
     if found()
        ** Code here to highlight the found one...!
     else
        keyb chr(127)
        ?? chr(7)
        &xxxx
     endif
  endcase
enddo


Hope this helps..
This is just a direction..

Best regards,
Markish


Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.