On Wed, 03 Feb 2010, smu johnson wrote: Hi,
> ACHOICE() behaves differently in Harbour than Clipper. In Clipper, the code > below will not have achoicef() called, as it knows that there is no point to > run it.. probably because the pFNames array is blank. Harbour however, will > try to run it, causing "array access" error. > --- code --- > func main() > Priv pFNames:={} // privates needed by achoice's function > AChoice(1,0,10,20,pFNames,,"achoicef",1,1) > return nil > Func achoicef(nMode,nItem) > ? pFNames[nItem] > wait > return You touched never ending problem. ACHOICE and MEMOEDIT are peaces of code which should be rewritten from scratch or at least seriously cleaned. Unfortunately none of us has motivation to touch this code. Probably none of core developers use them in hos own programs and do not want to invest time in detail test of undocumented Clipper behaviors. In the past we had similar problem with TBROWSE but two years ago I rewrote it in practice nearly from scratch and seems that it resolved all reported by user problems. But I needed over two weeks to document Clipper behavior with great Viktor help and it was more then I needed for coding. I have no motivation to make the same with ACHOICE. It's .prg code and many of Harbour users should be able to make detail tests and update this code. It's not C and does not need any special knowledge. It's enough to carefully document all side effects of ACHOICE implementation in Clipper and then create compatible code. Probably much smaller then the current one. I'll commit fix for your example but for sure it will not address all potential problems in ACHOICE. Maybe your code will not exploit any of new incompatibilities so it will be enough for your. Anyhow if you want to look at it closer then src/rtl/achoice.prg is the source code of ACHOICE in Harbour. best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour