PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > CRITSECT command
CRITSECT command

Allows to solve PC resources access conflicts, if LAUNCHER Office server is configured to accept several concurrent connections.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('CRITSECT')

CHGVAR

VAR(&PARM1) VALUE('Name=NAME" [;Enter] | [;Leave]')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

Parameters

 

Parameters

 

Parm1

Name : Symbolic resource name.

Enter : Points out an application critical phase beginning. It will end with a CRITSECT command with the Leave option, on the same resource.

Leave : Points out an application critical phase ending. Another application can enter into it.

 

Parm2

 

 

Refer to Multiple connection mode.

When an application must use a shared PC resource, clipboard or a job file, it must enter to a critical phase and leave it when the resource use is completed.

Application will stand-by if another application is already in the same critical phase until it is released.

Resource name is a virtual name sets by the application.

 

Example

 

CHGVAR VAR(&CMD) VALUE('CRITSECT')
CHGVAR VAR(&PARM1) VALUE('Name="PhaseCrit";Enter')
CALL  PGM(LNCCMD) PARM(&HANDLE &OPT &PARM1 &PARM2 &RESULT)

 

/* Copy to clipboard */
CHGVAR VAR(&CMD) VALUE('WCOPY')
CALL  PGM(LNCCMD) PARM(&HANDLE &OPT &PARM1 &PARM2 &RESULT)


/* Paste to clipboard */
CHGVAR VAR(&CMD) VALUE('WPASTE')
CALL  PGM(LNCCMD) PARM(&HANDLE &OPT &PARM1 &PARM2 &RESULT)

 

/* Exit now */

CHGVAR VAR(&CMD) VALUE('CRITSECT')
CHGVAR VAR(&PARM1) VALUE('Name="PhaseCrit";Leave')
CALL  PGM(LNCCMD) PARM(&HANDLE &OPT &PARM1 &PARM2 &RESULT)