| **Navigation:**  [[advanced topics 1.htm|Advanced Topics]] > Clarion Language Utilities >====== BeginUnique (Set Application to Run in a Single Process) ====== | [[clarion language utilities.htm|{{btn_prev_n.gif|Previous page}}]][[advanced topics 1.htm|{{btn_home_n.gif|Return to chapter overview}}]][[blobtofile copy data from blob field to file .htm|{{btn_next_n.gif|Next page}}]] | | || **BeginUnique( **//applicationname //**//)//** {{blk2blue.jpg|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 close an application s event handle .htm|EndUnique]]