>Hi all:
>
>How do I check to see if a form is already running on THIS machine? In the example below the 'showform' property of the form is set to 2 - as top-level form.
>
>In other words, I don't care if it is running on some other machine, but if it is running on THIS machine, I do not want a second instance. In that case, I want to kill the old instance before executing this instance.
>
>BTW, how do check if it is running on ANY machine?
>
>Thanks,
>
>Yossi
>
>
>If form 'spform' is already running
> display message asking to kill the old instance
> if Yes
> kill the old instance
> else
> get out
> endif
>endif
>
>DO FORM sp NAME spform
>READ EVENTS
>
As Borislav pointed out you need to run through __SCREEN.FORMS. for each form. Identify the scx with SY(1271,oForm) or the class with oForm.CLASS; oForm.CLASSLIBRARY. To look at oform.NAME might not be the solution.
-A forms (objects) name can be altered at runtime (oForm.NAME = 'BlaBla' works fine)
-A form that is run again will be Form1 or the like to make it distinct from the first instance.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]