Listbox con array

Post Reply
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Listbox con array

Post by mastintin »

Estoy tratando de hacer que funcione un listbox con un array , pero o me coge el alias que pilla abierto o produce error :

Code: Select all

   
Error BASE/1004  No exported method: EVAL                                       
Called from (b)EVAL(0)                                                          
Called from TWBROWSE:NEW(39)                                                    
Called from TINDICES:MSGSELECT(227)                                             
Called from INDICES(46)            
Called from (b)MAIN(48)
Called from (b)TBUTTON(10)
Called from TBUTTON:CLICK(0)
Called from TWINDOW:HANDLEEVENT(187)
Called from _FMH(255)               
Called from WNDRUN(0)
Called from TWINDOW:ACTIVATE(93)
Called from MAIN(53)  2010-07-04 21:00:52.888 testindices[4689:903] *** attempt 

 
el codigo que lanza el error :

Code: Select all


 cpath:= path()+"/"


sele (::calias)
(::calias)->(dbgotop())
DBEVAL({|| aadd(aDatos,{.f. , substr( (::calias)->nombre,1,18) })} )

cValue:= aDatos[1,2]

close(::cAlias)

 pausa(len(aDatos))
 pausa(len(aDatos[2]))

  DEFINE DIALOG ::oDlg TITLE "Creación de Indices" ;
      FROM 470, 650 TO 500, 406
      
   @ 330, 240 SAY "Escoja un archivo" OF ::oDlg SIZE 150, 50
      
    
   @ 20, 83 BUTTON obtn PROMPT "OK" OF ::oDlg ACTION pausa(7)
   
   //  BTNSETBEZEL(obtn:hWnd,11)  
   
    @ 200, 90 IMAGE oImg OF ::oDlg SIZE 107, 91 FILENAME cpath+"disco.tiff"
   
    @ 150, 250 LISTBOX oBrw OF ::oDlg SIZE 190, 190 

     oBrw:setArray(aDatos)

     oProg = TProgress():New( 74, 28 , 450, 30, ::oDlg, 0 )
  
   @ 20, 318 BUTTON "Cancel" OF ::oDlg ACTION ::oDlg:End()
   
   ACTIVATE DIALOG ::oDlg CENTERED
 
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Listbox con array

Post by Antonio Linares »

Manuel,

Prueba a hacerlo asi:

Code: Select all

    @ 150, 250 LISTBOX oBrw FIELDS "", "" HEADERS "Uno", "Dos" OF ::oDlg SIZE 190, 190 

     oBrw:setArray( aDatos )
     oBrw:bLine = { | nRow | { If( aDatos[ nRow ][ 1 ], ".T.", ".F." ), aDatos[ nRow ][ 2 ] } }
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Re: Listbox con array

Post by mastintin »

Perfecto ya funciona .
Gracias.
Post Reply