toExternal

Summary

Constructs a new external array with each element of the internal Array<T> converted to external (via an element-by-element toExternal call). If an element does not implement the System.IExportable interface, a System.Exceptions.ConversionException will be thrown.

Usage

public override external toExternal()

Returns

A new external array with each element converted to external.

Description

Constructs a new external array with each element of the internal Array<T> converted to external (via an element-by-element toExternal call).

If an element does not implement the System.IExportable interface, a System.Exceptions.ConversionException will be thrown.

Examples

Basic Usage
1
2
3
4
5
6
7
8
9
10
11
12
13
import System;
 
class Foo<T> : IExportable
{
    public override function toExternal() {
        return "foo";
    }
}
 
auto arr = new Array<Foo<string>>(5);
arr.fill(new Foo<string>());
 
Console.log(arr.toExternal()); // ["foo","foo","foo","foo","foo"]

Share

HTML | BBCode | Direct Link