toExternal Summary Converts the unsigned short value to its equivalent external value. Usage public override external toExternal() Returns The internal unsigned short value converted to the external type. Description Converts the unsigned short value to its equivalent external value. Examples Basic Usage 1234567891011121314151617181920import 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 SetGroupId : ICommand<UInteger16>{ final void execute(...UInteger16 args) { unsigned short groupId = args[0] ?? 0; mysql.query("UPDATE `users` SET `group_id` = ? WHERE `id` = 1;", groupId.toExternal()); }} auto setGroupIdCommand = new SetGroupId();setGroupIdCommand.execute(100); Share HTML | BBCode | Direct Link