xChoice() works with FWH 19.06?

xChoice() works with FWH 19.06?

Postby FiveWiDi » Fri Aug 16, 2019 3:26 pm

Mr. Rao,

xChoice() function works with FWH 1906?

Wiht FWH 15.07 works fine.

Note: aPrompts is an array like { "Hola", "que tal" }

Code: Select all  Expand view  RUN
/* *********************************************************************************** */
FUNCTION XChoice( aPrompts, cTitle )

/*by nageswaragunupudi » Mon Aug 19, 2013 8:30 pm
You may try using this function in the place of AChoice
*/

   local nSelect  := 0

   DEFAULT cTitle := "Select"

   XBROWSER aPrompts TITLE cTitle SELECT ( nSelect := oBrw:nArrayAt ) ;
      SETUP ( oBrw:lHeader := .f., oBrw:lRecordSelector := .f., oBrw:lHScroll := .f., ;
      oBrw:oWnd:bInit := { |oDlg| oDlg:aControls[ 1 ]:Hide(), ;   // Anar al primer registre.
                                  oDlg:aControls[ 2 ]:Hide(), ;   // Anar un regitstre enrera
                                  oDlg:aControls[ 3 ]:Hide(), ;   // Anar un registre endavant
                                  oDlg:aControls[ 4 ]:Hide(), ;   // Anar al darrer registre
                                  oDlg:aControls[ 5 ]:Hide(), ;   // Afegir un registre
                                  oDlg:aControls[ 6 ]:Hide(), ;   // Modificar un registre
                                  oDlg:aControls[ 7 ]:Hide(), ;   // Eliminar un registre
                                  oDlg:aControls[ 8 ]:Hide(), ;   // Imprimir
                                  oDlg:aControls[ 9 ]:Hide()} )   // Exportar a XLS

Return nSelect
/* *********************************************************************************** */


Error occurred at: 16-08-2019, 17:11:16
Error description: Error BASE/1132 Error de rango: acceso al array
Args:
[ 1] = A { ... } length: 2
[ 2] = N 3

Stack Calls
===========
Called from: => (b)EVAL( 1378 )
Called from: .\source\function\XBROWSER.PRG => FITSIZES( 301 )
Called from: .\source\function\XBROWSER.PRG => (b)XBROWSE( 250 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 864 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1120 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: .\source\function\XBROWSER.PRG => XBROWSE( 278 )
Called from: c:\desarrol\treball\Ampa1906\prg\Lib00.PRG => XCHOICE( 1378 )
Un Saludo
Carlos G.

FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
FiveWiDi
 
Posts: 1190
Joined: Mon Oct 10, 2005 2:38 pm

Re: xChoice() works with FWH 19.06?

Postby cnavarro » Fri Aug 16, 2019 10:54 pm

Try with
Prueba asi

/* *********************************************************************************** */
FUNCTION XChoice( aPrompts, cTitle )

/*by nageswaragunupudi » Mon Aug 19, 2013 8:30 pm
You may try using this function in the place of AChoice
*/
local nSelect := 0

DEFAULT cTitle := "Select"

XBROWSER aPrompts TITLE cTitle SELECT ( nSelect := oBrw:nArrayAt ) ;
SETUP ( oBrw:lHeader := .f., oBrw:lRecordSelector := .f., oBrw:lHScroll := .f., ;
oBrw:oWnd:bInit := { |oDlg| oDlg:aControls[ 1 ]:Hide() } )

Return nSelect
/* *********************************************************************************** */
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests