Page 1 of 1

LISTBOX and SELECT ... FOR not Refresh()

Posted: Thu Dec 08, 2005 9:40 pm
by dbSoft
for All
GIVING HIM CODE IN THE cTMP_PEL AND THE LISTBOX
IT DOES NOT PRESENT THE REGISTRATIONS
IF I GIVE A PRICE IN THE cTMP_PEL FROM THE BEGINNING OF CODE
ARE PRESENTED THE REGISTRATIONS
IF GIVING HIM the OTHER CODE LISTBOX DOES NOT MAKE Update

Code: Select all

local cTMP_PEL := cTOT := 0 

   arr := {}
   AADD(arr,"PARG_PEL")
   AADD(arr,"PARG_EID")


    IF UseFile("PARAG" , .T. ,"DBFNTX" , arr  )
      dbPARAG := ALIAS()
      DBSELECTAREA( dbPARAG  )
    ELSE
      RETURN
    ENDIF

    DBSELECTAREA( dbPARAG  )
    DBSETORDER(1)


   bColor :=  nRGB( 204, 226, 204 )

   SET RESOURCES TO  ( lDLL + "PHASTORE.DLL"   )

   nAcolor := RGB(205, 205, 193)
   nBcolor := RGB(193, 205, 193)

 
 DEFINE DIALOG prgDLG  RESOURCE 'PARAGTRN'   FONT oFnt12 ;
   TITLE " "

    REDEFINE TBTNGET oTMP_PEL VAR cTMP_PEL ;
      ID 103   OF    prgDLG   ;
      PICTURE "99999" ;
      RESOURCE "SEARCHE"                   ;
      ACTION  ( cTMP_PEL :=  I_LIST( "PELATES", "PELATES" , "PEL_TIT" , "TITLE1" , 1 ) ,;
      oTMP_PEL:Refresh()  ) ;
      VALID  (  oLbx:Refresh()  , .T. )



    REDEFINE LISTBOX oLbx                  ;
            FIELDS DTOC((dbPARAG)->DLT_DATE)  ,;
                   (dbPARAG)->DLT_PARX  ,;
                   STR(((dbPARAG)->DLT_PARN )) ,;
                   STR((dbPARAG)->DLT_TIMHX,10,4) ,;
                   STR((dbPARAG)->DLT_POSO,10,1)  ,;
                   STR((dbPARAG)->DLT_TOT ,10,2)  ,;
                   (dbPARAG)->DLT_PERIG  ;
            ALIAS  (dbPARAG)          ;
            ID 101                    ;
            OF    prgDLG              ;
            FIELDSIZES 80, 50, 80 ,100 ,100 ,100 ,300 ;
            COLORS CLR_BLACK, bColor   ;
            SELECT STR(DLT_PEL,5) FOR STR(cTMP_PEL,5)   ;
            HEADERS   "Date", "parx ", "parn " , "timh " , "poso" , " tot " ," perig "

            REDEFINE  GET oTOT  VAR cTOT   ID 102  OF prgDLG    FONT oFnt1 READONLY
            oLbx:aJustify = { .F., .F., .T., .T., .T. , .T., .F.}
            oLbx:lUpdate := .t.
   ACTIVATE DIALOG prgDLG

    (dbPARAG)->(dbCloseArea()  )
    prgDLG:End()
[/quote][/code]

Posted: Sat Dec 10, 2005 8:06 am
by Antonio Linares
To use the SELECT clause, you must use the index key and the top limit and the bottom one, like this sample:

... SELECT Name FOR "Jan" TO "John"

Posted: Sat Dec 10, 2005 9:21 am
by dbSoft
Antonio

THE INDEX IS STR(DLT_PEL,5)+DTOC(cDLT_DATE)

THE PROBLEM THEY IS IN THE BRIEFING OF LISTBOX

WHAT IT SHOULD I PUT IN THE VALID OF TMP_PEL

IF DEFAUL cTMP_PEL := 30156 ALL OK

Code: Select all

[b]cTMP_PEL := 30156  [/b]

   DEFINE DIALOG prgDLG  RESOURCE 'PARAGTRN'   FONT oFnt12 ;
   TITLE " "

    REDEFINE GET oTMP_PEL VAR cTMP_PEL ;
      ID 103   OF    prgDLG   ;
      PICTURE "99999" ;
      VALID( oLbx:UpStable()  , oLbx:Refresh() , oLbx:GOTOP ()  , .T. )

      REDEFINE LISTBOX oLbx                  ;
            FIELDS DTOC((dbPARAG)->DLT_DATE)  ,;
                   (dbPARAG)->DLT_PARX  ,;
                   STR(((dbPARAG)->DLT_PARN )) ,;
                   STR((dbPARAG)->DLT_TIMHX,10,4) ,;
                   STR((dbPARAG)->DLT_POSO,10,1)  ,;
                   STR((dbPARAG)->DLT_TOT ,10,2)  ,;
                   (dbPARAG)->DLT_PERIG  ;
             ALIAS  (dbPARAG)          ;
             SELECT STR(DLT_PEL,5) FOR STR(cTMP_PEL,5) TO STR(cTMP_PEL,5) ;
            ID 101                    ;
            OF    prgDLG              ;
            FIELDSIZES 80, 50, 80 ,100 ,100 ,100 ,300 ;
           ...........................................................

Posted: Sun Dec 11, 2005 12:21 pm
by Antonio Linares
You may review samples\gallery\onemany.prg for a working sample.

Please notice the use of oBrw:SetFilter( ... ) in the sample.