KB-32070: Opening an E3 application only once.

Question:

How can I open an E3 application with a button, so that this application opens only once?

Solution:

To do so, create an internal tag in the Viewer, and then use the following script in the button’s OnClick() event:


‘Ret receives process’ value
ret = Application.Item(“InternalTag1”).Value
‘No calculator can be opened while the process is running
IF Application.IsAppRunning(ret) then
MsgBox “Calculator is already opened “, 64
else
‘Opens an external application (Windows calculator)
Application.ExecuteExternalApp “calc.exe”, “”, “”, 4, ret
‘Inserts ProcessID’s value in the Internal Tag
Application.Item(“InternalTag1”).Value = ret
END IF

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *