lmgrInBatchChange
lmgrInBatchChange() =>t / nil
Description
Checks the cumulative state of batch change mode including that of the active nested scopes. Batch change mode can improve the performance of Library Manager for lmgrSetLibDisplayOverride calls.
If the batch change mode is constantly showing the status as active, a loop using lmgrInBatchChange can assist in ending batch change mode to set the status as inactive.
Arguments
Value Returned
|
Batch change mode is active including the active nested scopes. |
|
Examples
lmgrInBatchChange detecting an intentional error, with a forced reset for recovery.
let( ( ( preInBatch lmgrInBatchChange() ) postInBatch )
; Using errset with set calls to prevent skipping of calling a matching lmgrEndBatchChange
lmgrBeginBatchChange()
lmgrBeginBatchChange() ; Intentional duplicate call error
errset( lmgrSetLibDisplayOverride( list("US_8ths" "basic") ?icon "test.png" ?color "green") t )
errset( lmgrSetLibDisplayOverride( "cdsDefTechLib" ?color "#ff0000" ?icon "locked.png") t )
lmgrEndBatchChange()
; Basic check for maintaining matching pairs of calls
postInBatch = lmgrInBatchChange()
unless( null( postInBatch ) == null( preInBatch )
warn( "Issue detected for matching lmgrBeginBatchChange and lmgrEndBatchChange calls.\n" )
when( postInBatch
; Reset all is not a perfect solution, but may be preferable over no display updates.
while( lmgrInBatchChange()
lmgrEndBatchChange() )
error("Forced a reset by lmgrEndBatchChange to end all batch change modes.\n")
)
)
)
Related Topics
Return to top