User Tools

Site Tools


beginunique_set_application_to_run_in_a_single_process_.htm
Navigation:  Advanced Topics > Clarion Language Utilities >====== BeginUnique (Set Application to Run in a Single Process) ====== Previous pageReturn to chapter overviewNext page

BeginUnique( applicationname )

blk2blue.jpg

BeginUnique Sets an application to run as a single process
applicationname A string constant or variable that specifies name of your application. Example: 'INVOICE.EXE'

BeginUnique returns FALSE if the program specified in applicationname is already running (active). If not running, BeginUnique returns an event number specified by Windows. This event number can be used by the EndUnique statement to terminate the single process mode.

To add this function to your existing applications, you need only include the CWUTIL.INC file in the Global Map section of your program:

INCLUDE('CWUTIL.INC'),ONCE

Return Data Type:     LONG

Example:

IF NOT BeginUnique(GLO:ApplicationName)

MESSAGE(CLIP(GLO:ApplicationName) & ' already running.')

RETURN

ELSE

RUN(GLO:ApplicationName)

END

See Also:

EndUnique

beginunique_set_application_to_run_in_a_single_process_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1