Example:

(As taken from the selector switch)

 

Init [

 

If \ValueSyncService\Started WaitRegister;

  [

 

    Root = Self;

 

     { Register with the ValueSyncService - save processing by

       registering for the first instance only }

    IfThen(!Valid(SyncedVars),

       { SyncedVars is a SHARED array, we must be the first instance }

      SyncedVars    = New(2);

      SyncedVars[0] = "SaveValue";

      SyncedVars[1] = "RequestedValue";

    );

 

    \ValueSyncService\Register(Root, &RegisterDone, SyncedVars);

 

     { Set up initial values }

    Refresh();

    {… }

]

 

WaitRegister [

 If RegisterDone Main;

]