Skip to content

Sys.Construct

boxgaming edited this page Jul 17, 2026 · 3 revisions

Creates a new instance of a native JavaScript type.
Available in release 0.11.0

Syntax

obj = Sys.Construct ( className$ [, thisArg, arg1, arg2, ... _argN] )

Parameters

  • The className$ parameter specifies the name of the native JavaScript type to create.
  • The optional thisArg parameter specifies the parent scope of the constructor. If not specified, the global scope will be used.
  • Optional arg parameters will be passed to the type constructor in the order listed.

Example

Import Sys From "lib/lang/system.bas"

Dim d As Object
d = Sys.Construct("Date")
Print "Raw:    "; d
Print "Year:   "; Sys.Call(d.getFullYear, d)
Print "Locale: "; Sys.Call(d.toLocaleString, d)

Output

Raw:    Sat Jul 11 2026 11:20:12 GMT-0500 (Central Daylight Time)
Year:   2026
Locale: 7/11/2026, 11:20:12 AM

See Also

Sys.Await
Sys.Call

Clone this wiki locally