Estoy sin poder resolver el siguiente error que se me presenta por primera vez.
Es en una rutina de carga o modificación de un registro
Cuando hago modificación no salta el error, solo cuando agrego el registro.
Lo que me llama la atención que es un código que uso habitualmente, o se me esta pasando algo y no lo veo.
Este es el código de la rutina:
- Code: Select all Expand view RUN
PROCEDURE AgreCargo(lAppCar, nCodiE, nCodiC, cNomEmple)
Local lGrabaC:= .F., ECDlg
Public oMatObj:=Array(3), oCodEmpre, oNomEmpre, nCodigo:=Space(10)
DEFINE FONT oFont_14 NAME "Times New Roman" SIZE 0,-14 BOLD
DEFINE FONT oFont_12 NAME "Times New Roman" SIZE 0,-12 BOLD
DEFINE FONT oFont_20 NAME "Times New Roman" SIZE 0,-20 BOLD
oQryEmEmp:SetWhere("cod_neg = '"+nCodiC+"' " )
If lAppCar
oQryEmEmp:GetBlankRow(.F.)
oQryEmEmp:Incentivo :=.T.
oQryEmEmp:FeIng :=oQryEmpl:FeIng
oQryEmEmp:CodAnti :="001"
oQryEmEmp:Especial:=.F.
oQryEmpr:GetBlankRow(.F.)
Else
oQryEmEmp:SetOrder("codigoEE",.T.)
nSeek :=oQryEmEmp:Seek(nCodiE, 'codigoEE',,,.T. )
If nSeek >0
oQryEmEmp:GetRow()
Else
MsgAlert("No encuentro el Cargo...!")
EndIf
oQryEmpr:SetOrder("cod_empre",.T.)
nSeek :=oQryEmpr:Seek(nCodiC, 'cod_empre',,,.T. )
If nSeek >0
oQryEmpr:GetRow()
Else
oQryEmpr:GetBlankRow(.F.)
EndIf
EndIf
Cal_Anti(Date(),oQryEmEmp:FeIng,.T.,oQryEmEmp:CodAnti,.F.)
DEFINE DIALOG ECDlg RESOURCE "DATOSPROFE" ;
TITLE If( lAppCar, "AGREGAR CARGO A "+cNomEmple, "MODIFICAR CARGO A "+cNomEmple )
REDEFINE GET oCodEmpre VAR oQryEmpr:Cod_empre ID 101 OF ECDlg COLOR CLR_NBLUE FONT oFont14 PICTURE "@!" ;
BITMAP "./BMP/Buscar_16.BMP" ;
ACTION If(Empresas(.F.),(oQryEmpr:GetRow(),oMatObj[2]),Nada()) ;
VALID BuscoECod(.F.,oQryEmpr:Cod_empre) ;
UPDATE
REDEFINE SAY oNomEmpre PROMPT ALLTRIM(oQryEmpr:Nom_Empre)+" - "+ALLTRIM(oQryEmpr:catego) ID 102 OF ECDlg ;
FONT oFont14 COLOR CLR_NBLUE
REDEFINE DBCOMBO oCargo VAR oQryEmEmp:TCargo ID 123 OF ECDlg ;
ALIAS oQryCargo ITEMFIELD "cod_cargo" LISTFIELD "desc_cargo" ;
ON CHANGE (ActuCargos(oQryEmEmp:TCargo), onBasi:Refresh(), onPto:Refresh(), onHor:Refresh()) ;
UPDATE
REDEFINE DBCOMBO oTRevi VAR oQryEmEmp:TRevis ID 129 OF ECDlg ;
ALIAS oQryRevis ITEMFIELD "CODREVIS" LISTFIELD "NOMREVIS" ;
UPDATE
REDEFINE GET onHor VAR oQryEmEmp:Horas ID 124 OF ECDlg PICTURE "99" UPDATE
REDEFINE GET onPto VAR oQryEmEmp:Puntos ID 125 OF ECDlg PICTURE "999" UPDATE
REDEFINE GET onBasi VAR oQryEmEmp:Basi_Fi ID 126 OF ECDlg PICTURE "$999,999.99" UPDATE
REDEFINE GET oDetalle VAR oQryEmEmp:Detalle ID 4007 OF ECDlg UPDATE
REDEFINE GET odFeBaja VAR oQryEmEmp:FeBaja ID 128 OF ECDlg
REDEFINE DBCOMBO oTitu VAR oQryEmEmp:CodTitu ID 127 OF ECDlg ;
ALIAS oQryTitu ITEMFIELD "codigo_titu" LISTFIELD "desc_titu" ;
UPDATE
REDEFINE DBCOMBO oFPago VAR oQryEmEmp:FPago ID 4015 OF ECDlg ;
ALIAS oQryPago ITEMFIELD "codigo_pago" LISTFIELD "detalle_pago" ;
UPDATE
REDEFINE GET oQryEmEmp:Sucursal ID 4018 OF ECDlg
REDEFINE GET oQryEmEmp:CtaBco ID 4019 OF ECDlg
REDEFINE GET oQryEmEmp:CBU ID 4011 OF ECDlg
REDEFINE GET oQryEmEmp:FeAlta ID 120 OF ECDlg
REDEFINE CHECKBOX oQryEmEmp:Incentivo ID 4003 OF ECDlg
REDEFINE CHECKBOX oQryEmEmp:Afectado ID 4010 OF ECDlg
REDEFINE GET oQryEmEmp:Destino ID 4012 OF ECDlg ;
When oQryEmEmp:Afectado
REDEFINE DBCOMBO oRama VAR oQryEmEmp:RamaEn ID 4014 OF ECDlg ;
ALIAS oQryRama ITEMFIELD "CODRAMA" LISTFIELD "NOMRAMA" ;
UPDATE
REDEFINE DBCOMBO oTAnti VAR oQryEmEmp:CodAnti ID 4002 OF ECDlg ;
ALIAS oQryAnti ITEMFIELD "codigo_anti" LISTFIELD "nombre_anti" ;
UPDATE
REDEFINE GET oQryEmEmp:FeIng ID 121 OF ECDlg ;
VALID Cal_Anti(Date(),oQryEmEmp:FeIng,.T.,oQryEmEmp:CodAnti,.F.)
REDEFINE SAY oAnti VAR nAnti ID 122 OF ECDlg COLOR CLR_NBLUE FONT oFont12
REDEFINE CHECKBOX oQryEmEmp:Especial ID 4004 OF ECDlg
REDEFINE BTNBMP oBtnA ID 4020 OF ECDlg TOOLTIP "Graba el Cargo al Empleado..." ;
FILE "./BMP/Grabar_24.PNG" ;
TRANSPARENT NOBORDER ;
ACTION (BusCodiEmple(lAppCar), GrabarCE(lAppCar), ECDlg:End())
REDEFINE BTNBMP oBtnC ID 4021 OF ECDlg TOOLTIP "Cancela el Movimiento..." ;
FILE "./BMP/Cancelar_24.PNG" ;
TRANSPARENT NOBORDER ;
ACTION ECDlg:End()
ACTIVATE DIALOG ECDlg
oQryEmplC:Refresh()
oBrwCarT:Refresh()
oFont_14:End()
oFont_12:End()
oFont_20:End()
Return Nil
FUNCTION BusCodiEmple(lAppCar2)
If lAppCar2
oQryEE2:=oServer:Query( "SELECT * FROM empremp "+;
" WHERE ncuil = '"+oQryEmpl:Cuil+"' ORDER BY CodigoEE ASC" )
If oQryEE2:LastRec() =0
nCodigo :=oQryEmpl:numedocu+"01"
Else
oQryEE2:GoBottom()
oQryEE2:GetRow()
nCodigo:=STRZERO(VAL(oQryEE2:CodigoEE)+1,10)
EndIf
oQryEE2:End()
EndIf
Return(.T.)
//-------------------------------------------------------------------------//
PROCEDURE GrabarCE(lAppCargo)
oQryEmEmp:Cod_Neg :=oQryEmpr:Cod_Empre
If lAppCargo
oQryEmEmp:lAppend := .T.
oQryEmEmp:CodigoEE :=nCodigo
oQryEmEmp:nCuil :=oQryEmpl:Cuil
EndIf
oQryEmEmp:Save()
Return Nil
//-----------------------------------------------------------------------------------------------
y el error que me arroja es:
- Code: Select all Expand view RUN
Application
===========
Path and name: D:\PROGRAMS\SUELDOSSQL\SuelSQL.exe (32 bits)
Size: 4,185,600 bytes
Compiler version: Harbour 3.2.0dev (r1801051438)
FiveWin version: FWH 17.03
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 1 mins 3 secs
Error occurred at: 21/04/2020, 12:48:41
Error description: Error BASE/1066 Argument error: conditional
Args:
[ 1] = C
Stack Calls
===========
Called from: .\source\classes\WINDOW.PRG => TDIALOG:AEVALWHEN( 2837 )
Called from: .\source\classes\CONTROL.PRG => (b)TCONTROL( 128 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:CLICK( 0 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 668 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 901 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1848 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: d:\programs\sueldossql\prg\Empleado.prg => AGRECARGO( 537 )
Called from: d:\programs\sueldossql\prg\Empleado.prg => (b)EDITEMPLE( 261 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 665 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 901 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1848 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: d:\programs\sueldossql\prg\Empleado.prg => EDITEMPLE( 312 )
Called from: d:\programs\sueldossql\prg\Empleado.prg => (b)BRWBAREMPL( 113 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 665 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 901 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1848 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: d:\programs\sueldossql\prg\Empleado.prg => EMPLEADOS( 76 )
Called from: d:\programs\sueldossql\prg\Suelsql.prg => (b)MAIN( 164 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:CLICK( 717 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 917 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1575 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1036 )
Called from: d:\programs\sueldossql\prg\Suelsql.prg => MAIN( 350 )
System
======
CPU type: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz 2712 Mhz
Hardware memory: 3979 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 5
1 ,
2 , C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.778_none_2e73ee3
3 , D:\PROGRAMS\SUELDOSSQL\SuelSQL.exe
4 DDE Server Window, C:\WINDOWS\System32\OLE32.DLL
5 G, C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.778_none_5f5ee11d821bf28
Variables in use
================
Procedure Type Value
==========================
TDIALOG:AEVALWHEN
Param 1: O Class: ERROR
(b)TCONTROL
Local 1: N 18
Local 2: A Len: 25
Local 3: C ""
Local 4: U
Local 5: U
TCONTROL:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:CLICK
TBTNBMP:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 19
Param 2: N 13
Param 3: N 0
Local 1: L .T.
Local 2: N 0
Local 3: S
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 1245197
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 1245197
DIALOGBOX
Param 1: N 1245197
Param 2: N 514
Param 3: N 0
Param 4: N 1245197
Param 5: N 147
Local 1: O Class: TBTNBMP
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "DATOSPROFE"
Param 3: N 1380442
Param 4: O Class: TDIALOG
AGRECARGO
Param 1: U
Param 2: U
Param 3: U
Param 4: L .F.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Local 1: N 1380442
Local 2: S
Local 3: O Class: TDIALOG
(b)EDITEMPLE
Param 1: L .T.
Param 2: C "0000000000"
Param 3: C "00"
Param 4: C "ABIDO MARIA LUCRECIA "
Local 1: L .F.
Local 2: O Class: TDIALOG
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 34
Param 2: N 11
Param 3: N 0
Local 1: L .T.
Local 2: N 0
Local 3: S
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 2228235
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 2228235
DIALOGBOX
Param 1: N 2228235
Param 2: N 514
Param 3: N 0
Param 4: N 2228235
Param 5: N 101
Local 1: O Class: TBTNBMP
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "DATOSEMPLE"
Param 3: N 786866
Param 4: O Class: TDIALOG
EDITEMPLE
Param 1: U
Param 2: U
Param 3: U
Param 4: L .F.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Local 1: N 786866
Local 2: S
Local 3: O Class: TDIALOG
(b)BRWBAREMPL
Param 1: L .F.
Local 1: L .F.
Local 2: C " "
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 24
Param 2: N 44
Param 3: N 0
Local 1: L .T.
Local 2: N 0
Local 3: S
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 1572908
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 1572908
DIALOGBOXINDIRECT
Param 1: N 1572908
Param 2: N 514
Param 3: N 0
Param 4: N 1572908
Param 5: N 51
Local 1: O Class: TBTNBMP
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "€ È€ Ãû E M P L E A D O S ï €R Ž T B A R 1P
# ¹Ø T X B R O W S E "
Param 3: N 2491980
Param 4: O Class: TDIALOG
EMPLEADOS
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
Local 1: N 2491980
Local 2: S
Local 3: O Class: TDIALOG
(b)MAIN
Param 1: L .T.
TRBTN:CLICK
Param 1: O Class: TRBTN
TRBTN:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 1
Param 2: N 41
Param 3: N 0
Local 1: L .T.
Local 2: L .T.
Local 3: S
TRBTN:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 65577
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 65577
WINRUN
Param 1: N 65577
Param 2: N 514
Param 3: N 0
Param 4: N 65577
Param 5: N 11
Local 1: O Class: TRBTN
TMDIFRAME:ACTIVATE
Param 1: N 2491980
MAIN
Param 1: C "MAXIMIZED"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Param 13: U
Param 14: U
Param 15: U
Param 16: U
Param 17: U
Param 18: U
Param 19: U
Param 20: L .F.
Local 1: O Class: TMDIFRAME
Local 2: U
Local 3: U
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFCDX
DBFNTX
DataBases in use
================
Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TDOLPHINSRV
5 TFONT
6 TMENU
7 TREG32
8 TMENUITEM
9 TWINDOW
10 TMDIFRAME
11 TBRUSH
12 TMDICLIENT
13 TCONTROL
14 TRIBBONBAR
15 TRPANEL
16 TRBGROUP
17 TRBTN
18 TQUICKACCESS
19 TMSGBAR
20 TRECT
21 TMSGITEM
22 TTIMER
23 TDOLPHINQRY
24 TDIALOG
25 TBAR
26 TXBROWSE
27 TXBRWCOLUMN
28 TBTNBMP
29 TSCROLLBAR
30 TBITMAP
31 TIMAGE
32 TGET
33 GET
34 TCLIPGET
35 TRADMENU
36 TRADIO
37 TCOMBOBOX
38 TDBCOMBO
39 TCHECKBOX
40 TSAY
41 TFOLDEREX
42 TSTRUCT
43 TBUTTON
44 TBUTTONBMP
Memory Analysis
===============
396 Static variables
Dynamic memory consume:
Actual Value: 3801088 bytes
Highest Value: 3801088 bytes
Tal vez me estoy ahogando en un baso de agua pero no encuentro la solución
Gracias