Hola a todos
El siguiente código funciona en FW16
@15,80 GET oget0 VAR cget0 OF odlgeu RIGHT SIZE 50,9 PIXEL UPDATE;
VALID ;
Eval ( { || IF (CGET1 = 0 , (CGET2:=CGET2), .F. ),;
(CGET2,( CGET2:=CGET1*CGET0), oGET2:Refresh(),;
(CGET4,( CGET4:=CGET3*CGET0), oGET4:Refresh(),;
.T. )) } )
Al pasarlo a 32 el compilador arroja el siguiente error:" Warning W0027 Meaningless use of expression 'Logical'
Aquí, que también funciona en FW16,
@45, 30 GET oget1 VAR cget1 OF odlgeu picture "999,999,999" RIGHT SIZE 50,9 PIXEL UPDATE VALID ;
Eval ( { || IF (CGET1 = 0 ,;
(CGET2:=CGET2), .F. ),;
(CGET2,( CGET2:=CGET1*CGET0), oGET2:Refresh(), .T. ) } )
El compilador arroja este error: "Error E0030 Syntax error "syntax error at 'EVAL'"
Alguien me puede decir dónde está el error?
Gracias
FWH1804
Error sintaxis EVAL
Re: Error sintaxis EVAL
Normal. \samples\testget3.prg modificado.
Saludos.
Code: Select all
#include "fivewin.ch"
function main()
local oWnd
local oMenu
menu oMenu
MenuItem "From Code" action FromCode( oWnd )
MenuItem "From Resource" action FromrES( oWnd )
endmenu
define window oWnd title "Test Button Get Transparent" menu oMenu pixel
activate window oWnd maximized
return oWnd
Function FromCode( oWnd )
local oDlg
local oGet1, oGet2, oGet3, oGet4
local cVar1, cVar2, cVar3, cVar4
local lActive := .f.
cVar1 := 0
cVar2 := 0
cVar3 := 10
cVar4 := 0
define dialog oDlg title "From Code" pixel size 300,300
/*
@45, 30 GET oget1 VAR cget1 OF odlgeu picture "999,999,999" RIGHT SIZE 50,9 PIXEL UPDATE VALID ;
Eval ( { || IF (CGET1 = 0 ,;
(CGET2:=CGET2), .F. ),;
(CGET2,( CGET2:=CGET1*CGET0), oGET2:Refresh(), .T. ) } )
*/
// cambiado el ejemplo original - funciona normal
@10, 10 GET oGet1 VAR cVar1 OF odlg picture "999,999,999" RIGHT ;
SIZE 60,12 PIXEL UPDATE ;
VALID Eval ( { || IF (cVar1 = 0, (cVar2:=cVar2), .F. ), ;
(cVar2,( cVar2:=cVar1*cVar3), oGET2:Refresh(), .T. ) } )
//@ 10,10 get oGet1 var cVar1 bitmap "..\bitmaps\on.bmp" action( msginfo( "With Transparent" ) ) of oDlg pixel size 60,12
@ 40,10 get oGet2 var cVar2 bitmap "..\bitmaps\on.bmp" action( msginfo( "Without Transparent" ) ) of oDlg pixel size 60,12
@ 70,10 get oGet3 var cVar3 bitmap "..\bitmaps\chkyes.bmp" action( msginfo( "With Adjust-Transparent" ) ) of oDlg pixel size 120,12
@ 100,10 get oGet4 var cVar4 bitmap "..\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 FromRes( oWnd )
local oDlg
local oGet1, oGet2, oGet3, oGet4
local cVar1, cVar2, cVar3, cVar4
local lActive := .f.
cVar1 := 0
cVar2 := 0
cVar3 := 0
cVar4 := 0
define dialog oDlg resource "fromres" of oWnd
redefine get oGet1 var cVar1 id 100 bitmap "on" action( msginfo( "With Transparent" ) ) of oDlg
redefine get oGet2 var cVar2 id 101 bitmap "on" action( msginfo( "Without Transparent" ) ) of oDlg
redefine get oGet3 var cVar3 id 102 bitmap "chkyes" action( msginfo( "With Adjust-Transparent" ) );
COLOR CLR_BLACK, CLR_CYAN of oDlg
redefine get oGet4 var cVar4 id 103 bitmap "chkyes" ;
action( if( lActive,oGet3:disable(),oGet3:enable()), lActive:= !lActive, oDlg:update() ) of oDlg
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
João Santos - São Paulo - Brasil
Re: Error sintaxis EVAL
Gracias, Joao por contestar.
Sigue dando los errores siguientes:
c:\winsat\Decimal.prg(41) Warning W0027 Meaningless use of expression 'Logical'
c:\winsat\Decimal.prg(46) Warning W0027 Meaningless use of expression 'Logical'
c:\winsat\Decimal.prg(51) Warning W0027 Meaningless use of expression 'Logical'
c:\winsat\Decimal.prg(56) Warning W0027 Meaningless use of expression 'Logical'
El código completo es el siguiente y en rojo el origen los errores:
Sigue dando los errores siguientes:
c:\winsat\Decimal.prg(41) Warning W0027 Meaningless use of expression 'Logical'
c:\winsat\Decimal.prg(46) Warning W0027 Meaningless use of expression 'Logical'
c:\winsat\Decimal.prg(51) Warning W0027 Meaningless use of expression 'Logical'
c:\winsat\Decimal.prg(56) Warning W0027 Meaningless use of expression 'Logical'
El código completo es el siguiente y en rojo el origen los errores:
Code: Select all
#include "FiveWin.ch"
#include "ord.ch"
Function euros(nnumres, onumres, nptasti, optasti,;
ncapitapts, ocapitapts, neuti, oeuti, ncapitaeu, ocapitaeu)
local oDlg
local oGet1, oGet2, oGet3, oGet4, oGet5
local cVar1, cVar2, cVar3, cVar4, cVar5
local lActive := .f.
cVar1:= nNumres //sat->num_resgua
cVar2:= nPtasti //sat->valor_resg
cVar3:= nCapitapts //sat->cap_soc_ap
cVar4:= nEuti //sat->eures
cVar5:= nCapitaeu //sat->eucap
define dialog oDlg title "From Code" pixel size 400,300
@10, 20 SAY "Nº de títulos" OF odlg PIXEL
[color=#FF4000] @10, 90 GET oGet1 VAR cVar1 OF odlg picture "999,999,999" RIGHT ;
SIZE 60,12 PIXEL UPDATE ;
VALID Eval ( { || IF (cVar1 = 0, (cVar2:=cVar2), .F. ), ;
(cVar3,( cVar3:=cVar1*cVar2), oGet3:Refresh(), .T. ) } )[/color]
@ 30,20 SAY "Valor pts " OF odlg PIXEL
[color=#FF0000] @ 30,90 get oGet2 var cVar2 of oDlg pixel size 60,12 picture "999,999,999" RIGHT UPDATE;
VALID Eval ( { || IF (cVar1 = 0, (cVar2:=cVar2), .F. ), ;
(cVar3,( cVar3:=cVar1*cVar2), oGet3:Refresh(), .T. ) } )
[/color]
@ 50,20 SAY "Capital social pts " OF odlg PIXEL
[color=#FF0000]@ 50,90 get oGet3 var cVar3 of oDlg pixel size 60,12 picture "9,999,999,999" RIGHT UPDATE;
VALID Eval ( { || IF (cVar1 = 0, (cVar3:=cVar3), .F. ), ;
(cVar3,( cVar3:=cVar1*cVar2), oGet3:Refresh(), .T. ) } )[/color]
@ 70,20 SAY "Valor euros" OF odlg PIXEL
[color=#FF0000] @ 70,90 get oGet4 var cVar4 of oDlg pixel size 60,12 picture "9,999,999.99" RIGHT UPDATE;
VALID Eval ( { || IF (cVar1 = 0, (cVar4:=cVar4), .F. ), ;
(cVar5,( cVar5:=cVar1*cVar4), oGet5:Refresh(), .T. ) } )[/color]
@90,20 SAY "Capital social euros" OF odlg PIXEL
@90,90 get oGet5 var cVar5 of oDlg pixel size 60,12 picture "9,999,999.99" RIGHT
@110,20 BUTTON "Aceptar" OF oDlg SIZE 40,20 PIXEL ACTION (oDlg:end())
activate dialog oDlg centered
return nil
FWH 20.12 BCC7
Re: Error sintaxis EVAL
Normal. Funciona bién.
Creo que deveis actualizar tu BCC7 por uno más nuevo aqui:
http://forums.fivetechsupport.com/viewt ... 16&t=33542
Saludos.
Creo que deveis actualizar tu BCC7 por uno más nuevo aqui:
http://forums.fivetechsupport.com/viewt ... 16&t=33542
Code: Select all
// RAMON.PRG modifcado por: kapiabafwh@gmail.com - Sin problemas.
#include "FiveWin.ch"
#include "ord.ch"
FUNCTION Main()
LOCAL ONUMRES := 50 // ???
LOCAL OPTASTI := 60
LOCAL OCAPITAPTS := 70
LOCAL OEUTI := 80
LOCAL OCAPITAEU := 90
LOCAL nNumres := 0 //sat->num_resgua
LOCAL nPtasti := 0 //sat->valor_resg
LOCAL nCapitapts := 10 //sat->cap_soc_ap
LOCAL nEuti := 0 //sat->eures
LOCAL nCapitaeu := 0 //sat->eucap
euros( nnumres, onumres, nptasti, optasti, ncapitapts, ocapitapts, ;
neuti, oeuti, ncapitaeu, ocapitaeu )
RETURN NIL
FUNCTION euros( nnumres, onumres, nptasti, optasti, ncapitapts, ocapitapts, ;
neuti, oeuti, ncapitaeu, ocapitaeu )
LOCAL oDlg
LOCAL oGet1, oGet2, oGet3, oGet4, oGet5
LOCAL cVar1, cVar2, cVar3, cVar4, cVar5
LOCAL lActive := .F.
cVar1 := nNumres //sat->num_resgua
cVar2 := nPtasti //sat->valor_resg
cVar3 := nCapitapts //sat->cap_soc_ap
cVar4 := nEuti //sat->eures
cVar5 := nCapitaeu //sat->eucap
define dialog oDlg title "From Code" pixel size 400, 300
@10, 20 SAY "Nº de títulos" OF odlg PIXEL
@10, 90 GET oGet1 VAR cVar1 OF odlg PICTURE "999,999,999" RIGHT ;
SIZE 60, 12 PIXEL UPDATE ;
VALID Eval ( { || IF ( cVar1 = 0, (cVar2 := cVar2 ), .F. ), ;
( cVar3, ( cVar3 := cVar1 * cVar2 ), oGet3:Refresh(), .T. ) } ) ;
@ 30, 20 SAY "Valor pts:" OF odlg PIXEL
@ 30, 90 GET oGet2 var cVar2 of oDlg pixel size 60, 12 PICTURE "999,999,999" ;
RIGHT UPDATE ;
VALID Eval ( { || IF ( cVar1 = 0, (cVar2 := cVar2 ), .F. ), ;
( cVar3, ( cVar3 := cVar1 * cVar2 ), ;
oGet3:Refresh(), .T. ) } )
@ 50, 20 SAY "Capital social pts:" OF odlg PIXEL
@ 50,90 get oGet3 var cVar3 of oDlg pixel size 60,12 picture "9,999,999,999" ;
RIGHT UPDATE ;
VALID Eval ( { || IF (cVar1 = 0, (cVar3:=cVar3), .F. ), ;
(cVar3,( cVar3:=cVar1*cVar2), oGet3:Refresh(), .T. ) } )
@ 70, 20 SAY "Valor euros:" OF odlg PIXEL COLORS CLR_HRED, CLR_WHITE
@ 70, 90 GET oGet4 var cVar4 of oDlg pixel size 60, 12 PICTURE "9,999,999.99" ;
RIGHT UPDATE ;
VALID Eval ( { || IF ( cVar1 = 0, (cVar4 := cVar4 ), .F. ), ;
( cVar5, ( cVar5 := cVar1 * cVar4 ), oGet5:Refresh(), .T. ) } )
@90, 20 SAY "Capital social euros:" OF odlg PIXEL COLORS CLR_HRED, CLR_WHITE
@90, 90 GET oGet5 var cVar5 of oDlg pixel size 60, 12 PICTURE "9,999,999.99" ;
RIGHT
@110, 20 BUTTON "Aceptar" OF oDlg SIZE 40, 20 PIXEL ACTION ( oDlg:end() )
activate dialog oDlg centered
RETURN nil
// FIN - 17/01/2020 - Joao Santos - Sao Paulo - Brazil.
João Santos - São Paulo - Brasil