toExternal

Summary

Converts the signed byte value to its equivalent external value.

Usage

public override external toExternal()

Returns

The internal signed byte value converted to the external type.

Description

Converts the signed byte value to its equivalent external value.

Examples

Basic Usage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import 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<Integer8>
{
    final void execute(...Integer8 args) {
        signed byte 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