mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-05-12 08:00:12 +00:00
Page:
Export
Pages
Adding Support for a New Keyword
Console.Echo
Console.Log
Console.LogLevel
Dom.Add
Dom.Alert
Dom.Confirm
Dom.Container
Dom.Create
Dom.Event
Dom.Get
Dom.GetImage
Dom.Prompt
Dom.Remove
Export
FS.DownloadFile
FS.ListDirectory
FS.UploadFile
G2D.Bezier
G2D.Curve
G2D.Ellipse
G2D.FillCircle
G2D.FillEllipse
G2D.FillRoundRect
G2D.FillTriangle
G2D.InvertRect
G2D.LineCap
G2D.LineDash
G2D.LineDashOff
G2D.LineWidth
G2D.RotoZoom
G2D.RoundRect
G2D.SaveImage
G2D.Shadow
G2D.ShadowOff
G2D.Triangle
Home
Import
QBasic Language Support
Roadmap
Samples
Storage.Clear
Storage.Get
Storage.Key
Storage.Length
Storage.Remove
Storage.Set
Supported Keywords
Unsupported Keywords
2
Export
boxgaming edited this page 2023-09-25 14:00:23 -05:00
Table of Contents
Specifies the Function(s), Sub(s) and/or Const(s) which will be accessible to programs importing the module.
Syntax
Export sourceItem [As externalAlias]
Parameters
- The sourceItem specifies the name of the Functions, Subs or Const to export for use by the calling program.
- The optional externalAlias specifies an alternate name for the exported item. If not specified the internal name will be used.
- Multiple comma-separated source items can be specified per Export line.
Example
Example 1: Export methods from a sample user-defined math library.
Export increment As Plus1
Export factorial AS Factorial
Function increment (num)
increment = num + 1
End Function
Function factorial (num)
Dim res
$If Javascript Then
if (num === 0 || num === 1) {
num = 1;
}
else {
for (var i = num - 1; i >= 1; i--) {
num *= i;
}
}
$End If
factorial = num
End Function