FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xChoice() works with FWH 19.06?
Posts: 1446
Joined: Mon Oct 10, 2005 02:38 PM
xChoice() works with FWH 19.06?
Posted: Fri Aug 16, 2019 03: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 (fw): Select all Collapse
/* *********************************************************************************** */
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 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xChoice() works with FWH 19.06?
Posted: 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: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

Continue the discussion