check on get

User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

check on get

Post by Silvio.Falconi »

I would like to check if any get is modified during editing, if it is modified the procedure must ask the user to save or not

when the user presses "Exit" I wanted to check if the gets have been modified

I made

Code: Select all | Expand

#include"fivewin.ch"

Function test()
local aGet:=array(2)
local oDlg
local cGet1:=space(60)
local cGet2:=space(60)
local lSave:=.f.
local bCheck
local oBtn1,oBtn2

DEFINE DIALOG oDLG SIZE 400,200

@ 10,10 GET aGet[1] VAR cGet1 SIZE 100,10 PIXEL of oDlg
@ 40,10 GET aGet[2] VAR cGet2 SIZE 100,10 PIXEL of oDlg

 @  90,  55  BUTTON oBtn1 Prompt "&OK" SIZE  45,  10 PIXEL  OF oDlg ACTION  ( oDlg:end( IDOK ) )
 @  90,  107 BUTTON oBtn2  Prompt "&EXIT"  SIZE  45,  10 PIXEL  OF oDlg ACTION ( oDlg:end( IDCANCEL ) )
       *  
bCheck:= { || lSave:= IIF(Msgyesno("I must save ?"),.t.,.f.), oDLG:AEvalWhen(), .t. }

AEval( aGet, { |o| o:bChange :=  bCheck } )

ACTIVATE DIALOG oDLG CENTER ON INIT EVAL(bCheck)

IF lSave
//---- save
Endif
return nil 

 
I made also

AEval(aGet,{|oGet| oGet:bChange:={||lSave:= IIF(Msgyesno("I must save ?"),.t.,.f.)}})

but not run ok,How I can resolve ?
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
Marc Venken
Posts: 1481
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: check on get

Post by Marc Venken »

There will be better ways, but i would think of making the aGet 2 dimensional and fill the second part with the original data.
After edit you could simple check the values for differences in the aGet
Marc Venken
Using: FWH 23.08 with Harbour
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: check on get

Post by karinha »

yo haria asi:

Code: Select all | Expand

// C:\FWH\SAMPLES\SILVICHK.PRG

#include "FiveWin.ch"

STATIC lSave := .F.

FUNCTION Main()

   LOCAL aGet := ARRAY( 2 )
   LOCAL oDlg
   LOCAL cGet1 := SPACE( 60 )
   LOCAL cGet2 := SPACE( 60 )
   LOCAL bCheck
   LOCAL oBtn1, oBtn2

   DEFINE DIALOG oDlg SIZE 400, 200

   @ 10,  10 GET aGet[ 1 ] VAR cGet1 SIZE 100, 10 PIXEL OF oDlg

   @ 40,  10 GET aGet[ 2 ] VAR cGet2 SIZE 100, 10 PIXEL OF oDlg

   @ 90,  55 BUTTON oBtn1 PROMPT "&OK" SIZE 45, 10 PIXEL OF oDlg ;
      ACTION ( lSave := .T., oDlg:End() )  // IDOK ?? .RC? NO COMPRENDO ESTO

   @ 90, 107 BUTTON oBtn2  PROMPT "&EXIT" SIZE 45, 10 PIXEL OF oDlg ;
      ACTION ( lSave := .F., oDlg:End() ) CANCEL // IDCANCEL // ??

   // bCheck := {|| lSave := iif( Msgyesno( "I must save ?" ), .T., .F. ), oDlg:AEvalWhen(), .T. }

   // bCheck := {|| lSave := iif( Msgyesno( "I must save ?" ), .T., .F. ), oDlg:End(), .T. }

   // AEval( aGet, {| o | o:bChange :=  bCheck } )

   ACTIVATE DIALOG oDlg CENTER // ON INIT Eval( bCheck )

   IF lSave

      // ---- save
      ? "Grabar? ", lSave  // .T.

      // Graba_Todo()

   ENDIF

   lSave := .F.  // al salir.

RETURN NIL
// FIN / END
 
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: check on get

Post by nageswaragunupudi »

FWH provides a way for the last many years.

if oGet:lChanged is true, the value is edited and modified.
We can also check the original value with oGet:uOriginalValue.
Regards

G. N. Rao.
Hyderabad, India
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: check on get

Post by karinha »

nageswaragunupudi wrote:FWH provides a way for the last many years.

if oGet:lChanged is true, the value is edited and modified.
We can also check the original value with oGet:uOriginalValue.
Mister Rao:

https://forums.fivetechsupport.com/view ... d3#p218742

Master Rao:

Sorry for the stupidity, but I've never seen anything like this working. Do you have any practical example of using these commands?

Perdón por la estupidez, pero nunca había visto algo así funcionando. ¿Tiene algún ejemplo práctico del uso de estos comandos?

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: check on get

Post by Silvio.Falconi »

Nages,
I'm making a complex but simple procedure to be able to use it even for those who don't have the latest version of fwh, it's a utility that I started a long time ago and then left because I was hoping for other procedures started by certain people who then didn't have having completed the work and now I see it quicker and at the same time powerful to use this type of procedure, even if it is ancient, to enhance some of the aspects necessary for those who program with fwh, in the future it could also be used for those who want to create procedures for web because if you want you can convert it for the web.
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: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: check on get

Post by Silvio.Falconi »

karinha wrote:yo haria asi:

Code: Select all | Expand

// C:\FWH\SAMPLES\SILVICHK.PRG

#include "FiveWin.ch"

STATIC lSave := .F.

FUNCTION Main()

   LOCAL aGet := ARRAY( 2 )
   LOCAL oDlg
   LOCAL cGet1 := SPACE( 60 )
   LOCAL cGet2 := SPACE( 60 )
   LOCAL bCheck
   LOCAL oBtn1, oBtn2

   DEFINE DIALOG oDlg SIZE 400, 200

   @ 10,  10 GET aGet[ 1 ] VAR cGet1 SIZE 100, 10 PIXEL OF oDlg

   @ 40,  10 GET aGet[ 2 ] VAR cGet2 SIZE 100, 10 PIXEL OF oDlg

   @ 90,  55 BUTTON oBtn1 PROMPT "&OK" SIZE 45, 10 PIXEL OF oDlg ;
      ACTION ( lSave := .T., oDlg:End() )  // IDOK ?? .RC? NO COMPRENDO ESTO

   @ 90, 107 BUTTON oBtn2  PROMPT "&EXIT" SIZE 45, 10 PIXEL OF oDlg ;
      ACTION ( lSave := .F., oDlg:End() ) CANCEL // IDCANCEL // ??

   // bCheck := {|| lSave := iif( Msgyesno( "I must save ?" ), .T., .F. ), oDlg:AEvalWhen(), .T. }

   // bCheck := {|| lSave := iif( Msgyesno( "I must save ?" ), .T., .F. ), oDlg:End(), .T. }

   // AEval( aGet, {| o | o:bChange :=  bCheck } )

   ACTIVATE DIALOG oDlg CENTER // ON INIT Eval( bCheck )

   IF lSave

      // ---- save
      ? "Grabar? ", lSave  // .T.

      // Graba_Todo()

   ENDIF

   lSave := .F.  // al salir.

RETURN NIL
// FIN / END
 
Regards, saludos.

Karinha,
what do you mean by "NO COMPRENDO ESTO" ?

Code: Select all | Expand

DEFINE DIALOG oDlg
 @  80,  55  BUTTON oBtn1 Prompt "&OK" SIZE  45,  10 PIXEL  OF oDlg ACTION  ( oDlg:end( IDOK ) )
 @  80,  107 BUTTON oBtn2  Prompt "&EXIT"  SIZE  45,  10 PIXEL  OF oDlg ACTION  (oDlg:end( IDCANCEL ) )
ACTIVATE DIALOG oDlg

IF  oDlg:nresult == IDOK
     Msginfo()
Endif
what is difficult?
bother variable of the type "lsave:= .t. or lsave:= .f." It's just for kids, it seems like you're still programming with the clipper
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: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: check on get

Post by Silvio.Falconi »

nageswaragunupudi wrote:FWH provides a way for the last many years.

if oGet:lChanged is true, the value is edited and modified.
We can also check the original value with oGet:uOriginalValue.

Nages,
I not understood
I tried to found the result of oGet:lchanged and give me no exist

Code: Select all | Expand

Error occurred at: 27-11-2023, 11:06:45
   Error description: Error BASE/1004  Metodo non disponibile: LCHANGED
   Args:
     [   1] = U  

Code: Select all | Expand

 AEval(aGet,{|oGet| IIF( oGet:lChanged, lSave:= IIF(Msgyesno("I must save ?"),.t.,.f.),) , oDLG:AEvalWhen(), .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
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: check on get

Post by nageswaragunupudi »

I tried to found the result of oGet:lchanged and give me no exist

Code:
Error occurred at: 27-11-2023, 11:06:45
Error description: Error BASE/1004 Metodo non disponibile: LCHANGED
Args:
[ 1] = U
This error means that oGet is NIL
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: check on get

Post by Silvio.Falconi »

nageswaragunupudi wrote:
I tried to found the result of oGet:lchanged and give me no exist

Code:
Error occurred at: 27-11-2023, 11:06:45
Error description: Error BASE/1004 Metodo non disponibile: LCHANGED
Args:
[ 1] = U
This error means that oGet is NIL
Can you make a sample with lChanged pls ?
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
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: check on get

Post by karinha »

what is difficult?
bother variable of the type "lsave:= .t. or lsave:= .f." It's just for kids, it seems like you're still programming with the clipper
Silvio, I learned to program in CLIPPER 5.3 and I continue to use the CLIPPER 5.3 modus operandi to this day. And I don't want to program in the way you program even in the next incarnation. I prefer programming for children. The day I program the way you program or treat people, I'd rather retire.

Silvio, aprendí a programar en CLIPPER 5.3 y sigo usando el modus operandi de CLIPPER 5.3 hasta el día de hoy. Y no quiero programar de la forma en que ustedes programan ni siquiera en la próxima encarnación. Prefiero la programación para niños. El día que programe la forma en que usted programa o trata a las personas, preferiría retirarme

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: check on get

Post by Silvio.Falconi »

Dear sir, I started a long time before you, with the Autumn 86 version of the Nuntucket Clipper, then I moved on to the Summer 87 version, that is, many years before the Clipper became Ca-Associates who killed the clipper with version 5.3, then we moved on to Clip4win, tried Alaska, and then Harry Evans, an Austrian from Momos clipper magazine in Bolzano, sold us the first version of the fivewin libraries version 1.44, then I purchased the Fw 19.5 version from Linares and so on up to the present day all or almost all versions purchased from Linares.


Every time I ask for help I should change the code to make you happy and I never find the answer to the requested question, I only get help when the fwteam or some other good person answers me, still today I can't understand why you, dear sir, are a moderator of the forum
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
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: check on get

Post by karinha »

Silvio.Falconi wrote:Dear sir, I started a long time before you, with the Autumn 86 version of the Nuntucket Clipper, then I moved on to the Summer 87 version, that is, many years before the Clipper became Ca-Associates who killed the clipper with version 5.3, then we moved on to Clip4win, tried Alaska, and then Harry Evans, an Austrian from Momos clipper magazine in Bolzano, sold us the first version of the fivewin libraries version 1.44, then I purchased the Fw 19.5 version from Linares and so on up to the present day all or almost all versions purchased from Linares.


Every time I ask for help I should change the code to make you happy and I never find the answer to the requested question, I only get help when the fwteam or some other good person answers me, still today I can't understand why you, dear sir, are a moderator of the forum
Silvio, I am a moderator precisely because of people like you. Arrogant, rude, and other predicates that I will not mention here, as my education does not allow it. And I have no problem if Master Linãres takes away my powers, I will face you as MODERATOR or not. My duty is to fight BAD people like you.

Silvio, soy moderador precisamente por gente como tú. Arrogante, grosero y otros predicados que no mencionaré aquí, ya que mi educación no me lo permite. Y no tengo ningún problema si el Maestro Linãres me quita los poderes, te enfrentaré como MODERADOR o no. Mi deber es luchar contra la gente MALA como tú.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Otto
Posts: 6380
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: check on get

Post by Otto »

Dear João,
Did you know that in our FW-samples we have a program called moon.prg?

It calculates the phases of the full moon.
I've been conducting an empirical study for many years on people's behavior during the full moon. In the company, we send out warning emails,
as people in support become extremely unpleasantly demanding during this time.

The last full moon in 2023 was on November 26th.

Unfortunately, I discovered this connection too late in life. Many things are easier in dealing with people when you are aware of this.

Don't take posts too seriously during this time and don't get drawn into arguments.

Thank you for your valuable work here in the forum.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: check on get

Post by karinha »

Master Otto, I thank you for the advice. I'm a calm and peaceful person, but I don't have cockroach blood. I apologize if I hurt anyone in any way. Silvio Falconi has the gift of blowing anyone away, in any phase of the moon. hahahahahaha, 1000 apologies mister Otto.

Maestro Otto, le agradezco el consejo. Soy una persona tranquila y pacífica, pero no tengo sangre de cucaracha. Pido disculpas si lastimé a alguien de alguna manera. Silvio Falconi tiene el don de dejar boquiabierto a cualquiera, en cualquier fase de la luna. jajajajajaja, 1000 disculpas señor Otto.


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Post Reply