posible bug en clausula WHEN de GET (Solucionado)

posible bug en clausula WHEN de GET (Solucionado)

Postby Maggiro » Wed May 04, 2016 4:10 pm

Buenos Dias Sr. Antonio:
Experimento cierto extraño comportamiento
al momento de poner clausulas WHEN en dialogo con varios GETS

tengo un primer get cuyo VALID llama a otro dialogo
y cuando el retorno debe seguir y entrar al segundo get de parada se pasa de largo
y si en el siguiente get hay un when perdio totalmente el foco.

mi pregunta
es posible controlar el comportamiento de clausula WHEN?

Muchas gracias por vuestra respuesta.
Julio César Gómez Cortéz
Godryc Experiencias
Lima Perú
Last edited by Maggiro on Sun May 22, 2016 12:43 am, edited 1 time in total.
User avatar
Maggiro
 
Posts: 84
Joined: Thu Oct 14, 2010 3:26 am
Location: LIMA - PERU

Re: posible bug en clausula WHEN de GET

Postby Antonio Linares » Wed May 04, 2016 4:46 pm

Julio César,

Este ejemplo aqui funciona correctamente. Puedes probarlo ?

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg, c1 := Space( 10 ), c2 := Space( 10 ), c3 := Space( 10 )
   
   DEFINE DIALOG oDlg
   
   @ 1, 1 GET c1 OF oDlg VALID Segundo()

   @ 2, 1 GET c2 OF oDlg VALID Segundo()

   @ 3, 1 GET c3 OF oDlg VALID Segundo() WHEN .T.

   ACTIVATE DIALOG oDlg CENTERED

return nil

function Segundo()

   local oDlg
   
   DEFINE DIALOG oDlg
   
   ACTIVATE DIALOG oDlg CENTERED
   
return .T.  
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: posible bug en clausula WHEN de GET

Postby Maggiro » Mon May 16, 2016 4:57 pm

Buenos Dias Sr. Antonio:

La Rutina que me congela el dialogo:

Code: Select all  Expand view

#include "FiveWin.ch"

MEMVAR k01,k02,k03,k04,k05,k06,k07,k08,k09,k10
MEMVAR k11,k12,k13,k14,k15,k16,k17,k18,k19,k20
MEMVAR k21,k22,k23
MEMVAR kvf3

FUNCTION Main()
   LOCAL DiProb,GeProb
   SetGetColorFocus( RGB(247,208,136) )
   STOR SPAC(1) TO k07,k08,k23
   k15=SPAC(2)
   STOR SPAC(4) TO k03,k16
   k01=SPAC(6)
   k06=SPAC(7)
   k17=SPAC(8)
   STOR SPAC(10) TO k04,k05
   k09=SPAC(28)
   STOR SPAC(50) TO k02,k10
   STOR 0 TO k11,k12,k13,k14,k18,k19,k20,k21,k22
   DEFINE DIALOG DiProb NAME '#2003'
      REDEFINE GET GeProb VAR k01 ID 201 OF DiProb PICTURE '999999' UPDATE VALID Segu(DiProb)
      REDEFINE GET GeProb VAR k02 ID 202 OF DiProb UPDATE
      REDEFINE GET GeProb VAR k03 ID 203 OF DiProb PICTURE '999!' UPDATE WHEN k03=SPAC(4) VALID Terc(DiProb)
      REDEFINE GET GeProb VAR k04 ID 204 OF DiProb UPDATE
      REDEFINE GET GeProb VAR k05 ID 205 OF DiProb UPDATE
      REDEFINE GET GeProb VAR k06 ID 206 OF DiProb UPDATE
      REDEFINE GET GeProb VAR k07 ID 207 OF DiProb UPDATE
      REDEFINE GET GeProb VAR k08 ID 208 OF DiProb PICTURE '9' UPDATE WHEN k08=SPAC(1)
      REDEFINE GET GeProb VAR k09 ID 209 OF DiProb UPDATE
      REDEFINE GET GeProb VAR k10 ID 210 OF DiProb UPDATE WHEN k08='4' .AND. k10=SPAC(50)
      REDEFINE GET GeProb VAR k11 ID 211 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k12 ID 212 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k13 ID 213 OF DiProb PICTURE '9999' UPDATE WHEN k19==0
      REDEFINE GET GeProb VAR k14 ID 214 OF DiProb PICTURE '9999' UPDATE WHEN k19==0
      REDEFINE GET GeProb VAR k15 ID 215 OF DiProb PICTURE '@!' UPDATE
      REDEFINE GET GeProb VAR k16 ID 216 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k17 ID 217 OF DiProb PICTURE '99999999' UPDATE
      REDEFINE GET GeProb VAR k18 ID 218 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k19 ID 219 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k20 ID 220 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k21 ID 221 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k22 ID 222 OF DiProb PICTURE '9999' UPDATE
      REDEFINE GET GeProb VAR k23 ID 223 OF DiProb PICTURE '9' UPDATE WHEN ROUND(k22,2)>0.00
      REDEFINE BUTTON ID 301 OF DiProb
   ACTIVATE DIALOG DiProb
RETU nil

FUNCTION Segu(DiProb)
   LOCAL DiSegu
   DEFINE DIALOG DiSegu
   ACTIVATE DIALOG DiSegu
   k01='000001'
   k02='Soy un nuevo alumno'
   DiProb:Update()
RETU .T.

FUNCTION Terc(DiProb)
   LOCAL DiTerc
   DEFINE DIALOG DiTerc
   ACTIVATE DIALOG DiTerc
   k03='113A'
   k04='DIURNO'
   k05='INICIAL'
   k06='3 AÑOS'
   k07='A'
   k08='1'
   k09='Nuevo'
   DiProb:Update()
RETU .T.
 


y el recurso es :

Code: Select all  Expand view

// RESOURCE SCRIPT generated by "Pelles C for Windows, version 7.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_SPANISH,SUBLANG_SPANISH_PERU

2003 DIALOGEX DISCARDABLE 14, 68, 353, 222
STYLE DS_SHELLFONT|WS_POPUP|WS_VISIBLE
FONT 8, "Tahoma", 0, 0, 1
{
  CONTROL "", 401, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 4, 4, 344, 16
  CONTROL "", 402, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 4, 20, 60, 16
  CONTROL "", 403, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 64, 20, 68, 16
  CONTROL "", 404, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 132, 20, 72, 16
  CONTROL "", 405, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 204, 20, 68, 16
  CONTROL "", 406, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 272, 20, 56, 16
  CONTROL "", 407, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 328, 20, 20, 16
  CONTROL "", 408, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 4, 36, 156, 16
  CONTROL "", 409, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 160, 36, 188, 16
  CONTROL "", 410, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 4, 52, 52, 32
  CONTROL "", 411, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 56, 52, 84, 16
  CONTROL "", 412, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 140, 52, 28, 32
  CONTROL "", 413, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 168, 52, 84, 32
  CONTROL "", 414, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 252, 52, 96, 16
  CONTROL "", 415, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 56, 68, 84, 16
  CONTROL "", 416, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 252, 68, 96, 16
  CONTROL "", 417, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 4, 84, 112, 16
  CONTROL "", 418, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 116, 84, 88, 16
  CONTROL "", 419, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 204, 84, 60, 16
  CONTROL "", 420, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 264, 84, 84, 16
  CONTROL "", 421, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 4, 108, 56, 48
  CONTROL "", 422, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 60, 108, 84, 16
  CONTROL "", 423, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 180, 108, 68, 48
  CONTROL "", 424, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 248, 108, 100, 16
  CONTROL "", 425, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 60, 124, 84, 16
  CONTROL "", 426, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 248, 124, 100, 16
  CONTROL "", 427, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 60, 140, 84, 16
  CONTROL "", 428, "Static", SS_GRAYFRAME|SS_CENTERIMAGE, 248, 140, 100, 16
  CONTROL "Alumno :", 101, "Static", SS_RIGHT|WS_GROUP, 8, 8, 30, 8
  CONTROL "Salon :", 102, "Static", SS_RIGHT|WS_GROUP, 8, 24, 24, 8
  CONTROL "Turno :", 103, "Static", SS_RIGHT|WS_GROUP, 68, 24, 24, 8
  CONTROL "Nivel :", 104, "Static", SS_RIGHT|WS_GROUP, 136, 24, 22, 8
  CONTROL "Grado :", 105, "Static", SS_RIGHT|WS_GROUP, 208, 24, 25, 8
  CONTROL "Sección :", 106, "Static", SS_RIGHT|WS_GROUP, 276, 24, 32, 8
  CONTROL "Situación :", 107, "Static", SS_RIGHT|WS_GROUP, 8, 40, 35, 8
  CONTROL "Procedencia :", 108, "Static", SS_RIGHT|WS_GROUP, 164, 40, 45, 8
  CONTROL "Tarifa Inicial :", 109, "Static", SS_RIGHT|WS_GROUP, 8, 56, 43, 8
  CONTROL "Matricula S/.", 110, "Static", SS_RIGHT|WS_GROUP, 60, 56, 42, 8
  CONTROL "Pension S/.", 111, "Static", SS_RIGHT|WS_GROUP, 60, 72, 42, 8
  CONTROL "Descuento Concedido :", 112, "Static", SS_RIGHT|WS_GROUP, 172, 56, 76, 8
  CONTROL "Por Matricula S/.", 113, "Static", SS_RIGHT|WS_GROUP, 256, 56, 55, 8
  CONTROL "Por Pension S/.", 114, "Static", SS_RIGHT|WS_GROUP, 256, 72, 55, 8
  CONTROL "Comprobante de Pago Emitido :", 115, "Static", SS_RIGHT|WS_GROUP, 8, 88, 101, 8
  CONTROL "Tipo Documento :", 116, "Static", SS_RIGHT|WS_GROUP, 120, 88, 57, 8
  CONTROL "Serie :", 117, "Static", SS_RIGHT|WS_GROUP, 208, 88, 22, 8
  CONTROL "Número :", 118, "Static", SS_RIGHT|WS_GROUP, 268, 88, 30, 8
  CONTROL "Transacción :", 119, "Static", SS_RIGHT|WS_GROUP, 8, 112, 45, 8
  CONTROL "Importe S/.", 120, "Static", SS_RIGHT|WS_GROUP, 64, 112, 43, 8
  CONTROL "A Cuenta S/.", 121, "Static", SS_RIGHT|WS_GROUP, 64, 128, 43, 8
  CONTROL "Resta S/.", 122, "Static", SS_RIGHT|WS_GROUP, 64, 144, 43, 8
  CONTROL "Detalle de Cobro :", 123, "Static", SS_RIGHT|WS_GROUP, 184, 112, 58, 8
  CONTROL "Pago Caja S/.", 124, "Static", SS_RIGHT|WS_GROUP, 252, 112, 60, 8
  CONTROL "Vuelto S/.", 125, "Static", SS_RIGHT|WS_GROUP, 252, 128, 60, 8
  CONTROL "[1]Créd [2]Redo :", 126, "Static", SS_RIGHT|WS_GROUP, 252, 144, 60, 8
  CONTROL "", 201, "Edit", WS_TABSTOP, 40, 8, 30, 8
  CONTROL "", 202, "Edit", 0x00000000, 76, 8, 268, 8
  CONTROL "", 203, "Edit", WS_TABSTOP, 36, 24, 24, 8
  CONTROL "", 204, "Edit", 0x00000000, 96, 24, 32, 8
  CONTROL "", 205, "Edit", 0x00000000, 160, 24, 40, 8
  CONTROL "", 206, "Edit", 0x00000000, 236, 24, 30, 8
  CONTROL "", 207, "Edit", 0x00000000, 312, 24, 12, 8
  CONTROL "", 208, "Edit", WS_TABSTOP, 48, 40, 12, 8
  CONTROL "", 209, "Edit", 0x00000000, 64, 40, 90, 8
  CONTROL "", 210, "Edit", WS_TABSTOP, 212, 40, 132, 8
  CONTROL "", 211, "Edit", 0x00000000, 108, 56, 25, 8
  CONTROL "", 212, "Edit", 0x00000000, 108, 72, 25, 8
  CONTROL "", 213, "Edit", WS_TABSTOP, 316, 56, 25, 8
  CONTROL "", 214, "Edit", WS_TABSTOP, 316, 72, 25, 8
  CONTROL "", 215, "Edit", WS_TABSTOP, 184, 88, 16, 8
  CONTROL "", 216, "Edit", WS_TABSTOP, 232, 88, 25, 8
  CONTROL "", 217, "Edit", WS_TABSTOP, 300, 88, 40, 8
  CONTROL "", 218, "Edit", 0x00000000, 112, 112, 25, 8
  CONTROL "", 219, "Edit", 0x00000000, 112, 128, 25, 8
  CONTROL "", 220, "Edit", 0x00000000, 112, 144, 25, 8
  CONTROL "", 221, "Edit", 0x00000000, 316, 112, 25, 8
  CONTROL "", 222, "Edit", 0x00000000, 316, 128, 25, 8
  CONTROL "", 223, "Edit", WS_TABSTOP, 316, 144, 16, 8
  CONTROL "Registrar", 301, "Button", WS_TABSTOP, 152, 172, 48, 16
}
 


