GET....Valid error RESOLVED

GET....Valid error RESOLVED

Postby Silvio.Falconi » Fri Nov 27, 2020 11:00 am

I have on a dialog
local cArchiv := Space( 40 )
..
@ 115,55 GET oGetArc VAR cArchiv size 200,11 PIXEL OF oDlgSalvaRpt ;
VALID iif( Empty( RTrim(cArchiv ) ), MsgStop( "E' obbligatorio introdurre un nome per l'archivio.",'Attenzione' ), .T. )

If I click on get and the go to another before show me the message and then crash
Why ?

make me this error
Code: Select all  Expand view  RUN
 
   Error occurred at: 27-11-2020, 11:55:06
   Error description: Error BASE/1066  Parametro errato: condizionale
   Args:
     [   1] = U  

Stack Calls
===========
   Called from: .\source\classes\TGET.PRG => TGET:LVALID( 2128 )
   Called from: .\source\classes\CONTROL.PRG => TGET:FWLOSTFOCUS( 1205 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1802 )
   Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT( 1159 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
Last edited by Silvio.Falconi on Fri Nov 27, 2020 6:44 pm, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GET....Valid error

Postby karinha » Fri Nov 27, 2020 2:04 pm

Siempre publique el ejemplo completo Silvio, como en el siguiente ejemplo:

Code: Select all  Expand view  RUN

#include "fivewin.ch"
#include "inkey.ch"

static oWnd

FUNCTION Main()

   LOCAL oMenu, oBar
   
   MENU oMenu

      MenuItem "From Code" action FromCode( oWnd )

      // MenuItem "From Resource" action FromrES( oWnd )

   endmenu

   DEFINE WINDOW oWnd TITLE "3D objects" MENU oMenu pixel

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar ACTION FromCode( oWnd )

   SET MESSAGE OF oWnd TO "3D Objects" NOINSET CLOCK DATE KEYBOARD
   
   ACTIVATE WINDOW oWnd MAXIMIZED
 
RETURN oWnd

FUNCTION FromCode( oWnd )

   LOCAL oDlg
   LOCAL oGet1, oGet2, oGet3, oGet4
   LOCAL cVar1, cVar2, cVar3, cVar4
   LOCAL lActive := .F.
   LOCAL cArchiv := SPACE( 40 )

   
   cVar1 := 0
   cVar2 := 0
   cVar3 := 0
   cVar4 := 0
   
   
   define dialog oDlg title "From Code" pixel size 300, 300

   @ 10, 10 GET oGet1 VAR cArchiv bitmap "C:\FWH1905\bitmaps\on.bmp"         ;
      ACTION( msginfo( "Un día aprendo FiveWin. I love FiveWin." ) )         ;
      of oDlg pixel size 60, 12                                              ;
      VALID( OBBLIGATORIO_SILVIO( cArchiv, oGet1, oDlg ) )

   @ 40, 10 GET oGet2 VAR cVar2 bitmap "C:\FWH1905\bitmaps\on.bmp" action( msginfo( "Without Transparent" ) ) of oDlg pixel size 60, 12

   @ 70, 10 GET oGet3 VAR cVar3 bitmap "C:\FWH1905\bitmaps\chkyes.bmp" action( msginfo( "With Adjust-Transparent" ) ) of oDlg pixel size 120, 12

   @ 100, 10 GET oGet4 VAR cVar4 bitmap "C:\FWH1905\bitmaps\chkyes.bmp" ;
      action( if( lActive,oGet3:disable(),oGet3:enable() ), lActive := !lActive, oDlg:update() ) of oDlg pixel size 120, 12
   
   oGet1:lBtnTransparent := .T.       // transparent button get oGet1
   
   oGet3:disable()
   oGet3:lBtnTransparent := .T.       // transparent button get oGet3
   oGet3:lAdjustBtn      := .T.       // Button Get Adjust Witdh oGet3
   oGet3:lDisColors      := .F.       // Deactive disable color
   oGet3:nClrTextDis     := CLR_WHITE // Color text disable status
   oGet3:nClrPaneDis     := CLR_BLUE  // Color Pane disable status
   
   oGet4:lAdjustBtn      := .T.
   
   activate dialog oDlg centered

 
RETURN nil

FUNCTION OBBLIGATORIO_SILVIO( cArchiv, oGet1, oDlg )

   IF( .NOT. EMPTY( RTrim( cArchiv ) ) ) // full

      MsgInfo( "Perfecto Silvio - OOP -> POO - Hay dados." )

   ELSE  // vacio

      MsgInfo( "E' obbligatorio introdurre un nome per l'archivio.", "Attenzione Hombre de Dios." )

      RETURN( .F. )

   ENDIF

RETURN( .T. )

// FIN - kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7842
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: GET....Valid error

Postby Silvio.Falconi » Fri Nov 27, 2020 6:21 pm

karinha wrote:Siempre publique el ejemplo completo Silvio, como en el siguiente ejemplo:




Regards, saludos.



Sorry But

IF I use resources run ok with

REDEFINE GET oGetArc VAR cArchiv ID 202 OF ODlg ;
VALID iif( Empty( RTrim(cArchiv ) ), MsgStop( 'It is mandatory to enter a name for the file.','Attention' ), .T. )

why on source (@x,y) not run ??????
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GET....Valid error

Postby Silvio.Falconi » Fri Nov 27, 2020 6:43 pm

resolved with

@ 136,55 GET oGetArc VAR cArchiv size 150,11 PIXEL OF oDlgSalvaRpt ;
VALID ValEmpty( cArchiv, oGetArc )

FUNCTION ValEmpty( cDato, oGet )
IF empty( cDato )
MsgStop( i18n( "E' obbligatorio riempire questo campo." ) )
oGet:setFocus()
RETURN .F.
END IF
RETURN .T.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 53 guests