How to prevent a FUNCTION from loading more than once

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
digitsoft
Posts: 472
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

How to prevent a FUNCTION from loading more than once

#1 Post by digitsoft »

How to prevent a FUNCTION from loading more than once
Nolberto Paulino
Regards

User avatar
Tom
Posts: 1296
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: How to prevent a FUNCTION from loading more than once

#2 Post by Tom »

Code: Select all

FUNCTION MyFunction()
STATIC lIAmRunning := .F.
IF lIAmRunning 
  MsgBox('Function runs already')
  RETURN .F.
ENDIF
lIAmRunning := .T.

* CODE 

lIAmRunning := .F.
RETURN xResult
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
digitsoft
Posts: 472
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How to prevent a FUNCTION from loading more than once

#3 Post by digitsoft »

Thanks Tom
Nolberto Paulino
Regards

User avatar
Tom
Posts: 1296
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: How to prevent a FUNCTION from loading more than once

#4 Post by Tom »

De nada. :)
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply