toExternal Summary Converts the Boolean value to its equivalent external value. Usage public override external toExternal() Returns The Boolean value held by the System.Boolean object. Description Converts the Boolean value to its equivalent external value. Examples Basic Usage 123456789101112131415161718192021222324252627import System; external mysql = { query: function(q, a) { Console.log(q, a); } }; // Constrain type arguments to only classes that can convert to 'external'interface ICommand<T: IExportable>{ void execute(...T args);} class ToggleServer : ICommand<Boolean>{ final void execute(...Boolean args) { bool on = args[0] ?? false; mysql.query( """ INSERT INTO `server`(`on`) VALUES(?) ON DUPLICATE KEY UPDATE `on` = ?; """, on.toExternal(), on.toExternal() ); }} auto toggleServerCommand = new ToggleServer();toggleServerCommand.execute(true); Share HTML | BBCode | Direct Link