Simplicty and flexibility!


Hmm OML no funktion ....


Started by grohmann.papier@t-online.de
Search
You will need to Sign In to be able to add or comment on the forum!

Hmm OML no funktion ....

Hmm
have a problem to me is completely new. In a form no oml codes are executed more. In various fields oml instructions are stored all functioned properly. Then I oml code tested new in another field but then deleted. However, now all oml codes work no longer in the other fields. All fields I checked and all oml codes are here! Will all properly checked and saved when checking. There is no error message. . OML for example in the event VALUE LOADED makes nothing (For example retval: = alert ("test").)
It uses the latest software version.
Best wishes
Markus


Written by grohmann.papier@t-online.de 15/09/16 at 19:25:09 Dataease [{8}]FIVE

Re:Hmm OML no funktion ....

You might be aware that we over the years has gone from being preaching extreme caution to being more open minded about OML.

OML was always there but it was not enabled for users until 6.5 simply because it wasn't made to be accessed.

It offer the programmer extreme freedom but also big risk.

When it was first released it was poorly tested and hence had a lot of problems, that was just enhanced in the code change between 6.x and 7.x.

We have since spent quite a lot of time trying to tame this beast to such an extent that in 8.5 it quite safe if one doesn't push the envelop to much.

The main problems being:
1. Limited space for code, and all code is saved in the same place.
2. The code and the object/event it is attached can mismatch if you insert a new object in the form ahead of the object with the code.

It is pointer based so the object in front point to the next object in the execution three etc.

I think you see where I'm going here. If you are really unlucky and something goes wrong in inserting and deleting a field in the execution order you can actually loose the link with remainder of the objects.

When we crated all the new functions that "replace" a lot of the core functionality of OML from 6.x and 7.x it was so we could give you a safe and solid way of manipulating forms inside the normal DataEase scope.

OML had a bad way of corrupting forms even in DT so you could never open the form again and had to start over. This is 99.99999% fixed now but it is still a risky way of programming so one should keep OML to a minimum and only use it where has its strength i.e. events.

Use it to call stuff on a Timer() etc. but don't use it as your main venue of manipulation.

When you use OML you work in the deeper depths of DataEase so you must be prepared that sometimes there might not be a return road.

However before you give up. Start compiling your code from the beginning so all the objects are recompiled.


Written by DataEase 16/09/16 at 08:56:51 Dataease [{8}]FIVE

Re:Re:Hmm OML no funktion ....

Thanks for the information on OML!
I am still not quite clear how it is meant: Start compiling your code from the beginning so all the objects are recompiled. Comiling from the beginning means what exactly? For example, open each field and save it again? Or do I have to re-create the entire form :(? If the use of OML is so dangerous you should not be on the use of ver EVENTS then? If yes then how can you solve such functions differently?

Best regards and have a nice weekend!
Markus


Written by grohmann.papier@t-online.de 23/09/16 at 09:09:02 Dataease [{8}]FIVE

Re:Re:Re:Hmm OML no funktion ....

Hi Markus.

From beginning means beginning of the object hierarchy. The objects are stored in a linked structure in tab order that is why this list is not alphabetical.

Just start recompiling from the top.

PS! It is the same order in the DropDown Object List.

You might have to re-create the form if it is properly broken. That is why OML is "dangerous" as it can break the form in DT mode too. 

The problem with OML is that it like a lot of dangerous stuff is also "exhilarating". In 7.x it was completely broken and we were tempted to remove it in 8.x as almost no-one dared use it in 7.x.

However there is a couple of very good reasons not to:

1. You can't really remove anything that is being used as you then go backwards and it is not a good value proposition to put forward men people upgrade.

2. It is quite easy to emulate functionality like form loaded or value loaded in virtual fields, but you can't emulate events like mouse over and the new Timer() even.

Events are windows so when there are no alternative method for events then OML is the only way.

We have improved OML tremendously in 8 and we have almost no reports of problems anymore, but as with all programming there are risk and cases where things go haywire.

OML is "safe" but it is a know problem that you might upset your OML if you move things a lot in a form or insert objects that change around on the order, but that too is much improved. In 7 this would have been a guaranteed disaster.

Our recommendation is to use virtual fields and execdql for all the main manipulations that happens on form open, new record etc, and then only OML when it is truly event driven.There is also a limit to how much OML you can have on a form and they all add up and for some strange reason it is the addition of OML and Help text together that adds up to this limit.


We will soon introduce proper HTML forms and you will then use JavaScript etc for this rather than OML and the problem will be solved in new forms.


Written by DataEase 24/09/16 at 06:22:45 Dataease [{8}]FIVE
DG3_ForumList