Saludos
Julio César Gómez Cortéz
Godryc Experiencias
Lima Perú
User avatar
Maggiro
 
Posts: 84
Joined: Thu Oct 14, 2010 3:26 am
Location: LIMA - PERU

Re: posible bug en clausula WHEN de GET

Postby karinha » Mon May 16, 2016 6:17 pm

Code: Select all  Expand view

Borland Resource Compiler  Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation.  All rights reserved.

Error congela.RC 14 25: Expecting BEGIN
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: posible bug en clausula WHEN de GET

Postby Antonio Linares » Tue May 17, 2016 5:07 pm

Cual de esos GETs es el que te da el problema ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: posible bug en clausula WHEN de GET

Postby Maggiro » Thu May 19, 2016 3:02 pm

El problema surge cuando salgo del valid en el tercer GET (segundo tabstop) "salon"
y lo que he apreciado es que Fivewin
1 Marca el siguiente tabstop antes de abrir el tercer dialogo
2 Cuando regresa y la siguiente variable no ha cambiado internamente en su valor
SI se posiciona en el siguiente Get con tabstop (el que marcó antes)
3 Cuando regresa y la siguiente variable si ha cambiado internamente en su valor
el When no permite la entrada
4 En el caso 3 esperaba que el When, dado que no permite la entrada, obligue al dialogo
a que pase a leer el siguiente tabstop disponible, y entonces, me di
con la sorpresa que la no permision rebota hacia el valid del get anterior haciendo repetir
la operacion interna (lo que me duplicaba acumulacion de valores en variables) y congelando
el dialogo.
User avatar
Maggiro
 
