When having to work and test between UNICODE mode and Compatibility mode, such as when you are woking on a component that will have to operate in both modes, it is nice to have a utility that will quickly toggle the modes and then restart the database to implement the change. Below is a utility that does just that.
$Mode_L:=Get database parameter(Unicode mode )
SET DATABASE PARAMETER(Unicode mode ;1-$Mode_L)
ALERT("Database toggled to \"Compatibility Mode\".\r\rThe database will restart.")
ALERT("Database toggled to \"UNICODE Mode\".\r\rThe database will restart.")
OPEN DATA FILE(Data file)