Simplicty and flexibility!

DocumenClose ()

Started by Handles
You will need to Sign In to be able to add or comment on the forum!

DocumenClose ()

Can anyone help with a small but annoying problem , I have two buttons in the same form : one runs a procedure and the other open’s a form, both should shut the selection form after clicking Button.

The one running the procedure works perfect, button two opening the related form will not close the selection form, I can only assume it’s something to do with (FormOpenRelated) .

(SetGlobal 193 should be Check not Chack )

define "act1" text .

define "act2" text .

define "act3" text .

define "act4" text .

act1 := RecordSave () .

act2 := SetGlobal (194, OrderNumber ) .

act3 := DocumentClose () .

act4 := OpenProcedure ("FranksOrderPrint") .

----------------------------------------------------------------------------------------------------------------------------- Above works perfect and as act3 DocumenCloses

define "act1" text .

define "act2" text .

define "act3" text .

define "act4" text .

define "act5" text .

define "act6" text . 

act1 := RecordSave () .

act2 := SetGlobal (194, OrderNumber ) .

act3 := SetGlobal (193,ChackOrderNumber ).

act4 := SetGlobal (123, "AddToOrderChange").

act5 := DocumentClose ().

act6 := FormOpenRelated ("rFPO_ON , FranksPurchaseOrder ").



I Have Tried 

act5 := DocumentClose (). 

act6 := FormOpenRelated ("rFPO_ON , FranksPurchaseOrder ").


act5 := FormOpenRelated ("rFPO_ON , FranksPurchaseOrder ").

act6 := DocumentClose ().

niether way works ...


--------------------------------------------------------------------------------------------------------------------------will not close the document as act5 states.  

Written by Handles 14/03/22 at 11:12:51 LegEasy 6 Windows

Re:DocumenClose ()

This is not as straight forward as you might think and we have explained this before but will never let an "learning opportunity" pass us by ;-)

DocumentClose(), ForOpenRelated() etc or what in DataEase terms are called actions (and in DE6 is actually CDF's) are all based on the signal system in Windows.

This means that it is not functions in the true term but rather messages sent to windows do undertake an action.

So far so good, but what is the implication?

That they are not sent to a specific form/window but to the ACTIVE window.
Add this to the unpredictability of the Windows message queue and you have the perfect storm.

Messages are not processed chronologically but rather on an opportunistic/priority basis (the blessing of multi-tasking).

So in your "sample" the problem is most likely that your documentclose() is sent to the wrong window (from your perspective) or that it gets ignored completely for some reason (swallowed is the term).

We have made a number of functions and events etc. in DE8 to come around this problem but I'm not sure how you can do this in DE6.

In DE8 we have a function which is closed DocumentCloseName() and we also have a timer:event on the form object that one can use to control windows and a number of constants one can query to figure out what windows is active etc.

If one want the best from DataEase it is basically like with every other software, fixes and improvements will only be found in new and not old versions.


Written by DataEase 14/03/22 at 12:24:43 LegEasy 6 Windows

Re:Re:DocumenClose ()

Ok thanks for the very quick reply, and I see your point, I can remember something like this problem many years ago , I can also remember getting arround it with something like wizDocClose (FormName) , I have downloaded the DataEase 8.5 for testing  , I have also imported - migrated my program, My probelm is I'm getting so many errors that are to do with the old way's of doing things and old CDF's  that it will take me many months to overcome the issues , time I dont have right now, and will re-visit It in the future, thanks again and I will try and close the forms  with a procedure somehow or another button.     

Written by Handles 14/03/22 at 13:04:01 LegEasy 6 Windows

Re:Re:Re:DocumenClose ()

The main problem you experience is most likely that the DFWActs was moved from being CDFs to being internal functions from 6.x to 7.x

But what you state is mainly the reason why we keep LegEasy 6 Windows around.

Our LegEasy program is very popular which is why we now are publishing a "stay behind" version for each new DataEase increment as there is many that share your problem when moving from one version to the next and simply don't have the time to do the necessary updating in massive application but still need to follow the Windows versions etc.

The next in line is in fact LE8 which is a modern version of DataEase 8 that is to be released together with DE9.

Written by DataEase 14/03/22 at 18:02:08 LegEasy 6 Windows

Re:Re:Re:Re:DocumenClose ()

Thanks for that information, it will save me many hours of testing time , is it possible to get put on an email list when LegEasy8 is available ? I would be very interested in trying it. And just to close - the wizDocumentClose worked perfect in a procedure, just run it when printing the document.

Written by Handles 15/03/22 at 13:14:54 LegEasy 6 Windows