Achoice() incremental search, exe hangs

137 views
Skip to first unread message

Ganesh Makwana

unread,
Feb 13, 2013, 6:17:43 AM2/13/13
to harbou...@googlegroups.com
I have recently migrated my old program from clipper 5.3 to Harbour 3.0. I have problem in List selection.
I am using achoice() in list selection.
I get problem in incremental search i.e as soon as I type first character (like <N> to reach forth row having NewDelhi, or 10th row having NewYork) 

Program goes in indefinite loop, and needs to be terminated.

But same module works without any problem in Clipper complied EXE.

Please help me. Thanks in advance.


Ganesh

Massimo Belgrano

unread,
Feb 13, 2013, 7:04:25 AM2/13/13
to harbou...@googlegroups.com
achoice not have incremental search 
http://www.elektrosoft.it/tutorials/Harbour-Reference-Guide/harbour-reference-guide.htm#AChoice
so i you need verify code <cUserFunction>
as first step i suggest remove userfunction as parameter and verity if application works
the revise your application  becase many error can be hidden from clipper



2013/2/13 Ganesh Makwana <ganesh...@hotmail.com>

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
 
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Massimo Belgrano
Delta Informatica S.r.l. (http://www.deltain.it/mbelgrano

Ganesh Makwana

unread,
Feb 13, 2013, 7:43:16 AM2/13/13
to harbou...@googlegroups.com
Dear Massimo Belgrano, Thanks for prompt reply. 

in my <cUserFunction> which is choiceUdf, when I return 3 it hangs, if I return 2 it works fine. please check below code for your reference.If this gets solve my most of problem is been solved.

Thanks

***********
FUNCTION CHOICEUDF
PARAMETER XMODE,XNUM,XPOS
PUB[CHOICENUM]=XNUM
PUB[CHOICEROW]=XPOS
*
PRIVATE cEXTS := ""
*
DO CASE
 CASE XMODE < 4
  *
  IF TYPE('UPDTWHAT')<>'U'
   IF .NOT. SYSHELP('ICB',FIELD(PUB[CHOICENUM]))
    ICB('Arrow Keys To Scroll   <'+XENTER+'> to Select   <ESC> to Exit')
   ENDIF
  ENDIF
  *
  DO CASE
   CASE LASTKEY()=27
    RETURN 0
   CASE LASTKEY()=9 .OR. LASTKEY()= 43 .OR. LASTKEY()=45 .OR. LASTKEY()=42 .OR. LASTKEY()=32  && tab + - *
    #IFDEF XB_RUN
     IF UPPER(ALLTRIM(ZTL)) == "FILTERS" .OR. UPPER(ALLTRIM(ZTL)) == "HEADERS"
      RETURN 1
     ENDIF
 *
     IF UPPER(ALLTRIM(ZTL)) == "LINKS" .AND. LASTKEY()=32
      RETURN 1
     ENDIF
 // 
 IF MODULE=='XBWORD' 
  cEXTS := "*."+EXT
IF cEXTS $ UPPER(ALLTRIM(ZTL))
RETURN 1
ENDIF
 ENDIF
 //
    #ELSE
     RETURN 1
    #ENDIF
   CASE LASTKEY() >=48 .AND. LASTKEY() <= 122
    IF LASTKEY()=99 .OR. LASTKEY()=67  // added GK for clearing paste buffer 02/01/96
     IF TYPE('lPASTEACT') <> 'U'
      BELL()
      ICBKEY('Clear Paste Buffer ? ;; Confirm (Y/N) ; Default is No.')
      IF TXX == 'Y'
       AFILL(CBUFFELE,NIL) 
       lPASTEACT := .F.
       KEYBOARD CHR(27)
       RETURN 2 // BY GK FROM 3 TO 2 CHECKED OK WORKING FINE.
      ELSE
       RETURN 2
      ENDIF 
     ENDIF
    ENDIF
    *   additions complete
    IF AUTORETURN
     KEYBOARD CHR(13)
    ELSE
     KEYBOARD ' '
    ENDIF
    RETURN 2 // BY GK FROM 3 to 2
   CASE LASTKEY()=13
    RETURN 1
   CASE LASTKEY()=287
    QUICKSRCH()
    RETURN 1
   OTHERWISE
    RETURN 2
  ENDCASE
  *
 OTHERWISE
  RETURN 2
  *
ENDCASE
RETURN 2
********** 

Dragan Cizmarevic

unread,
Feb 14, 2013, 8:17:39 AM2/14/13
to harbou...@googlegroups.com
Function achoice not recommended

I had a similar problem, I wanted to user the have choice in a simple way as a mobile phone when search name

My solution is in attachment

Remember, use only uppercase letters, see index
QUERY.ZIP

vszakats

unread,
Feb 14, 2013, 8:38:41 AM2/14/13
to harbou...@googlegroups.com
Hi all,

If you can create a self-contained, minimal example 
according to Harbour TROUBLESHOOTING rules 
(see README.txt), I can add the test case to the 
rest of AChoice() TOFIX notices.

[ BTW AChoice() implementation is pure .prg code, 
so I wonder why nobody is/was willing/able to fix 
these problems, if they are important. ]

-- Viktor
Reply all
Reply to author
Forward
0 new messages