On Wed, 13 Jan 2010, Robert Skowronek(o2) wrote: Hi,
> I got following error when I return AC_REDRAW in user function for > ACHOICE() after > one item had been added to acItems. To be much puzzling when I remove item > from the list it is working fine. > Error BASE/1132 Bound error: array access > Called from ACH_LIMITS(0) > Called from ACHOICE(0) > By the way it used to work in Clipper without any trouble but it fails in > Harbour environment. > Litle sample to demonstrate differences between > Clipper 5.2e (Correct) and Harbour 2.0.0 (Error) > ---------------------------- > #include 'achoice.ch' > #include 'inkey.ch' > PROCEDURE MAIN > MEMVAR aPoz > PRIVATE aPoz > aPoz := {'Item 1','Item 2'} > CLEAR SCREEN > ACHOICE(5,5,15,15,aPoz,NIL,"AChFun") > CLEAR SCREEN > Inkey(0) > RETURN > FUNCTION AChFun(nMode,nCurr,nPos) > LOCAL retval,nLast > MEMVAR aPoz > > nLast:=LASTKEY() > DO CASE > CASE nLast == K_F5 > AADD(aPoz,'Item '+STR(LEN(aPoz),2)) // Add item to table > retval:=AC_REDRAW // Redraw list - ERROR > CASE nLast == K_ESC > retval:=AC_ABORT > OTHERWISE > retval:=AC_CONT > ENDCASE > RETURN retval > -------------------------------- Thank you very much. I've replicated the problem and I'll commit fix in a while. Anyhow I do not use ACHOICE() so it should be verified by someone who really knows this function. I left in achoice.prg one TOVERIFY note in place where I had to disable some explicitly added code which causes that new items added by F5 in your example were not shown immediately. I have no idea why this code was added and when it was necessary. best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour