hi Enrico
try this code whit 2 gets of different type does not work
- Code: Select all Expand view RUN
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL cVr1 := SPACE( 30 )
LOCAL nVr2 := 100
DEFINE DIALOG oDlg
@ 1, 1 GET cVr1 VALID IF( empty(GETACTIVE( oDlg ):VarGet()) , (MsgAlert("Campo obbligatorio", "Errore") , .F.), .T.)
@ 3, 1 GET nVr2 VALID IF( GETACTIVE( oDlg ):VarGet() < 0 , (MsgAlert("Valori negativi non validi", "Errore"), .F.), .T.)
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
FUNCTION GETACTIVE( oDlg )
LOCAL i
FOR i = 1 TO LEN( oDlg:aControls )
IF oDlg:aControls[ i ]:HasFocus()
RETURN oDlg:aControls[ i - IF( i = 1, 0, 1 ) ]
ENDIF
NEXT
RETURN NIL
I don't understand why, it seems to change focus before running valid
Application
===========
Path and name: c:\fwh\samples\testright.exe (32 bits)
Size: 4,201,472 bytes
Compiler version: Harbour 3.2.0dev (r2008190002)
FiveWin version: FWH 20.08
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 6 secs
Error occurred at: 10/29/20, 00:44:20
Error description: Error BASE/1073 Argument error: <
Args:
[ 1] = C test
[ 2] = N 0
Stack Calls
===========
Called from: testright.prg => (b)MAIN( 14 )
Called from: .\source\classes\TGET.PRG => TGET:LVALID( 2112 )
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( 1157 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: testright.prg => MAIN( 17 )
System
======
CPU type: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz 2808 Mhz
Hardware memory: 16260 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 4
1 , c:\fwh\samples\testright.exe
2 DDE Server Window, C:\WINDOWS\System32\OLE32.DLL
3 G, C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.1139_none_17141c90536efd
4 LOGI_RAWINPUT_WND,
Variables in use
================
Procedure Type Value
==========================
(b)MAIN
Param 1: O Class: ERROR
TGET:LVALID
Param 1: O Class: TGET
Local 1: N 0
Local 2: U
Local 3: U
Local 4: S
TGET:FWLOSTFOCUS
Local 1: L .T.
TCONTROL:HANDLEEVENT
Param 1: N 461604
Local 1: U
TGET:HANDLEEVENT
Param 1: N 2057
Param 2: N 461604
Param 3: N 0
Local 1: U
_FWH
Param 1: N 2057
Param 2: N 461604
Param 3: N 0
Local 1: U
Local 2: U
DIALOGBOXINDIRECT
Param 1: N 0
Param 2: N 2057
Param 3: N 461604
Param 4: N 0
Param 5: N 3
Local 1: O Class: TGET
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "€ È€ Ÿ L € P
o e E D I T ‚ P ' f E D I T 1 0 0 "
Param 3: N 0
Param 4: O Class: TDIALOG
MAIN
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: L .F.
Param 13: O Class: TDIALOG
Param 14: U
Local 1: N 0
Local 2: S
Local 3: O Class: TDIALOG
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX
DataBases in use
================
Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TWINDOW
5 TDIALOG
6 TBRUSH
7 TCONTROL
8 TGET
9 GET
10 TCLIPGET
11 TFONT
12 TREG32
13 TRECT
14 TSTRUCT
Memory Analysis
===============
588 Static variables
Dynamic memory consume:
Actual Value: 851968 bytes
Highest Value: 851968 bytes
bye