| View previous topic :: View next topic |
| Author |
Message |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sat Jul 06, 2002 7:26 pm Post subject: A run-once code |
|
|
Hello, here is a code to set your program to run once...
Put ,CLASS TDlgProgName after DIALOG CREATE
| Code: |
IF @EQUAL(@REGREAD(CURUSER,PROGRAMNAME,RUNONCE),1)
IF @WINEXISTS(#TDlgProgName)
WINDOW ACTIVATE,#TDlgProgName
STOP
END
END
|
| Code: |
:CLOSE
REGISTRY WRITE,CURUSER,PROGRAMNAME,RUNONCE,0
EXIT
|
Last edited by Skit3000 on Sun Jul 07, 2002 8:29 am; edited 1 time in total |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Sat Jul 06, 2002 9:06 pm Post subject: |
|
|
Why not simply do the following?
| Code: |
IF @WINEXISTS(#TDlgProgName)
WINDOW ACTIVATE,#TDlgProgName
STOP
END
|
Tommy |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Jul 07, 2002 8:32 am Post subject: |
|
|
Well, if there is another program with the same class name, you can't start your own!
Now you can look if the #TDlgProgName is really your program...  |
|
| Back to top |
|
 |
|