Page 1 of 1

Problem with datepick - Resolved -

PostPosted: Tue Mar 26, 2024 12:42 pm
by Silvio.Falconi
give me an error when I try to select a date



Code: Select all  Expand view
@ nRow, 70 DTPICKER  aGet[1] VAR ddatacambio OF oDlgSub SIZE 198, 25 PIXEL ;
      FONT oFont UPDATE PICTURE "ddd dd mmm yyyy"  ;
     VALID ( DoSwitch( ddatacambio, oBtnGetExchange) ) STYLE DTS_SHOWNONE

 @ nRow-0.2,  320 BTNBMP oBtnGetExchange ;
              PROMPT "Aggiorna on line"  OF oDlgSub;
              SIZE 120, 24 PIXEL FLAT GDIPLUS ;
              BITMAP "BTN_INTERNET"    LEFT NOROUND ;
              ACTION nil

STATIC FUNCTION DoSwitch( ddatacambio, oBtnGetExchange  )
LOCAL dDate := ddatacambio:GetDate()
LOCAL cDate := DTOC(dDate)

   IF EMPTY(cDate)
      oBtnGetExchange:Disable()
   ELSE
      oBtnGetExchange:enable()
   ENDIF
   oBtnGetExchange:Refresh()
RETURN .T.


I must activate a btnbmp if the date is valid

the error

Code: Select all  Expand view
  Time from start: 0 hours 0 mins 10 secs
   Error occurred at: 26-03-2024, 13:35:13
   Error description: Error BASE/1004  Metodo non disponibile: GETDATE
   Args:
     [   1] = D   26-03-2024

Stack Calls
===========
   Called from: source\Pvalute.prg => GETDATE( 0 )
   Called from: source\Pvalute.prg => DOSWITCH( 1134 )
   Called from: source\Pvalute.prg => (b)EDIT_STORICO( 1085 )

Re: Problem with datepick

PostPosted: Tue Mar 26, 2024 12:47 pm
by nageswaragunupudi
Code: Select all  Expand view
LOCAL dDate := ddatacambio:GetDate()
 



Here is the mistake.
"ddatacambio" is a date value and date value can not have any method.

Re: Problem with datepick

PostPosted: Tue Mar 26, 2024 1:07 pm
by Silvio.Falconi
nageswaragunupudi wrote:
Code: Select all  Expand view
LOCAL dDate := ddatacambio:GetDate()
 



Here is the mistake.
"ddatacambio" is a date value and date value can not have any method.


opps - corrected
STATIC FUNCTION DoSwitch( ddatacambio, oBtnGetExchange,aGet )
LOCAL dDate := aget[1]:GetDate()