Posts: 84
Joined: Thu Oct 14, 2010 3:26 am
Location: LIMA - PERU

Re: posible bug en clausula WHEN de GET

Postby Antonio Linares » Thu May 19, 2016 6:26 pm

Intenta proporcionar un ejemplo que reproduzca el problema
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: posible bug en clausula WHEN de GET (Solucionado)

Postby Maggiro » Sun May 22, 2016 12:48 am

Sr. Antonio:
Solucione el problema quitando las clausulas WHEN en todos los GETS con TABSTOP
cuyas variables podrían cambiar su valor internamente
y Redirigiendo el foco directamente al próximo GET donde debería detenerse.

Muchas gracias por su atención!!
Saludos
Julio César Gómez Cortéz
Godryc Experiencias
Lima Perú
User avatar
Maggiro
 
Posts: 84
Joined: Thu Oct 14, 2010 3:26 am
Location: LIMA - PERU

Re: posible bug en clausula WHEN de GET (Solucionado)

Postby xmanuel » Sun May 22, 2016 10:34 am

Julio Cesar el problema puede que sea la sobrecarga del "=", como bien sabes vale para asignar y para comparar...

Desde la epoca de clipper 5.3 yo me he acostumbrado a usar ":=" para asignar y "==" para comparar, de este modo te quitas de muchos problemas :D
prueba a cambiar
REDEFINE GET GeProb VAR k03 ID 203 OF DiProb PICTURE '999!' UPDATE WHEN k03=SPAC(4) VALID Terc(DiProb)
por
REDEFINE GET GeProb VAR k03 ID 203 OF DiProb PICTURE '999!' UPDATE WHEN k03==SPAC(4) VALID Terc(DiProb)
salvo que quisieras asignar espacios a k03, si es asi cambia a esto
REDEFINE GET GeProb VAR k03 ID 203 OF DiProb PICTURE '999!' UPDATE WHEN ( k03:=SPAC(4), .t. ) VALID Terc(DiProb)
lo demás cambialo en ese sentido...

Aunque tarde espero haberte aclarado algo :lol: :roll:

PD: para saber si un valor está vacio es mejor usar la funcion empty( k03 ), quedaria de esta manera así:
REDEFINE GET GeProb VAR k03 ID 203 OF DiProb PICTURE '999!' UPDATE WHEN empty( k03 ) VALID Terc(DiProb)
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 762
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla


Return to FiveWin para Harbour/xHarbour

Who is online

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