Biz/Browser CRS Manual

API version 29
ver 1.3.8

CRS Manual

Copyright © Open Stream, Inc. All Rights Reserved.


About this manual

Please note the following before using the Biz/Browser HT CRS Manual.

About names and abbreviations

This manual uses the following names and abbreviations.

Each name / abbreviation | Common name for Biz/Browser and Biz/Browser Mobile
Biz/Browser PC version or PC version * | Biz/Browser 3.0 to V (5.0) running on Windows OS
Biz/Browser Mobile or Mobile version * | Biz/Browser Mobile versions
Biz/Browser SmartDevice * | Each version of the following Android version, iOS version, Windows tablet version * Includes Biz/Browser AI 2.0 and later versions.
Android version | Biz/Browser HT versions

* This manual does not explain the functions of the PC version, Mobile version, and Biz/Browser Smart Device.

How to read this manual

This section explains how to read this manual.

About API version

This manual is described based on the "API set" when explaining the functions and changing / adding / deleting the specifications.

"API version" is the version of "API set" and is updated when the specification definition is changed.
If Biz/Browser implements the same "API version", it is guaranteed that the same class, method and property can be used even if the platform, product and product version are different.

* Please refer here for the outline of API set and API version .

About platform-specific packages

Platform-specific functions that are not included in the API set are described as "platform-specific packages" separately from the API set.

This platform-specific package is version-controlled on a package-by-package basis and is described as "Package version".
This version will be updated if the package specification definition changes.

How to read the page

The API version and Package version are shown in the upper left of each function page.

Data type description

Biz/Browser has Number as a class that handles numerical values,

For the sake of convenience, this manual uses integer,

We use a description in the form of boolean to represent the truth.

Implemented API version

Version number | API version | Platform specific package
Biz/Browser AI Android version v1.0.0 | 1 * 1 | None
Biz/Browser AI Android version v1.0.1 | twenty one | None
Biz/Browser AI Android version v1.0.2 | 3 * 1 | None
Biz/Browser AI iOS version v2.0.0 | 4 | None
Biz/Browser AI iOS version v2.1.0 | 5 | None
Biz/Browser AI Android version v2.2.0 | 6 | External Object (Java integration) Package version 1
Biz/Browser AI Windows tablet version v2.2.0 | 6 | ExternalObject (.NET linkage) Package version 1
Biz/Browser SmartDevice iOS version v1.0.0 | 7 | None
Biz/Browser SmartDevice Android version v1.0.0 | 7 | External Object (Java integration) Package version 1
Biz/Browser SmartDevice Windows tablet version v1.0.0 | 7 | ExternalObject (.NET linkage) Package version 1
Biz/Browser SmartDevice iOS version v1.1.0 | 8 | None
Biz/Browser SmartDevice iOS version v1.2.0 | 9 | None
Biz/Browser SmartDevice Android version v1.2.0 | 9 | External Object (Java integration) Package version 1
Biz/Browser SmartDevice Windows tablet version v1.2.0 | 9 | ExternalObject (.NET linkage) Package version 1
Biz/Browser SmartDevice iOS version v1.3.0 | Ten | None
Biz/Browser SmartDevice Android version v1.3.0 | Ten | External Object (Java integration) Package version 1
Biz/Browser SmartDevice Windows tablet version v1.3.0 | Ten | ExternalObject (.NET linkage) Package version 1
Biz/Browser HT Android version v1.0.0 | Ten | ExternalObject (Java linkage) Package version 1 and functions described as HT API version 10
Biz/Browser HT Android version v1.1.0 | 12 | ExternalObject (Java linkage) Package version 12 and functions described as HT API version 12
Biz/Browser HT Android version v1.1.1 | 14 | ExternalObject (Java linkage) Package version 13 and functions described as HT API version 12
Biz/Browser HT Android version v1.2.0 | 15 | ExternalObject (Java linkage) Package version 13 and functions described as HT API version 15
Biz/Browser HT Android version v1.2.2 | 16 | ExternalObject (Java linkage) Package version 13 and functions described as HT API version 16
Biz/Browser HT Android version v1.2.4 | 19 | ExternalObject (Java linkage) Package version 13 and functions described as HT API version 19
Biz/Browser HT Android version v1.2.6 | 21 | ExternalObject (Java linkage) Package version 13 and functions described as HT API version 21
Biz/Browser HT Android version v1.3.0 | 24 | ExternalObject (Java linkage) Package version 24 and functions described as HT API version 24
Biz/Browser HT Android version v1.3.3 | 26 | ExternalObject (Java linkage) Package version 24 and functions described as HT API version 26
Biz/Browser HT Android version v1.3.5 | 28 | ExternalObject (Java linkage) Package version 24 and functions described as HT API version 28
Biz/Browser HT Android version v1.3.8 | 29 | ExternalObject (Java linkage) Package version 29 and functions described as HT API version 29

* 1 This manual does not describe products other than Biz/Browser HT.

Return to "Online Manual" list Return to
"Biz's Treasure Box" TOP


Overview of Biz/Browser

Biz/Browser is executed by an interpreter with a built-in script written in a script language called CRS, which is very similar to JavaScript.

Biz/Browser adopts HTTP as the basic input / output means, and can operate by downloading CRS (including script code, data, screen definition, etc.) from the WEB server.

Biz/Browser is mainly used for routine business applications. The functions required by applications that perform routine tasks,

such as functions for efficiently handling text information, focus movement control between items, calculation between items, and calculation functions using built-in functions, is enriched.

Since Biz/Browser is mainly used on the network, it is equipped with a powerful cache system controlled by the application to reduce the amount of data passing through the line.

The CRS script downloaded from the WEB server is saved in the cache in a compiled binary format.

Therefore, communication other than dynamic fluctuation data does not occur for the screen once displayed.

With this structure, even if a client-server connection is made with a low-speed line of about 64k, it can operate at a sufficiently practical speed.

It is possible to build routine business applications that support a wide area network, which was difficult with conventional methods for practical systems.

Biz/Browser usage system overall conceptual diagram


System configuration using Biz/Browser

Biz/Browser is used by connecting to a WEB server via the Internet or an intranet. The system configuration at this time is no different from a normal WEB browser, it can be connected to most WEB servers, and the application environment on the server side does not need to be special.

The only difference between HTML and a system that uses a web browser is that it works by downloading CRS from a web server instead of HTML.

Like HTML, CRS files can be created with Biz/Designer and placed as files on the WEB server, or dynamically generated by server-side applications such as Java and ASP.

In addition to CRS files, you can also handle the following files.

CAR file (CRS Archive)

This is a compressed and stored CRS file and related image files. Communication efficiency is improved because the related compressed files can be downloaded at once. CAR files can be created with Biz/Designer Mobile or the dedicated tool car.exe.

Image files (JPG, PNG files, etc.)

It supports JPEG and image files such as PNG (including transparent PNG), BMP, GIF, TIFF, and EXIF ​​formats.

Other files

In addition to the above, you can handle files of any format as data used in the application. In particular, XML files and CSV files have many convenient functions for processing on CRS scripts.


Cooperation with server application

Biz/Browser communicates with the WEB server via HTTP. Therefore, the application running on the WEB server side can receive the request from Biz/Browser and return the response in the same way as the communication with the normal WEB browser.

An example of VBScript running on IIS

In this example, "Hello" is displayed in TextBox1 of Biz/Browser.

--- CRS sample1.crs ---

Form sample {
    Width = 300;
    Height = 200;
    TextBox TextBox1 {
        X = 10;
        Y = 10;
        Width = 100;
        Height = 30;
    }
    Get("sample1.asp");
}

--- VBScript  Esample1.asp ---

<%
    Response.Write("TextBox1.value =" + Chr(&h22) + "Hello" + Chr(&h22) + ";")
%>

In this way, the server-side programming method is no different from HTML. The only difference is that the response is a CRS script instead of HTML.

Example of sending data from Biz/Browser

In this example, the value entered in TextBox1 when Tap Button1 of Biz/Browser is passed to the WEB server.

--- CRS sample2.crs ---

Form sample {
    Width = 300;
    Height = 200;
    TextBox TextBox1 {
        X = 10;
        Y = 10;
        Width = 100;
        Height = 30;
    }
    Button Button1 {
        X = 10;
        Y = 50;
        Width = 100;
        Height = 30;
        Title = "click";
        Function OnTouch(e){
            Get("sample2.asp", sample.TextBox1);
        }
    }
}

--- VBScript  Esample2.asp ---

<%
    'Get request parameters
    data = Request.Form ("TextBox1")
    Response.Write("title =" + Chr(&h22) + data + Chr(&h22) + ";")
%>

In this way, the reception of parameters is no different from that of HTML.

Example of cooperation between Biz/Browser and Servlet

CRS script example from ③ to ⑥
::
Button MyButton {
    :
    Function OnTouch(e){
        try {
            var session = getHttpSession();
            var request = session.CreateRequest("/app/proc1");
            request.AddParam ("code", 123);
            var response = session.Post (request);
            var xmlImpl = new xmlDOMImplimentation;
            var xdoc = xmlImpl.Load(response);
            this.Title = xdoc.SelectSingleNode("//name"). Text;
        }
        catch (exp) {
            MessageBox(exp);
        }
    }
::
}
::


Points to keep in mind when building a system

When building a business application with CRS, there are the following major differences compared to HTML.

Difference in communication unit

The CRS file contains screen layout information, but unlike HTML, one CRS file does not always correspond to one screen.

The CRS file acquired by communicating with the WEB server is not displayed on the screen as it is like HTML,

but is executed by Biz/Browser as a script. Depending on the content of the CRS script, the screen may be displayed as a result of execution, or just the data may be updated.

Therefore, it is possible to create multiple screen element parts with Biz/Designer and combine them at runtime to form one screen, or combine only the common logic parts into separate files.

You can also change only a part of the screen by downloading a CRS script from the WEB server that changes only a part of the displayed screen. For example, if you want to change the background color of TextBox1 to red, the WEB server will send the following CRS script.

TextBox1.BgColor = $RED;

Difference in the way of thinking about cache

The Biz/Browser cache is saved in a compiled binary format of the downloaded CRS script. As a result, cached CRS scripts can be called very quickly with no compilation overhead.

Also, unlike a normal web browser, the Biz/Browser cache is valid unless the cached contents are explicitly deleted. There is no communication to check if the cache contents are out of date. Cache integrity must be guaranteed by the application running on the web server.

As you can see, the Biz/Browser cache can be thought of as a "CRS script installation" rather than a "cache".

Points for improving performance

In order to be able to use business applications comfortably with Biz/Browser, it is necessary to design the application so that it returns a quick response to the user's operation.

Biz/Browser has various built-in functions to improve the response speed, but the most important thing is to reduce the number of communications with the WEB server as much as possible. Also, when communicating, please try to retrieve the necessary data in one communication as much as possible. Although it depends on the communication environment, in the case of a communication volume of several tens of K as handled by Biz/Browser, most of the processing time is occupied by connecting and disconnecting the connection.

Examples of poor performance

Get("prog1?Code=1");
Get("prog2?Code=1");

If there are two types of required data in this way, it will take twice as long to acquire them with two GET instructions.

Examples of improving performance

Prepare prog3 that returns the response including the response contents of both prog1 and prog2, and aggregate it into one-time communication.

Get("prog3?Code=1");

This will close the communication in about half the time compared to the poor performance example.


Features and restrictions of Android version

Features and restrictions of Android versionChange History

This chapter describes the difference in the mechanism as Biz/Browser in Android version.

Differences for Android version in general

○ The Android version of CRS execution engine uses the same as Biz/Browser V.
Unicode is used as the internal character code.

-When resolving identifiers such as method names, variable names, and external resource constants, double-byte characters may be treated as case-insensitive.
Be careful when using identifiers that use double-byte alphabets or Greek letters.

○ The line feed codes that can be used are "\n" or "\r\n".

○ Full-width "\" is used for the currency symbol of Japanese yen.

○ The result of floating-point operation may be slightly different depending on the platform and architecture.

○ If you move the focus while using IME with Edit type object etc., the character string being input is confirmed.

○ The concept of security control called security level is installed. See About Security Levels for rules .

○ Due to the Android OS specifications, the Biz/Browser process may be automatically terminated when Biz/Browser is not displayed in the foreground.
Therefore, it is necessary to develop the processing and operation flow in consideration of that.
(A CRS program can be described by using the Root.SetReloginURL method, Root.ReloggedIn property, Root.WindowStateChanged event, etc.)

○ Biz/Browser HT may have different GUI appearance from other Biz/Browser products.

○ Biz/Browser will follow the behavior depending on the terminal or OS. Therefore, the results and behaviors of some functions may differ.

○ If you deny the permission status of various functions required by Biz/Browser in the item "App permissions" on the Android setting screen added from Android 6.0, Biz/Browser becomes unstable when using various functions. It may behave strangely or be killed. Immediately after installation, all required permissions will be granted.
* Please also refer to "Permissions required by Biz/Browser HT" below.

○ The size of Form directly under Root always works with the size of Root. You cannot resize the Form.

Known bugs and limitations currently known

○ When the resolution ratio of the terminal is not an integral multiple, the display character string of the FlexCheckButton type cell may be partially missing depending on the font size, Format property, and cell value.

-When you press the key attached to the terminal and press the Shift key and any key at the same time, the Shift key may not be treated as being pressed.

  -ShiftKey of KeyDown event may be false.

  -The object may not respond to the key combined with Shift in the AltKey property, or the object may respond to the key not combined with Shift.

  -When pressing Shift + Tab, focus may move to the next instead of the previous one.

○ Depending on the IME attached to the terminal, if you try to enter characters with the buttons attached to the terminal and enter characters that are restricted in InputMode etc. into TextBox etc., the characters already entered in TextBox will be pressed every time the key is pressed. May disappear.

○ When key input is performed using the buttons attached to the terminal, only some of the keys (UP, LEFT, DOWN, RIGHT Even if you press () etc., it is not supposed to be pressed, and you may not be able to perform various operations by pressing that key.

-Depending on the software keyboard, the operation of the software keyboard may become unstable when entering characters that are restricted in inputMode.

Permission required by Biz/Browser HT

Biz/Browser HT, like other popular Android apps, requires what is called a permission from the Android OS in order to achieve its functionality.

Permissions clearly indicate what functions the Android app may access, and a list will be displayed when the Android app is installed.

The Android OS prohibits Android apps from accessing functions other than the requested permissions.

Since this permission also limits the processes that can be executed by the Android standard library and third-party libraries using the ExternalObject package (Java linkage), please confirm the necessary permissions before using the library.

The permissions that Biz/Browser HT requests for Android OS are as follows.

permission | Explanation
android.permission.ACCESS_COARSE_LOCATION | Permission to access approximate location information (network base station)
android.permission.ACCESS_FINE_LOCATION | Permission to access detailed location information (GPS)
android.permission.ACCESS_NETWORK_STATE | Allow access to network state
android.permission.ACCESS_WIFI_STATE | Allow access to Wi-Fi status
android.permission.BLUETOOTH | Allow access to paired Bluetooth devices
android.permission.BLUETOOTH_ADMIN | Allow Bluetooth device search and pairing operations
android.permission.BLUETOOTH_CONNECT | Permission to connect to paired devices
android.permission.BLUETOOTH_SCAN | Permission to scan for nearby Bluetooth devices
android.permission.CAMERA | Allow camera operation
android.permission.CHANGE_WIFI_STATE | Permission to change Wi-Fi state
android.permission.DISABLE_KEYGUARD | Allow to disable key lock
android.permission.FLASHLIGHT | Allow flashlight operation
android.permission.FOREGROUND_SERVICE | Permission to create foreground services
android.permission.INTERNET | Allow full internet access
android.permission.NFC | Permission to access NFC functions
android.permission.POST_NOTIFICATIONS | Permission to post notifications
android.permission.READ_PHONE_STATE | Permission to access phone state
android.permission.RECORD_AUDIO | Permission to record audio
android.permission.VIBRATE | Allow vibration control
android.permission.WRITE_EXTERNAL_STORAGE | Allow access to content on SD card
android.permission.WRITE_SETTINGS | Allow general system settings (such as changing screen brightness)

Display string and "&" symbol

In the PC and Mobile versions, there was a specification that changed to underline when "&" was included in the character string displayed on the screen. In order to match the display with the Mobile version, underlining is not added, but "&" is excluded from the display string instead.

If you want to disable this behavior and display "&" directly in the displayed string, use NoPrefix property.

User Agent Difference

The value of UserAgent when making a request to the Web server is as follows.

Please be careful when processing is branched by UserAgent.

Biz/Browser HT (Android)

SYS object

The value of SYS.CLIENT is as follows.

Biz/Browser HT (Android)

Also, SYS_CLIENT_VERSION is the running version, so be careful when using an existing CRS program to branch the process using SYS_CLIENT_VERSION or SYS_CLIENT.

Platform constant

There are constants that can be branched for each platform and can be processed only when running on the Android version and ignored when running on other platforms.
The available constants are as follows.

・ $ Android

It is always "1" in Biz/Browser HT.

・ $ AI

Since it is compatible, it will be "1" even in Biz/Browser HT.

・ $ SmartDevice

Since it is compatible, it will be "1" even in Biz/Browser HT.

・ $ Mobile

It is "1" in Mobile compatible mode and "0" otherwise.

・ $ HT

It is always "1" in Biz/Browser HT.

root object, Form object directly under root

At startup, the main window (root object) is maximized on the screen and cannot be changed.

The size of Form directly under Root always works with the size of Root. If a value other than 0 is specified for the X and Y properties, it will be ignored.

Regarding the handling of character strings

Unicode characters are stored in the String object, and the number of characters and the processing unit are Unicode one character unit.

Mobile compatible mode In
addition, by using the Root.SetCompatibleMode method and setting it as Mobile compatible mode, it is possible to make the internal character code compatible with Shift-Jis (multi-byte character).

The character code conversion rules in CRS are as follows.

◆ When Mobile compatibility mode is OFF (default)

--- CRS file ---

◇ During CRS analysis, if there is a BOM, it follows the BOM. In all other cases, the OS language setting is Japanese, Shift-JIS, and other language settings are ISO / IEC 8859-1.

--- String class ---

◇ The number of characters is the same as that of UTF-32.

--- Input / output related ---

◇ The character string set in the ByteArray class object is handled as UTF-8.

◇ In the input / output of File class and Security package, it is treated as UTF-8.

-Decryptor class The second argument pass (password) of the DecryptString method is handled as UTF-8.

-Encryptor class The second argument pass (password) of the EncryptString method is handled as UTF-8.

◇ Input and output in HTTP package

-The character string specified in the httpRequest method is handled as UTF-8.

-The response data of the object of httpResponse class is handled as ByteArray.

-It is handled as UTF-8 by the ReadLine method of httpResponse class. However, if charset is specified in Content-Type of HTTP response header, it is handled as a character string with that character code.

◇ Input and output in XML package

-It is treated as UTF-8 by the Parse and Load methods of the XmlDOMImplementation class.

-The Save method of the XmlDocument class follows the encoding specified by the second argument.

(Default: UTF-8)

◇ Input and output in CSV package

-It is treated as UTF-8 by Parse method, Load method and Save method of CSVDocument class.

-It is treated as UTF-8 by the Get method of the CSVDocument class. However, when charset is specified in Content-Type of HTTP response header, it is handled as a character string of that character code.

◆ When Mobile compatibility mode is ON

--- CRS file ---

◇ During CRS analysis, if there is a BOM, it follows the BOM. In all other cases, the OS language setting is Japanese, Shift-JIS, and other language settings are ISO / IEC 8859-1.

--- String class ---

◇ The number of characters is the same as the UTF-16 counting method.

--- Input / output related ---

◇ The character string set in the ByteArray class object is handled as Shift-JIS.

◇ In the input / output of File class and Security package, it is treated as Shift-JIS.

-Decryptor class The second argument pass (password) of DecryptString method is handled as Shift-JIS.

-Encryptor class The second argument pass (password) of EncryptString method is handled as Shift-JIS.

◇ Input and output in HTTP package

-The character string specified by the httpRequest method is handled as Shift-JIS.

-The response data of the object of httpResponse class is handled as ByteArray.

-It is handled as Shift-JIS in ReadLine method of httpResponse class. However, if charset is specified in Content-Type of HTTP response header, it is handled as a character string with that character code.

◇ Input and output in XML package

-It is treated as Shift-JIS in the Parse and Load methods of the XmlDOMImplementation class.

-The Save method of the XmlDocument class follows the encoding specified by the second argument.

(Default: UTF-8)

◇ Input and output in CSV package

-It is handled as Shift-JIS in Parse method, Load method and Save method of CSVDocument class.

-It is handled as Shift-JIS in the Get method of CSVDocument class. However, if charset is specified in Content-Type of HTTP response header, it is handled as a character string with that character code.

MaxLength property of Edit object

In Android version, MaxLength property is unified in the number of characters (Unicode unit) unlike PC version.

About IME Mode

In the Android version, IME input mode (direct input, kana input, etc.) cannot be controlled.

For SIP (Software Input Panel) status when IME mode is specified, refer to the IMEMode property of each class.

Also, please refer to the SIPMode property for the display contents of SIP (Software Input Panel).

Font handling and display

Line spacing and character width may differ from those of other Biz/Browser products due to the difference in standard fonts built into the terminal.

Therefore, the display when the character string does not fit in the display area and the result of word wrapping may be different.

Also, bold and italic are applied only when the corresponding font exists in the terminal.

Underlines are not supported in Android version.

About FileSystem class

Because the structure of the drive and the directory is different from that of Windows due to the difference of OS, it may not work by accessing with absolute path.

Please refer to the FileSystem class page for the private root and public root paths in the Android version .

Use "/" as the path delimiter instead of "\".

Wildcards that represent file paths are handled differently from Windows.

(Example: If "*. *" Is specified, only files that include one or more "." Are targeted)

About RClicked event

In the Android version, xPos and yPos objects are not included as child objects of the Event object passed in the RClicked event of the Button class.

Custom system properties

//.SYS object properties are as follows.

Property name | Explanation
String MODELNAME | You can get the manufacturer name and model name set by the manufacturer. It is not always guaranteed that the manufacturer can set it. Also, there is no regularity in the format. Using this property allows conditional branching and coding depending on the model.
String PLATFORM | You can get the platform type. You can get the CPU instruction set of the terminal.
String DEVICEID | You can get the ID that identifies the terminal. By using this value, it becomes possible for the server to manage individual aircraft and perform logging. Please note that the immutability and uniqueness of this ID is not guaranteed. See the SYS object page for details.

Scaling setting screen

Biz/Browser HT provides a "scaling setting screen" that allows you to specify the screen display magnification and scroll bar size without writing scripts as an auxiliary function to facilitate development and debugging.

If you set it on the scaling setting screen, it will be reflected uniformly on all CRS programs executed in the terminal.

When performing scaling settings on individual screens as an application system, describe the following scale-related settings in the CRS script.

function | Corresponding property
Display magnification setting | Form.HorizontalScale
 | Form.VerticalScale
 | Form.FontScale

"Scaling settings" screen Items

□ Override scale value

When the [OK] button is clicked with a check mark, each magnification is reflected and displayed.

If you click the [OK] button with the check off, each magnification will be returned to "1.0".

□ Horizontal scaling

Specify the display magnification in the horizontal direction (X, Width, etc.).

□ Vertical scaling

Specify the display magnification in the vertical direction (Y, Height, etc.).

□ Font scaling

Change the display magnification of the font.

□ [Zoom reset] button

It is enabled when "Overwrite default scale value" is checked.

Set "1.0" in each magnification field. Click [OK] to display the set magnification.

* If the Form does not exist or the script is stopped due to an exception, it will not work.

* Script scaling-related descriptions are not updated.

Shortcut creation screen

Like the PC version, Biz/Browser HT allows you to create a shortcut to directly execute any CRS.

How to create depends on the version of Android OS and the home application of the device.

Generally, it can be created by the following method.

○ When running on Android 8 or later

Long-tap the home screen to display the menu → tap the "Shortcut" (or "Create shortcut") tab → configure the shortcut settings on the "Create shortcut" screen → long-tap the Biz/Browser icon → release your finger where you want to place the shortcut.

* Added in Biz/Browser HT ver 1.3.0.

* Biz/Browser must be started once before using this function.

○ When running on Android 7 or earlier

Long-tap the home screen to display the menu → tap the "Widget" tab → long-tap the Biz/Browser icon → release your finger where you want to place the shortcut → configure the shortcut settings on the "Create shortcut" screen.

* Shortcuts can also be created with this operation on devices running Biz/Browser HT ver 1.3.0 or later on Android 8 or later , but it may not work correctly on some devices.

* On devices running Biz/Browser HT ver 1.3.0 or later on Android 8 or later, the "Widgets" tab may not be displayed depending on the OS version or device. See "Example of display when long-tapping the Biz/Browser icon" below.

"Shortcut creation" screen Items

□ Shortcut name

Specify the character string displayed at the bottom of the shortcut icon.

□ Login URL

Specify the URL of CRS that is automatically logged in after starting Biz/Browser.

□Read URL from QR code

Start the camera and read the login destination URL from the QR code.*1

□ Select from bookmark

"Shortcut name" and "Login destination" can be selected from the URL registered in the bookmark of Biz/Browser.

If the bookmark name is blank, the currently entered "Shortcut name" is retained.*2

□ Icon selection

A dialog for selecting an icon is displayed by tapping.

Please note that the appropriate icon size depends on the Android OS version and device resolution.

□ Core dump output mode

If an unhandled exception is caught by the CRS execution engine during execution of Biz/Browser, debug information (core dump) is output and the processing is interrupted.

The following modes can be specified as the core dump output mode.

value | Explanation
0 | Do not output debug information (core dump)
1 | When an unhandled exception occurs, debug information (core dump) is output. If the core dump already exists, it will be overwritten. (It is equivalent to the operation of conventional Biz/Browser)
2 | Debug information (core dump) is output each time an exception occurs, regardless of the handling. The task ID and 4-digit serial number are added to the core dump file name, and a new file is created each time a core dump is output.

1 is selected by default.

○ Example of display when long-tapping the Biz/Browser icon

Example of display on Android 11 | Example of display on Android 12

File access for Android 11 and later

When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.

Some methods for file access, when specifying the path of a directory for which permission is required, will display the OS directory selection screen and obtain access permission from the user.

The target directory is initially selected, so please operate the screen to get the permission. Once the permission has been obtained, the directory selection screen will not be displayed until you reinstall Biz/Browser.

* The screen may vary depending on the OS version and device.

Note that permission cannot be obtained for some directories, such as directly under the internal directory (/sdcard, /storage/emulated/0) or the download directory (/sdcard/Download, /storage/emulated/0/Download).

*Even with Android 11 or later, it may be possible to read and write files in the download directory, but there are restrictions such as being unable to open files created by other apps.

Change History
*1　This was added in v1.3.5.
*2　Specification changed from v1.3.5.


About scaling operation

In Biz / Browser HT, it is now possible to change the pseudo scaling (scaling) and aspect ratio using the properties HorizontalScale , VerticalScale , FontScale added to the Form class .

This chapter describes precautions for scaling operation.

Scaling execution principle

Even in the conventional Biz/Browser, it was possible to automatically adjust the size of the object under the form at the position and size of the upper form in a pseudo manner by using the reference formula.

Form frmMain {
    X = 0;
    Y = 0;
    Width = 600;
    Height = 400;

    Button btnExit {
        X &= 50 * (^.Width/600);
        Y &= 50 * (^.Height/400);
        Width &= 100 * (^.Width/600);
        Height &= 60 * (^.Height/400);
    }
    TextBox txtInput {
        X &= 200 * (^.Width/600);
        Y &= 50 * (^.Height/400);
        Width &= 200 * (^.Width/600);
        Height &= 50 * (^.Height/400);
    }
}

However, it was not an excellent method in terms of execution speed and development productivity.

Also, since the font can only be specified at the time of creation, the font size could not be changed dynamically.

With the newly added properties, you can achieve the same effect faster with clean coding.

Coordinates are automatically calculated and rearranged on the screen for the objects that exist under the specified Form.

The CRS code that has the same effect as above is as follows.

Form frmMain {
    X = 0;
    Y = 0;
    Width = 600;
    Height = 400;
    HorizontalScale &= Width/600;
    VerticalScale &= Height/400;
    FontScale &= Width/600;

    Button btnExit {
        X = 50;
        Y = 50;
        Width = 100;
        Height = 60;
    }
    TextBox txtInput {
        X = 200;
        Y = 50;
        Width = 200;
        Height = 50;
    }
}

Since the properties of the objects under it do not change, it is possible to design the screen based on the logical value and implement it so that it matches the display size as appropriate.

In addition, the font size can be dynamically scaled, making it behave as if it were scaled up or down.

Since the font size can be set to the enlargement / reduction ratio independently of the object size, fine adjustments such as slightly smaller than the enlargement ratio of the screen are possible.

Precautions for scaling operation

Scaling behavior is a mechanism that dynamically resizes an object, not scales an image.

Therefore, the width of the border and scroll bar displayed with the specified value of the OS is not affected by the enlargement / reduction.

Therefore, the effective area within the object is wide when zoomed in and narrow when zoomed out.

Some classes prioritize the accuracy of effective domain scaling and automatically correct the size of the object to a value different from the actual magnification.

For details, please refer to the explanation of each class.

Also, since the coordinate system is an integer value, if you specify a magnification that includes a decimal number, a round-up error may occur in 1-pixel units.

For FontScale, round the magnification in points. Therefore, the amount of change is larger than the scaling of the coordinates.

When designing the screen using the scaling operation, make sure to design with a margin in the display area.

Automatic scaling by device resolution

From API version 6, a mechanism has been added that automatically scales according to the terminal resolution.

With this function, screens can be displayed on almost the same scale even on different terminals as long as they are on the same platform.

Please note that the standard dpi value differs between different platforms.

Android version

The scale values ​​below are automatically applied.

Resolution classification | resolution | Automatic scaling factor
ldpi (low resolution) | 120dpi | 0.75
mdpi (medium resolution) | 160dpi | 1.0 (standard)
tvdpi (resolution for terminals such as TV) | 213dpi | 1.33125
hdpi (high resolution) | 240dpi | 1.5
xhdpi (ultra high resolution) | 320dpi | 2.0
xxhdpi (ultra-high resolution) | 480dpi | 3.0
xxxhdpi (ultra-high resolution) | 600dpi | 4.0

* In Biz / Browser AI Android v1.x series, scaling is 1.0 times for all resolutions.


Security level

Biz/Browser HT introduced the concept of security levels.

In order to ensure security, Biz/Browser used to display a warning when accessing a local resource and suppress external application calls in principle.

However, in environments where security is ensured, such as operations on an intranet, there are cases in which it may be possible to allow limited cooperation with external applications when warnings are not required.

By setting the security level, it is possible to control the warning display, enable the functions that are normally prohibited by security, and vice versa.

How to specify the security level

The security level is specified in 5 levels from level 0 (low) to level 2 (medium, equivalent to conventional Biz/Browser) to level 4 (high).

If no security level is specified, it will be set to level 2.

With Biz/Browser AI, connection licenses .

The connection license certificate describes the security level, and when issuing the license, five types of certificates from level 0 to level 4 are issued.

Select the certificate of the security level you want to use for the application, as well as the connection license certificate that was previously placed on the Web server, and place it on the Web server.

If you register the connection license certificate in Biz/Browser, the security level described in the certificate will be applied when connecting to the Web server.

Security level specification priority

The security level will lowest security level

List of availability of functions by security level

The following features are affected by security level

Target | function | Security level
 |  | 0 | 1 | 2 | 3 | Four
FileSystem.Mount method | Mount security warning dialog | Do not show |  | First time display, Can be suppressed after the second time |  | Always show
Runtime.Exec method Runtime.ShellOpen method Runtime.ShellLink method link function | Executable file (exe, bat, etc.), .lnk file (shortcut file) execution | Run without confirmation | Warning display | Not executable
 | Displaying a security warning dialog when opening an external file | Do not show | First time display, can be suppressed after the second time |  |  | Always show
ExternalObject class (Java integration) ExtVal class (Java integration ) | External object generation by .NET Framework or Dalvik VM | Yes | Impossible
Intent class | Issuing intents for other Android apps | Yes | Impossible
ExternalService class | Cooperation with external services | Yes | Impossible


About supported HTTP authentication methods

When performing HTTP or HTTPS communication on Biz/Browser, authentication may be required depending on the settings of the connection destination.

The HTTP authentication that can be used changes depending on the Biz/Browser version used, server, HTTP version, etc.

When using, check which authentication method can be used from the table below and the server manual.

The HTTP authentication methods that can be used with Biz/Browser are as follows.

Authentication method | Biz/Browser HT
BASIC authentication | available
Digest authentication | available
Windows integrated authentication | Not available
Proxy authentication | Not available


About gesture operation

In Biz / Browser HT, you can now get the gesture by touch operation as an event by using the UseGesture property and Gesture event added to the Form class . In this chapter, notes on gesture operation are described.

Types of gestures that can be captured

You can capture the following gestures in the Form class.

◯ Flick operation

Flick operation refers to an operation in which one finger is swiftly moved on the screen and then released.

It is mainly used for switching screens and flick input software keyboards, etc., and mainly processes using flick direction information.

◯ Swipe operation

Swipe operation refers to the operation of moving a finger while keeping one finger on the screen.

It is mainly used for screen scrolling and item movement operations, and it processes at the event that occurs each time you move your finger.

◯ Pinch operation

Pinch operation refers to the operation of placing two fingers on the screen and narrowing or widening the distance between the two fingers.

The operation of narrowing the space between fingers is called pinch-in, and the operation of widening it is called pinch-out.

It is mainly used for screen enlargement / reduction operations, etc., and is processed by the event that occurs each time you move your finger.

Transfer gesture operation to upper-level Form

If you do not specify a flick operation or swipe operation for the UseGesture property, the gesture will be transferred to the upper Form.

By doing this, you can scroll by swiping the form that is located higher than the form that is making the gesture.

If you are supplementing the flick or swipe operation with the UseGesture property, you cannot scroll the upper Form by the swipe operation.

Mapping gesture actions to traditional mouse events

The following gesture operations map to traditional mouse events.

◯ Tap operation

Clicked, LButtonUp event

◯ Double tap operation

DoubleClicked event

◯ Long tap operation

RClicked, RButtonUp events

Below is the event that occurs when you do not handle the gesture with UseGesture.

◯ Swipe operation

MouseMove Event

◯ Pinch operation

MouseWheel Event


About custom URL schemes

A mechanism called a custom URL scheme is provided as a method for linking with other applications.
Simply put, if you define a scheme (the "hoge" part in the URL "hoge://fuga") of
the application and open that URL from another application, the start and data of the application that defines the scheme It is a mechanism for sending.

The following custom schemes are supported by Biz/Browser HT.

・ crs://www.example.com/hoge.crs

  → It is interpreted as a login for http://www.example.com/hoge.crs.

・ crs-http://www.example.com/hoge.crs

  → It is interpreted as a login for http://www.example.com/hoge.crs (same as crs://).

・ crs-https://www.example.com/hoge.crs

  → It is interpreted as a login for https://www.example.com/hoge.crs.

・ biz-browser://...

  → (described later)

Biz/Browser HT 1.2.6 or later

・biz-browser-postevent://...

  → (described later)

"biz-browser" scheme

With the biz-browser scheme, Biz / Browser can be controlled more finely than the normal http / https scheme and the above-mentioned crs scheme.

○ URL that can be called from both Root.Login method and other applications

・biz-browser://

login-Login operation

?url=<url>

-[Required] Login URL

&param=<param>

-[Optional] Login parameters. Set to SYS.LoginParam .

&proxy=<host:port>

-[Optional] Specify the proxy server in the form of "host name: port number".
  If not specified, it will follow the OS setting

Example of use

biz-browser://login?url=http://www.example.com/dir/login.crs
biz-browser://login?url=http://www.example.com/dir/login.crs&param=abc&proxy=127.0.0.1:8080

・biz-browser://

settings-Change Biz/Browser startup settings

See here for details.

○ URL that can only be called from other apps

・ biz-browser://

postEvent-Issuing an event to the Biz Root object being started. Only start when Biz is not started.

?name = <CustomEvent>

-[Required] Event name. It can be handled by the event handler of "On" + event name.

&<key1>=<value1>

&<key2>=<value2>

…

&<keyN>=<valueN>

-[Optional] Specifies the name and value of a child object (String class) of the event object.

  You can specify any number of child objects, 0 or more.

  If a name that cannot be used as an object name (such as a reserved word or a symbol) is specified for <keyN>, that value will be ignored.

- (Biz/Browser HT 1.2.6 or later) When an Android application calls Biz/Browser with URL specified, the information of intent is stored as a child object of Event object.

  The child object name will be "ExtIntent". For intent, refer to Intent class.

Example of use

/* URL called from other apps (Safari, printing apps, etc.) */
biz-browser://postEvent?name=TestEvent&title=abc&param=def
/* CRS script that receives the event */
/* Define an event handler on the Root object */
//{
    Function OnTestEvent(e) {
        /* A MessageBox with "abc" in the title and "def" in the body is displayed */
        MessageBox(e.param, e.title);
        /* The information of Intent is stored as ExtIntent. */
        MessageBox("Intent:" + e.ExtIntent.action + " / " + e.ExtIntent.data);
    }
}

・biz-browser://

showForeground-Displays the screen in the foreground when Biz starts. If Biz is not started, it will start.

○ URL that can only be called from the Root.Login method

・ biz-browser://

debug-enter debug mode. For details, refer to the Biz/Designer manual.

?host=<host>

-[Required] The host name (or IP address) of the PC running Biz/Designer.

&port=<port>

-[Optional] Port number for debugging. If omitted, connect to No. 44080.

"biz-browser-postevent" scheme

biz-browser-postevent scheme is used by other applications to call Biz/Browser. The way to specify the event name is different from biz-browser scheme to.

Select the scheme to be used according to the specifications of the application that calls Biz/Browser.

This scheme is supported by Biz/Browser HT 1.2.6 or later.

○URL that can only be called from other apps

・biz-browser-postevent://

<EventName> - Issuing an event to the Biz Root object being started. Only start when Biz is not started. The event name is specified in the host section.

?<key1>=<value1>

&<key2>=<value2>

…

&<keyN>=<valueN>

-[Optional] Specifies the name and value of a child object (String class) of the event object.

  You can specify any number of child objects, 0 or more.

  If a name that cannot be used as an object name (such as a reserved word or a symbol) is specified for <keyN>, that value will be ignored.

-When an Android application calls Biz/Browser with URL specified, the information of intent is stored as a child object of Event object.

  The child object name will be "ExtIntent". For intent, refer to Intent class.

Example of use

/* URL called from other apps (Safari, printing apps, etc.) */
biz-browser-postevent://TestEvent?title=abc&param=def

/* CRS script that receives the event */
/* Define an event handler on the Root object */
//{
    Function OnTestEvent(e) {
        /* A MessageBox with "abc" in the title and "def" in the body is displayed */
        MessageBox(e.param, e.title);
        /* The information of Intent is stored as ExtIntent. */
        MessageBox("Intent:" + e.ExtIntent.action + " / " + e.ExtIntent.data);
    }
}


About API version

"API version" is a new concept introduced from Biz/Browser AI (currently Biz/Browser Smart Device).
Previously, came represents the difference of the function by the product name and the version number, Biz/Browser is a lot of devices and Pratt
led to the support forms, multiple products and versions are mixed, implemented only in version number It became difficult to represent the function
.

Therefore, "API set" and
"API version", which indicate the version, have been introduced as indicators that show the implemented function set itself, independent of the product or product version .

API set / API version

"API set" is defined as follows.

  • CRS language specifications, built-in packages, built-in classes and their properties (types), methods (arguments, return values), constants specification definitions

"API version" is the version of "API set" and is updated when the specification definition is changed.
As long as Biz/Browser implements the same "API version",
it is guaranteed that the same class, method and property can be used even if the platform, product and product version are different .

* See here for a list of products that implement each API version .

Difference in operation depending on API version and implementation

"API version" is a specification definition, and the actual operation depends on each device and platform.
The same API version allows you to use the same classes and methods on different devices, but the
results may not match , especially for hardware- and OS-dependent features.
Differences due to implementation are described as supplementary items in each item of the reference manual.

Functions related to API version

$APIVERSION constant

You can get the API version number of Biz/Browser in operation. The value is an integer value.
This allows you to branch processing depending on the API version that is running.


CRS program

The CRS language is a scripting language dedicated to Biz/Browser.

The language specifications are similar to JavaScript, and most of the statements and operators behave in the same way as JavaScript, so the knowledge that must be acquired when developing a Biz/Browser application is minimized.

However, it is not compatible with JavaScript (ECMA-262). Please note that copying the JavaScript written in HTML does not work as expected.

The specifications have been greatly expanded in ver3.0, and many functions similar to JavaScript have been incorporated.

The specifications of classes and package functions have been expanded since ver4.0.

From ver4.1, the $$ symbol function that supports the construction of applications that support multiple languages ​​has been added.

Biz/Browser HT uses the CRS language specifications equivalent to ver5.0.


CRS program building block

Programming languages ​​usually have distinct program building blocks. For example, in the C ++ language, the center is a "class", and a set of classes is a program.

In addition, the class may be described in multiple source files, or some may be linked by DLL. In the C ++ language, these source files and DLLs that make up a program cannot be compiled and, of course, cannot be executed unless they are completely complete.

Many programming languages, not just the C ++ language, need to have all the components in place when they run their program.

In a CRS program, this situation is a little different. The CRS program is loaded by Biz/Browser, compiled into an intermediate language, and then started by the interpreter.

At this time, it is not necessary to have all the elements that make up the program in advance, and execution starts sequentially from the loaded CRS program.

The necessary components are dynamically assembled by the executed CRS program executing the CRS program load instruction " Get method" in the logic .

In this way, the CRS program is dynamically loaded by the program logic and combined with the program running in the interpreter.


Elements of the CRS program

The CRS program mainly consists of class definitions, object structure definitions and event handler function definitions.

Biz/Browser has many built-in classes. Each class defines its own function, for example, the Button class defines the function as a button. You can also use the CRS program to derive existing classes and define new functionality.

Classes are grouped into units called packages, and all classes always belong to packages.

The object is created as an instance of the class. For example, an object of the Button class displays a button on the window. The CRS program configures the screen and defines the data structure by describing the structure in which these objects are created.

The event handler function is passed various events defined by the object. The event handler function describes how it behaves for those events. For example, describe the operation when the button is pressed.


package

What is a package

Packages can include classes, functions, and objects.

A package is defined using the package statement.

package PackageName {
 :
}

Package example (MyPackage.crs)

package MyPackage {
    / * Class * /
    class MyButton extends Button {
        Title = "MyButton";
        Function OnTouch(e){
            MessageBox("Hello");
        }
    }
    /* function */
    Function MyFunction(text){
        return MessageBox(text);
    }
    /* object */
    String MyData = "sample";
}

Today's CRS has a limited concept of packages, where the package name does not affect class identification like other languages ​​such as Java.

For example, many languages ​​allow you to qualify class names with package names, but CRS does not allow you to do so. Therefore, the class name must be uniquely defined in all CRS loaded in Biz / Browser.

When using MyButton in the above example, describe as follows.

MyButton btn {
    X = 10;
    Y = 10;
    Width = 100;
    Height = 30;
}

Functions included in the package can be called from any scope by qualifying them with the package name. When using MyFunction of the above example, describe as follows.

MyPackage.MyFunction("sample");

Similarly, the objects included in the package can be referenced from any scope by qualifying them with the package name. When using MyData in the above example, describe as follows.

MessageBox(MyPackage.MyData);

Functions and data in the package can be used in the same way as import to global namespace using ver3.0 Record.

Package usage

Normally, a package is created as a CRS file separate from the application screen that defines Form etc. By defining application-specific classes, functions, constants, etc. in the package and importing them, it can be used like a library from other CRS programs. The following is an example of a screen that uses MyPackage.

Usage example (Form1.crs)

import "MyPackage.crs";
Form Form1 {
    Width = 800;
    Height = 600;
    MyButton btn {
        X = 10;
        Y = 10;
        Width = 120;
        Height = 30;
    }
}

In this way, you can develop efficiently by importing the CRS file that defines the package. Note that when loading a package with import, the file name must always be the package name with the extension ".crs" added.

Points to note when using packages

Package name and file name

The file name of the package to be imported must have ".crs" added to the package name. Please note that if the file name and package name do not match, import will result in an error.

If the package matching the file name of the specified URL is already loaded in the memory, the operation of the import statement will return immediately without reloading the package. Unlike the GET method, this operation does not involve the operations of caching, communication, compilation, and script execution, so the second and subsequent imports will complete very quickly.

Due to this characteristic, even if you import the same package on multiple screens, only the first time is always executed, so you can implement common processing with almost no overhead even when switching screens.

Package validity period

Once loaded into Biz / Browser, the package will stay resident in memory until the session is reset by the //. Login () and //. Logout () methods. Keep in mind that defining too much data or too many functions in a package will consume a lot of memory.

Consideration to operating speed

Please be aware that defining too much data or too many functions in the package may slow down the operation. When it is necessary to define a lot of data, it is less affected to the operation speed by subdividing the package or defining it hierarchically by using Record objects etc. in the package.

package MyPackage {
    Record dataRec1 {
        String Data1 = "sample1";
        String Data2 = "sample2";
          :
    }
    Record dataRec2 {
        String Data3 = "sample3";
        String Data4 = "sample4";
          :
    }
    :

You don't have to import all the packages provided by the application at the beginning of the application. You can always import it, so it's more efficient to import the packages you really need for each CRS file.

It is easier to develop a program by importing all packages at once, but packages that are not actually used are also loaded, which may take a long time to start up or may reduce the operation speed of the application. be careful.


class

What is a class

Classes define the nature and behavior of objects.

The components that make up the screen (buttons, windows, etc.), the characters that are printed, and each element of the data that is processed are all represented by classes.

The class defines properties, methods, events and constants.

The object is an instance of the class. By manipulating the methods and properties defined by the class with a CRS script, you can instruct the behavior of the object.

Property

A property is an attribute of an object that is expressed as a pair of a property name and a property value, and is an element that determines the property of the object by the value of the property.

By changing the value of the property, the appearance of the object and the reaction to the user's operation change. The state of change depends on which property you changed.

An example

Active property = $TRUE

↓

Active property = $FALSE

There are many types of properties depending on the class of the object. In addition, access control is performed for each property, and there are things that can be changed dynamically, those that can be read-only, and those that can only be specified at the time of creation.

The method

A method is a kind of function. The object behaves according to the method that is executed.

Method call example

Form1.DeleteChild(); /* Delete the contents of Form1. */
Form1.Get("/mainmenu.crs"); /* Load mainmenu.crs into Form1 */

The event

When the object reacts to something, an event is fired. The type of event and the timing of occurrence are defined by the class.

For example, in case of Button class, Touch event is generated when the button is pressed.

An event can be captured by a Function (called an event handler) with the name "On" + event name, and the Event object is passed as the parameter. In the event handler, you can write the processing according to the event.

:
Button btn {
    X = 10;
    Y = 10;
    Width = 120;
    Height = 30;
    Function OnTouch(e) {
        Title = "Clicked!";
    }
}

An operator operating a class

Instanceof and super are prepared as operators for operations related to classes. instanceof is used to check if an object is an instance of a class.

:
if(object1 instanceof TextBox) {
    MessageBox("object1 is a TextBox");
}
:

In this example, a message box is displayed when object1 is a TextBox object or an object of a class defined based on TextBox.

Please note that the class judgment of instanceof is performed in consideration of the derivation relationship.

All CRS classes are derived from the Object class, so object1 instanceof Object is always true if object1 points to something.

The super operator is an operator that can be used only in Function. It is possible to call the method of the derived class by super.

class ClassA extends String{
    Function ToString(){
        return "ClassA:" + super ToString();
    }
}
class ClassB extends ClassA {
    Function ToString() {
        return "ClassB:" + super ToString ();
    }
}
var A = new ClassA;
var B = new ClassB;
A.Value = "test";
B.Value = "test";
print(A.ToString(), "\n");
print(B.ToString(), "\n");

Execution result

ClassA:test
ClassB:ClassA:test

In this example, the call to B.toString() executes the toString() defined in ClassB, and super calls the toString() in ClassA.

The toString() of ClassA is executing super toString (), so the toString () of String is called.

Also, super can be called in function form without specifying a specific Function name.

If you call like a function from within the constructor Function, the constructor of the derived class is called.

When called from within a regular Function, it calls the Function of the same name in the class from which it was derived.

class MyClassA extends String {
    Function MyClassA(arg) {... (A)
     :
    }
}
class MyClassB extends MyClassA {
    Function MyClassB(arg) {
        super(arg); ... (B)
        :
    }
}

In this example, the constructor for MyClassB is called from the constructor for MyClassB.

Class definition

Another class can be newly defined (called derived) in the CRS program based on the class built in Biz/Browser.

The newly defined class inherits the characteristics of the original class, but you can define new characteristics and modify the original characteristics.

 :
class ClassName extends BaseClassName {
 :
}

A classe is defined using the class statement. The class from which to inherit is specified with the extends keyword (called Base class).

 :
class CustCode extends TextBox {
    Width = 120;
    Height = 24;
    MaxLength = 12;
    FontSize = 12;
    FontKind = $BOLD;
    Function OnGetFocus(e){
        BgColor = $ YELLOW;
    }
    Function OnLostFocus(e){
        BgColor = $STD;
    }
}

In this example, the CustCode class is defined based on TextBox. As a behavior unique to the CustCode class, you can implement a TextBox that turns yellow when it receives focus and returns when it loses focus.

When creating an application screen, it is better to define a class corresponding to the input items and place the object on the screen in this way, rather than defining the input fields individually for each screen, which improves development efficiency and maintainability. To do.

Example of using CustCode class

:
Form form1 {
    :
    CustCode cd1 {
        X = 10;
        Y = 10;
    }
    :
}
:

Functions written within class definitions behave like methods.

The functions defined in the class are managed in units of the defining class. For example, if function F is defined in both class B, which is derived from class A, then function F in class A and function F in class B coexist as separate things. Calling such a function with the same name defined from an object executes the function of the highest defined class in the class hierarchy.

class ClassA extends String {
    Function FunctionF(){
        return "ClassA:" + Value;
    }
}
class ClassB extends ClassA {
    Function FunctionF(){
        return "ClassB:" + Value;
    }
}
var A = new ClassA;
var B = new ClassB;
A.Value = "test";
B.Value = "test";
print(A.FunctionF(), "\n");
print(B.FunctionF(), "\n");

Execution result

ClassA:test
ClassB:test

The behavior of calling the top-level function in this way is determined only by the class hierarchy of the object, regardless of the location of the calling script.

class ClassA extends String {
    Function PrintFunc(text) {... (A)
        print("ClassA.PrintFunc:", text, "\n");
    }
    Function FunctionA() {... (B)
        PrintFunc("ClassA:" + value);
    }
}
class ClassB extends ClassA {
    Function PrintFunc(text) {... (C)
        print("ClassB.PrintFunc:", text, "\n");
    }
    Function FunctionB() {... (D)
        PrintFunc("ClassB:" + value);
    }
}
var C = new ClassB("test");
C.FunctionA(); ... (X)
C.FunctionB(); ... (Y)

Execution result

ClassB.PrintFunc:ClassA:test
ClassB.PrintFunc:ClassB:test

In this example, the function (B) and (C) are executed by calling FunctionA of (X).

When calling FunctionB of (Y), the functions of (D) and (C) are executed.

This works like replacing PrintFunc in ClassA with ClassB, which is a derivative of ClassA.

You can also give yet another behavior by deriving ClassB and defining ClassC and redefining PrintFunc as follows:

class ClassC extends ClassB {
    Function PrintFunc(text) {
        //.MessageBox("ClassC.PrintFunc:"+ text);
    }
}
var C = new ClassC("test");
C.FunctionA();

Execution result

constructor

Every class has a dedicated initialization method with the same name as the class called the constructor.

The constructor is called automatically when the class is instantiated.

How the constructor behaves and what arguments it takes depends on the class.

For example, if you pass a string to the String class constructor, the String object will be initialized with that string.

var v = new String("test");
print(v, "\n");

Execution result

test

You cannot call the constructor in any context other than object initialization.

For example, the following script will cause an error.

var v = new String();
v.String("test");
print(v, "\n");

When defining a class, the constructor is defined like a regular function, but the function name is the same as the class name.

Example of constructor definition

class MyString extends String {
    Function MyString(text) {
        super(text);
        value = ">>" + Value + "<<";
    }
}

If you do not define a constructor, it behaves as if the same constructor as the constructor of the derived class was defined.

class MyString extends String {
    Function MyString(text) {... (A)
        super(text);
        value = ">>" + Value + "<<";
    }
}
class MyString2 extends MyString {
     :
    (Constructor function undefined)
     :
}
 :

var c = new MyString2("test"); ... (B)

In this case, the constructor called by new of (B) is (A).

The arguments of the constructor can be specified by creating an object with the new operator and calling the constructor of the derivation class with the super () statement.

var v = new MyString("hello");

Whenever the constructor is called, you must call the derived class's constructor with a super() statement.

class MyString extends String {
    Function MyString(text) {
        super (text);
        value = ">>" + Value + "<<";
    }
}

Normally, you should execute super() at the beginning of the constructor.

If the constructor does not include a super statement, the process of calling super with no arguments is automatically inserted at the beginning.

If the constructor containing the super statement returns without calling the constructor from which it was derived due to an exception or control statement, object generation is interrupted, the object being initialized is discarded, and the exception is thrown.

Operation when creating an instance

Note that the normal execution timing of scripts in the package and class definition and the variable scope of normal CRS scripts are different.

01: package Package1 {
02:     Number Pdata1 = 10;
03:     String Pdata2 = "sample" + str(Pdata1);
04:     class MyClass extends String {
05:         MyData Cdata1 = Package1.Pdata1;
06:         String Cdata2 = "sample" + str(Cdata1);
07:         Function MyClass(t, d1, d2) {
08:             super(t);
09:             Cdata1 = d1;
10:             Cdata2 = d2;
11:        }
12:         Function FunctionA() {
13:             print(value, Package1.Pdata1 , Cdata1, Cdata2, "\n");
14:         }
15:     }
16:     class MyClass2 extends MyClass {
17:         Number Cdata3 = 20;
18:         Function MyClass2(t) {
19:             super(t, 20, "hello");
20:        }
21:     }
22: }

If you import such a package, it will work as follows.

Object definition part in the package (lines 2 to 3)

Runs when the package loads. The variable scope of this part is Package1.

Therefore, Pdata1 can be used to set the initial value of Pdata2.

Class definition part (lines 4 to 22)

When the package is loaded, it is compiled and the class name is registered.

No execution is done. Note that if there is a grammatical error in the class definition, it will be detected at load time, but runtime errors such as not finding the object to update will not be detected until the instantiation of MyClass.

In the 5th line, an undefined class called MyDate is used, but since the class is not checked for validity at compile time, if the MyData class is defined by the time of the first instantiation of MyClass, no error will occur. ..

The variable scope in this part is an instance of the class.

Therefore, note that the scope associated with the object tree changes depending on the instantiation situation. We expect to refer to Pdata1 defined in the second line in the 13th line, but which object is actually referenced will be undefined depending on the runtime situation.

/ * Impact of objects with the same name as the package name 2 * /
String Package1 {
    String Pdata1 = "ABC";
    MyClass C;
}
:
Package1.C.FunctionA();

In this case, this when FunctionA is executed is Package1.C, and when you refer to Package1 from within FunctionA, instead of Package1 of the package name, Package1 of String is referenced. As a result, Pdata1 references the String Pdata1 instead of the Number object defined in the second line.

Also, if:

/ * Impact of objects with the same name as the package name 2 * /
String foo {
    MyClass C {
        String Package1;
    }
}
:
foo.C.FunctionA();

Since Package1 directly under C which is the origin of the variable scope is preferentially searched according to the search rule, foo.C.Package1.Pdata1 of String is referenced, but it is undefined.

In this way, when you refer to an object outside the class from within the class definition, you must be especially careful that the scope origin is the instance. There is no way to reliably reference Package1.Pdata1 from MyClass.FunctionA as expected in this example, due to the specification that the search for child objects and ancestor objects takes precedence over the package name.

When creating an instance of the class defined in the package, MyClass2, it is executed as follows.

1. The part written inline in the brace of the class is executed in the order of derivation source to derivation destination (String → MyClass → MyClass2).

Line 5: MyNumber object is created and initialized to 10.

Line 6: A String object is created and initialized to "Sample 10"

Line 7: The constructor for MyClass is defined. No execution is done yet.

Line 12: FunctionA is defined.

Line 17: A Number object is created and initialized to 20.

Line 18: The constructor for MyClass2 is defined. No execution is done yet.

2. The constructor is searched from the derivation destination to the derivation source (MyClass2 → MyClass → String), and the first found constructor is called.

Line 18: MyClass2 constructor is executed.

Line 7: MyClass constructor is executed by super() on line 19.

---: The constructor of String is executed by super() on the 8th line.

Below, the sequence returns in the calling sequence.

Notes on class definition

name of the class

The class definition must always be defined in the package. You cannot define a class that does not belong to the package.

The class name must be unique among all classes loaded in Biz/Browser.

The current CRS does not allow duplicate class names in different packages.

Also, since the qualification of the class name by the package name is not supported, please be careful not to duplicate the naming of the class name.

Also, once the class is loaded into Biz/Browser, it will not be released until the session is disconnected.

From this point as well, please be careful in naming the class name so that duplication or batting with the object name does not occur due to coding rules etc.

Derivation relationship

The class must always be defined as derived from an existing class.

You cannot define an entirely new class that has no underlying class.

A new class can be defined by further deriving a class defined by CRS, but the underlying class must be defined before the position where the new class is defined.

Class constraints defined by the script

With the current CRS, there are many restrictions on class definitions.

Most of the restrictions are due to the difference between the behavior of built-in classes and the behavior of script-defined classes. When using classes, it is necessary to design with these restrictions in mind.

The newly defined class cannot be used as an array. If you need to use it as an array, store it in an Array object.

This restriction means that even if you define a new class by deriving a class that is forced to be arrayed, such as CheckItem class, which is used as an option of CheckBox class (class that displays a check box), it is not actually available. I mean.

The newly defined class cannot have methods that behave like built-in classes.

By defining a Function, it is possible to make it function almost the same as a method, but unlike a method, it cannot be used in a recalculation formula or the number of arguments cannot be restricted.

In addition, the method that is called in cooperation with the built-in classes (for example, the xmlDocument.load() method calls the read() method of the object passed as an argument) cannot be replaced with Function.

Newly defined classes cannot have properties that behave like built-in classes.

By defining a child object, it behaves much like a property, but with different details.

Properties are access controlled, but not child objects. Properties cannot be deleted, but child objects can.

Also, there are some things that the behavior of the object is activated by the property setting (the selection position changes with the set of the Value property of the ListBox, the corresponding Selected property of the ListItem is updated, etc.), but such behavior is expressed by the child object. You can not.

You cannot define an event that behaves like a built-in class in a newly defined class.

User-defined events can be issued, but unlike the built-in events, they are not displayed in the event view of Biz/Designer.

Static methods (methods that do not require an instance, such as Math.abs ()) and class constants (FileSystem.OPEN_READ, etc.) cannot be defined in the newly defined class. Use the object definitions in the package instead.

Functions in the package can be called by packagename.functionname, and objects can be referenced by packagename.objectname.

Functions in the class definition are managed by class, but child objects cannot be managed by class.


CRS archive

What is a CRS archive?

A CRS archive is a file with the extension car, which is a compression of multiple files into a single file.

CRS archives are abbreviated as CAR (Crs ARchive) files. By storing related programs and data in a CAR file, there are many advantages such as reduction of communication overhead and encryption to keep the program secret.

For more information on the contents of CAR files and how to create them, refer to the "Using CRS Archive (CAR)" chapter in the Biz/Designer Operation Guide.

This section describes how to use the prepared CAR file.

Loading CAR file

The CAR file is loaded by the import statement from the location indicated by the URL.

import car-file-url [, version ];

If the extension part of the URL specified by car-file-url is .car or .car41, the import statement will operate assuming that the target to be loaded is a CAR file. If the extension is other than these, even if the content is a CAR file, it is not considered as a CAR file and cannot be loaded normally.

You can load a specific version of a CAR file by specifying an optional version, which is optional .

The version of the CAR file can be found in "Version" in the "Project Information" tab from the "Project Settings" dialog displayed in <Project menu> and <Settings> of Biz/Designer. Specify.

If version is specified, if there is already a cached CAR file on the local computer, it will be checked against the version number, and if there is a mismatch, the CAR file will be cached and the CAR file will be retrieved and cached.

After deleting all related files, download a new file from the location specified by car-file-url .

import behavior

When loading a CAR file, the following behaviors occur:

1. Searches if the URL specified for import is already loaded in memory.

As a result of the search, if a CAR file with the same URL is found in memory and version is specified in import, version matching will be performed. If the resulting version mismatch, a CRS-405 exception will be thrown and processing will be aborted.

If a CAR file with the same URL is found in memory and the version number is not specified, it will be already loaded and will return without doing anything.

2. Get CAR file image

If the CAR file of the specified URL is not found in the memory, the CAR file is obtained by searching in the following order.

(1) Cache

The URL specified by import is searched from the cache.

(2) Inside another CAR file that is already loaded in memory

If the URL specified by import is parsed and identified as a URL that points to the inside of another CAR file, the recognized CAR file is searched from the memory and the CAR file of the specified URL included is extracted.

For example, the following case

import "http://server/lib1.car";

import "http://server/lib1.car/subdir/lib2.car";

In this example, lib1.car is loaded first, and lib2.car is specified in the URL that points to the inside of lib1.car in the subsequent import, so lib2.car is searched from inside lib1.car.

(3) External resources such as WEB server

If the target CAR file is not found in the above search, it will be downloaded from the specified URL.

If the CAR file specified in the above search is not found, an exception indicating the cause will be thrown and the import process will be interrupted.

3. Verification of the acquired CAR file

Verify the header information of the compressed CAR file, etc., and confirm that it is a legitimate CAR file. If it is recognized as an invalid file, an exception indicating the cause will be thrown and the import process will be interrupted.

4. Check the version

If the optional version is specified in the import statement, it will be collated with the version information included in the acquired CAR file.

When the versions do not match as a result of matching, if the CAR file is fetched from the cache, delete all the caches of the CAR file and the files retrieved from that CAR file, and "2 Get the CAR file image".

The process returns and an attempt is made to reacquire from a source other than the cache.

If the versions of the CAR files obtained from other than the cache do not match, a CRS-406 exception will be thrown and the import operation will be interrupted.

5. Memory expansion of CAR file

The CAR file loaded normally by the above process is maintained in the memory together with the directory information of the file contained inside.

If a file contained in the loaded CAR file is requested in the subsequent processing, the file will be retrieved from this memory image.

6. Processing of project.xml

Read the project.xml included in the CAR file and get the project information from which the CAR file was created.

If "Import CRS file" is specified in the project information, the URL is loaded by the same process as the import statement.

Maintaining the integrity of CAR files

CAR files are also cached according to the same rules as NetObject.GET. Also, if the file contained inside the CAR file is loaded by the GET method, it will also be cached. Therefore, the CAR file and its internal files will be cached separately.

In a sense, CAR files will be cached twice. Also, when the CAR file is loaded, the image is maintained in memory, so the CAR file on the server, the CAR file on memory, the CAR file cache, the cache of the files contained in the CAR file, and one CAR The file will have multiple copies.

This suggests that you need to be a little careful to use CAR fill properly. Consider the following rules to ensure consistency and proper operation of CAR files.

1. There is no way to delete the CAR file loaded in memory.

When managing the version of the CAR file in the application, it is tempting to put a file indicating the version in the CAR file and judge by the value, but such a thing cannot be realized.

This is because the CAR file is already loaded in memory when you retrieve the contents of the CAR file.

If the version number written in the extracted file is not the expected number, even if you delete the cache of the CAR file, the CAR file is already maintained in the memory, so the new version of the CAR file Will be downloaded the next time you start it.

Illegal version control example

import "/lib1.car";
var lib_ver = getHttpSession().Get("/lib1.car/ver.txt");
if(lib_ver.Read()! = "3.0") {
    //.DeleteCache("/lib1.car");
    import "/lib1.car";
}
Get("/lib1.car/main.crs");

The DeleteCache in this example deletes the cache, but lib1.car loaded in memory remains valid. main.crs, which is read by get, is read from the CAR file in memory.

2. There is no useful point in deleting only the cache of files retrieved from the CAR file.

If the CAR file is kept in memory or in the cache, even if you delete the cache of the file retrieved from the CAR file, it will be loaded again from the CAR file in memory or cache. Whenever you delete the cache, you must delete the CAR file cache.

3. When you delete the cache of a CAR file, the cache of the files retrieved from that CAR file is also deleted at the same time.

4. When specifying the version by import, all imports of the same CAR file must specify the same version.

It is common to import one CAR file as multiple CRS files. However, in such a case, if the version number specifications are not always matched, an exception will be thrown.

An example of an exception

--- file1.crs ---

import "lib1.car", "ver1.0";
    :

--- file2.crs ---

import "lib1.car", "ver2.0";
    :

In the above example, the import statement executed later will raise an exception due to a version mismatch.

--- file1.crs ---

import "lib1.car";
    :

--- file2.crs ---

import "lib1.car", "ver2.0";
    :

In this example, if file2.crs is executed later, it will only raise an exception if file1.crs loads a different version.

The easiest way to manage the version in the operation using the CAR file is to specify the version of the import statement, but if you are importing with multiple CRS as in the example above, multiple CRS Needs maintenance and is irrational in another way.

It is also possible to maintain the CAR file version in the same way as version control for regular CRS files.

Example

----- lib1_version.crs -----
String lib1_version = "2.0.0.1";

----- app.crs -----
String lib1_curVersion = "2.0.0.2";
Get("lib1_version.crs");
if(lib1_curVersion! = lib1_version) {
    //.DeleteCache("lib1_version.crs");
    //.DeleteCache("lib1.car");
    Get("lib1_version.crs");
}
import "lib1.car"

With this method, it is important to always keep lib1_version.crs correct as the CAR file is updated. In addition, the description is complicated compared to the version specification of the import statement, and more description is required to manage the versions of many CAR files.

It is not possible to decide which method is better, so select the method that suits the characteristics of your application.


object

An object is an instance of a class. The parts that make up the screen (buttons, windows, etc.), the characters to be printed, and each element of the data to be processed are all managed as objects.

Hierarchical structure of objects

Biz/Browser manages objects in a hierarchical structure with an object named "//" ( Root object) as the apex. Most objects are included in this hierarchy. The Root object is the base point of the hierarchical structure and is the object corresponding to the Biz/Browser window that exists only once.

There is always a " SYS object " (system data) as a child object of the Root object, and there are other objects that represent screens and data defined by the application.

In addition, there are temporary objects that do not belong to the hierarchical structure based on "//" (Root object).

All objects are maintained by reference relationships and are not deleted while one object is referenced by another. Objects connected to the hierarchical structure based on "//" (Root object) always refer to the child object from the parent object, so unless the reference relationship between the parent and child is explicitly broken. Will be maintained.

Objects that are no longer referenced from anywhere are temporarily stored in memory, but are collected and released by the garbage collector of the CRS interpreter.

Object type

Biz/Browser has many built-in classes. Classes can be roughly divided into display classes (hereinafter DisplayObject) derived from the DisplayObject class and other data classes (hereinafter DataObject).

DataObject is a basic class for managing data values, and it is possible to manage the data processed by the application with a logical hierarchical structure, and it is held in the data communication between the client and the server or in the client. It can be used as a temporary work area.

In addition to the functions of data-based objects, DisplayObject is displayed on the screen or form with the same overlap as the hierarchical structure of objects. These objects provide the user with an interface for displaying information and entering data.

DisplayObjects and DataObjects can propagate data to each other in the following ways:

-The "event handler" defined in the object captures and processes the "event" that occurs as a result of screen operations by the user.

-Set automatic recalculation by "reference operator (&=") that represents the relationship between objects.


Events and event handlers

Events occur in a variety of situations, such as user keystrokes, touch operations, changes in display content, and changes in state. The event that occurs is passed to the corresponding event handler via the event queue. In the event handler, the user application can define the behavior according to the content of the event such as changing the property of the object and executing the method.

The event handler is defined as a Function named "On" + event name. The CRS execution engine looks for a Function defined with such a name in the event propagation destination and propagates the event.

Example) Event handler that receives Touch event

Function OnTouch(e){
    Title = "Hello!";
}

The Event object is passed as an argument to the event handler . You can find out what kind of event occurred by the property of the Event object.

Reference of the object that originated the e.From event

e.Reason Event type number

e.EventName Name indicating the type of event

For example, when the keyboard focus is lost due to text input, if there is no input, write as follows to make the background red.

Function OnLostFocus(e) {
    if(e.From instanceOf TextBox) {
        if(e.From.Value == ""){
            e.From.BgColor = $RED;
        }else{
            e.From.BgColor = $STD;
        }
    }
}

The event propagates upward in the object tree with "//" (Root object) as the apex until it is caught by the event handler.

It is captured by the event handler in the process of propagation, or disappears when it finally reaches the Root object.

By calling the PostEvent method in the event handler with no arguments, the event captured by the event handler can be returned to the event propagation flow again.

Event processing timing

Events always go through the event queue. Event storage in the event queue and event handler execution are asynchronous.

In other words, the timing when an event occurs and the timing when an event handler is executed do not exactly match,

and vary depending on the state of the computer at the time of execution. For example, when three consecutive events occur, the execution timing of the event handler varies as follows depending on the computer status.

Case 1

The event handler is fired after the first event is queued.

Case 2

The event handler is fired after the second event is queued.

Case 3

The event handler is fired after all the events have been queued.

Events usually occur when something changes (for example, when you change the selected position of a list box).

A continuous event means that the state is changing continuously.

If you refer to the state that caused the event in the script in a continuous event as in the above case, the referenced result may differ depending on the timing when the event handler is executed.

For example, in the case of changing the selected position of the list box, in case 1, when the Value property indicating the selected position of the list box is referenced, the value set by the first event is referenced. In case 3, the selection position set in the third event is referenced.

Eventually, in all cases, as many event handlers as there are events will be fired, but be especially careful that the current value of the object property may not always match the state when the event was raised.

If you need to determine the more detailed situation when an event occurs , see the Event object passed to the event handler .

For example, in the list box example above, the From property of the event object contains a reference to the ListItem object that was selected when the event was fired.

/* This is a wrong example. Refers to the selected position when the event handler is executed, not when the event occurs */
Function OnTouch(e){
    print("Selected position", ListBox1.Value, "is \n");
}

/* This is a correct example. Refers to the selected position when the event occurs */
Function OnTouch(e){
    print("Selected position", e.From.Index, "is \n");
}

Depending on the type of event and the type of object that triggered the event, various incidental information is attached to the event object and passed to the event handler.

In order to suppress the influence of the execution timing as explained here in the execution of the event handler, be sure to refer to the additional information of the event object for processing.

Event order

Events are stored in the event queue in the same order as the action that caused the event. Also, the events stored in the event queue are retrieved in the same order and passed to the event handler. This order is always constant.

However, there is no guarantee that the actions that raise the event will always occur in the same order. For example, the assumption that the LostFocus event is followed by another object's GetFocus event is incorrect. In addition, the process that assumes a specific order of occurrence is incorrect because it depends on the situation whether the event generated by the screen operation or the event issued by the CRS script comes first.

For example, the events that can occur when you press a Button object are the GetFocus and Touch events.

However, GetFocus does not occur when the Button has focus from the beginning. Also, when a user-defined event is issued in the OnGetFocus event handler, it is undefined whether the Touch event or the user-defined event is stored in the event queue first.

This is because it is not possible to determine which is performed first by the operation of releasing the mouse button or the process of executing the PostEvent method by executing the CRS script, which causes the Touch event.

Event handlers need to be careful to ensure correct behavior no matter what order the events occur.

If you need to rely on the order in which events occur, verify that the factors that issue the events always occur in the same order.

However, all the classes built into Biz/Browser do not guarantee the order of occurrence of multiple events,

so the order of occurrence may be guaranteed only for user-defined events issued by CRS scripts.


User-defined event

You can use user-defined events as well as Touch events defined on the object.

By transmitting information by user-defined events in Form and Dialog, etc., the connection between Form and Dialog becomes looser, and development efficiency and debugging efficiency are improved.

The following is an example of issuing a simple user-defined event.

Issuing a simple user event

Function OnTouch(e){
    ::
    PostEvent(new Event(UserEvent + 1, "CodeSelect"));
    ::
}

UserEvent + 1 is the event number and "CodeSelect" is the event name. Numbers smaller than the event number defined in UserEvent cannot be used in user events because they are reserved by the system.

If you don't use the event number, you can write:

Issuing a simple user event

Function OnTouch(e){
    ::
    PostEvent(new Event("CodeSelect"));
    ::
}

In this format, the argument of the "CodeSelect" part must always describe a string constant.

The above event can be caught by the following event handler.

Function OnCodeSelect (e) {
    ::
}

To define the data that accompanies the event:

Issuing user events with data

Function OnTouch(e){
    ::
    var userEvent1 = new Event(UserEvent + 1, "CodeSelect") {
        String data1;
        String data2;
    }
    userEvent1.data1 = "abc";
    userEvent1.data2 = "123";
    PostEvent(userEvent1);
    ::
}

The above event can be caught by the following event handler.

Function OnCodeSelect (e) {
    if(e.data1 == "abc") {
        ::
    }
    ::
}


Function (user-defined function)

You can define a function (user-defined function) that summarizes a series of processes. The function can take some arguments and return the processing result. Functions are similar to the methods that objects have, but they are not tied to a particular object. Also, unlike methods, there is no specification on the number of arguments.

Function definition example

Function func1(p1, p2){
    return p1 + p2;
}

Caller

var a1 = 2;
var a2 = 3;
func1(a1, a2);

This example is a function that takes two arguments and returns the sum.

The following naming conventions apply to function names, which are the same as object names.

1. Start with an alphabetic or Japanese character

2. The second and subsequent characters must be alphanumeric, underscore (_) or Japanese

3. The total length must be within 30 bytes

Functions can be identified as part of an object tree starting with //, just like objects. For example, if you write as follows, you can call it as //.Form1.Button1.Func1().

Form Form1 {
    ::
    Button Button1 {
        ::
        Function func1(){
            return 10;
        }
    }
}

If an object or function with the same name is already defined in the same hierarchical position, the previously defined object or function will be deleted and replaced with the later defined function.

A function can have any number of dummy arguments, no more than zero. There is no upper limit. The number of arguments does not necessarily have to match in the function definition and caller. If the caller passes fewer arguments than defined, null values ​​are passed for subsequent dummy arguments. Also, if you pass more arguments than the definition, the arguments that exceed the definition will be ignored.

It is not possible to define a variable number of arguments. When a variable number of arguments is required, define the maximum number of arguments that can be assumed as described above, and judge the actually passed arguments by comparing with the null value, or use Array or array object. Become.

The function can return a return value with a return statement, but it is not required. If the return statement does not return a return value, the return value of the function is undefined and no meaningful result is returned.


Expressions and operators

formula

Objects can manage data, but formulas can be used as data values.

When the calculation formula is used, the calculation result is the value of the object.

Since the calculation formula is completed and operates within the client, it operates at high speed without the need for overhead such as network communication.

When a good response is required for interactive operation of the user, it is often not possible to obtain sufficient responsiveness by using the method of requesting processing to the server, but even in such a situation, it is possible It's a good idea to consider whether you can use event handlers or the formulas described here so that they are complete within the client. In particular, for simple value derivation that does not require server-side resources (database, etc.), quick response can be obtained by using an expression, and no load is generated on the server or network.

In the following example, the amount and sales tax are displayed using a formula based on the quantity and unit price entered by the user.

Example

SALES.Amount &= SALES.Quantity * SALES.UnitPrise;

SALES.SalesTax &= SALES.Amount * 0.05;

SALES.TotalAmount &= SALES.Amount + SALES.SalesTax;

*: Multiplying operator

+: Addition operator

&=: Reference operator

If the above example is related to DisplayObject, Amount, SalesTax, TotalAmount will be calculated by inputting Quantity or UnitPrise from the screen, and the calculation result will be displayed on the screen.

This operation does not cause data communication and good responsiveness can be obtained.

In addition, the following operators can be used.

priority | type | symbol | Evaluation order
High | new operator | new | Left → right
 | Member reference operator | .(period) | Left → right
 | Array operator | [ and ] | Left → right
 | Parenthesis operator | () | Left → right
 | Left addition, left subtraction | ++, - | Left → right
 | Right addition, right subtraction | ++, - | Left → right
 | Unary operator | -, +,! | Left → right
 | Arithmetic operator | *, /,% | Left → right
 | Arithmetic operator | +,- | Left → right
 | Relational operator | >, >=, <, <= | Left → right
 | Equivalence operator | ==, !=, ==&, !=& | Left → right
 | Logical join operator | &, &&, |, || | Left → right
 | Ternary operator | ?, : | Right → left
 | Assignment operator | +=, -=, *=, /=, %= | Right → left
 | Assignment operator | =, &=, << | Right → left
Low | Comma operator | , | Left → right


new operator

Format

new ObjectType ["(" [parameter 1 [, parameter 2 [, ...]]] ")"]

Commentary

The new operator creates a new object of the type specified by the object type.

The parameters are constructor parameters that vary depending on the type of object. Objects that can be created with the new operator are limited to objects that do not have controls displayed on the screen.

Objects created with the new operator are not connected to the object tree starting with //. It is automatically deleted when it goes out of scope.

If you want to keep the object created by new out of scope, connect it to the tree with the Append method.

Example

var a = new String("sample");


Addition / subtraction operators

Format

Object[.property]++ …Left addition
Object[.property]- …Left subtraction
++Object [.property] …Right addition
--Object[.property] …Right subtraction

Commentary

Left addition operator

The left addition operator evaluates the value on the left side and then adds 1 to the property on the left side.

Left subtraction operator

The left subtraction operator evaluates the value on the left side and then subtracts 1 from the property on the left side.

Right addition operator

The right addition operator adds 1 to the property on the right side and uses that value as the evaluation value.

Right subtraction operator

The right subtraction operator subtracts 1 from the property on the right side and uses that value as the evaluation value.

var a = 10;
print("a", a, "\n");
print("a++", a++, "\n");
print("a", a, "\n");
print("a--", a-, "\n");
print("a", a, "\n");
print("++a", ++a, "\n");
print("a", a, "\n");
print("--a", --a, "\n");
print("a", a, "\n");

=== Execution result ===

a 10
a++ 10
a 11
a-- 11
a 10
++a 11
a 11
--a 10
a 10


Parenthesis operator

Commentary

The parenthesis operator is used to explicitly specify the operation order.() Is always used in pairs, and expressions in parentheses are evaluated in preference to those outside the parentheses when evaluating expressions.

An example using the parenthesis operator is shown below.

Example of using the parenthesis operator

URIAGE.KINGAKU = (URIAGE.TANKA + URIAGE.COST) * URIAGE.SURYO

In this example, the addition of TANKA + COST is prioritized over the multiplication of SURYO.


Unary operator

Format

-Object [.property] … minus sign operator
+Object [.property] …Plus sign operator
!Object [.property] … Logical negation operator

Commentary

The minus sign operator re-evaluates the evaluation value on the right-hand side as a number and inverts the sign.

The plus sign operator is included as a pair of minus sign operators, but has no meaningful behavior.

The logical negation operator re-evaluates the evaluation value on the right-hand side as a Boolean value and inverts the result.

Example of unary operator

var a = 100;
var b = -100;
var c = 0;
print("a", a, "\n");
print("b", b, "\n");
print("c", c, "\n");
print("-a", -a, "\n");
print("-b", -b, "\n");
print("+a", +a, "\n");
print("+b", +b, "\n");
print("!a",!a, "\n");
print("!b",!b, "\n");
print("!c",!c, "\n");

=== Execution result ===
a 100
b -100
c 0
-a -100
-b 100
+a 100
+b -100
!a 0
!b 0
!c 1


Arithmetic operator

Commentary

Arithmetic operators define the operations that apply between two expressions. The order of priority when evaluating an expression is *, /,%, +,-.

Example of using arithmetic operators

URIAGE.TANKA * 1.05


Relational operator

Format

Equation1 > Equation2
Equation1 >= Equation2
Equation1 < Equation2
Equation1 <= Equation2

Commentary

The relational operator returns the result of comparing the magnitude relation between the lvalue and the rvalue as True or False. The comparison conditions can be classified as follows according to the type of the comparison control formula.

String Compare the magnitude of the code value from the beginning of the character data
Compare the magnitude of the Number value
Date Compare date and time

If the types of the left side and the right side are different, the type conversion is performed and compared as follows.

Left side type | Right-hand side type | Explanation
String | Number | Convert the String on the left side to Number
String | Date | Convert the String on the left side to Date
Number | Date | Convert Date on the right side to Number
null | String | Always false
null | Number | Always false
null | Date | Always false
object | --- | Perform the above conversion using the default properties of the object on the left side

If the types of the left and right sides are the opposite of those in the above table, they will be converted in the same way.

Example of relational operator

1200 < 1000; /* Evaluated as False */
"abc" < "def"; /* Evaluated as True */
URIAGE.TANKA = 100;
URIAGE.TANKA < 200; /* Evaluated as True */


Equivalence operator

Format

Equation1 == Equation2
Equation1 != Equation2
Equation1 ==& Equation2
Equation1 !=& Equation2

Commentary

Equivalent operators are equivalent to relational operators except that they have lower precedence. The conditions for comparison also follow this.

== is true if Equation1 and Equation2 are equal

!= Is true if Equation1 and Equation2 are not equal

==& Is true if expression 1 and expression 2 point to instances of the same object

!=& Is true if expression 1 and expression 2 do not point to instances of the same object

If the types of the left side and the right side are different, the type conversion is performed and compared as follows.

Left side type | Right-hand side type | Explanation
String | Number | Convert the String on the left side to Number
String | Date | Convert the String on the left side to Date
Number | Date | Convert Date on the right side to Number
null | String | Always false
null | Number | Always false
null | Date | Always false
null | null | Always true
object | Non-null | Perform the above conversion using the default properties of the objects on the left side (most objects are value properties)
object | null | If the object entity on the left side does not exist, it is equal to null, and if an entity exists, it is not equal to null.

If the types of the left and right sides are the opposite of those in the above table, they will be converted in the same way.

Example of equality operator

URIAGE.KINGAKU = 1000;
URIAGE.KINGAKU == 1000; /* Evaluated as true */
URIAGE.KINGAKU ==& //.SALES.URIAGE.KINGAKU; /* Evaluated as true */
"" == null; /* Evaluated as false */
"" != null; /* Evaluated as true */
String str1 = "";
str1 == null; /* Evaluated as false */
str1 != null; /* Evaluated as true */
var v1;
v1 == null; /* Evaluated as true */
v1 = str1;
v1 == null; /* Evaluated as false */
v1 = str2; /* Reference for non-existent objects */
v1 == null; /* Evaluated as false */


Logical join operator

Format

Equation1 & Equation2
Equation1 && Equation2
Equation1 || Equation2
Equation1 | Equation2

& And && have the same meaning

| And || have the same meaning

Commentary

The logical join operator evaluates Expressions 1 and 2 as Boolean values ​​and evaluates the result by logical AND (operator & or &&) and logical OR (operator | or ||).

Logical AND evaluates both left-hand and right-hand expressions and returns true only if both are true.

The logical OR evaluates the left-hand and right-hand expressions and returns true if either is true. Otherwise, both return false.

(1 == 1) & (2 < 3); /* Evaluated as true */
(1 == 1) & (2 > 3); /* Evaluated as false */
(1 == 1) | (2 > 3); /* Evaluated as true */


Ternary operator

Format

Equation1 ? Equation2 : Equation3

Commentary

If the evaluation result of Equation 1 is TRUE, Equation 2 is evaluated, and if it is FALSE, Equation 3 is evaluated.

Example of ternary operator

TextBox0.BgColor = R.Error == 0 ? $STD : $RED;

In this example, if the value of R.Error is 0, the background of TextBox0 is the standard color, otherwise it is red.


Assignment operator

Format

Object[.property] = expression;
Object[.property] += expression;
Object[.property] -= expression;
Object[.property] *= expression;
Object[.property] /= expression;
Object[.property] %= expression;
Object << expression;
Object[.property] &= expression;

Commentary

= Operator

The = operator assigns the evaluation result of the expression to the object on the left side.

+= Operator

The += operator adds the evaluation result of the expression to the evaluation value on the left side and assigns it to the object on the left side.

-= Operator

The -= operator subtracts the evaluation result of the expression from the evaluation value on the left side and assigns it to the object on the left side.

*= Operator

The *= operator multiplies the evaluation result of the expression by the evaluation value on the left side and assigns it to the object on the left side.

/= Operator

The /= operator divides the evaluation value on the left side of the evaluation result of the expression and assigns it to the object on the left side.

%= Operator

The %= operator assigns the remainder of the evaluation value on the left side to the object on the left side in the evaluation result of the expression.

<< operator

The << operator behaves differently depending on the type of the object on the left side and the type of the expression on the right side. Normally, the operation is like inserting the value on the right side into the object on the left side. A typical << operator is the insertion of CSV constants defined by the CSVDocument object .

Record r1 [] {
    Number a;
    Number b;
    Number c;
}
r1 << csv {
1,2,3
4,5,6
7,8,9
1,2,3
};

In this example, an indexed Record object to CSV constant insert a.

&= Operator

The &= operator is a type of assignment operator called the reference operator, which is used to define dynamic data references between objects. When you make an assignment with the reference operator, the recalculation is automatically performed when the evaluation result of the expression changes.

Number left = 100;
Label lbl001;
Label lbl002;
lbl001.Value &= left;
lbl002.Value = left;
.. .. .. .. .. ..
left = 900;

In the initial state, 100 is displayed for both labels Lbl001 and Lbl002 on the screen, but when left changes to 900, only Lbl001 is displayed as 900, and Lbl002 does not change. That is, Lbl001 always refers to left by using the reference operator in the assignment expression, and the change is automatically reflected. On the other hand, Lbl002 stores the evaluation value of left at the time of substitution, and even if left changes, it is not reflected.

Circular recalculation

The order in which the calculations are performed is automatically optimized to the most efficient order. Therefore, the order of recalculation may change depending on the situation, and the description should not depend on the calculation order.

Depending on the description of the reference expression, recursive recalculation can lead to an infinite loop. For example, in the following formula, the recalculation does not end forever.

A &= B + 1;
B &= A + 1;

This situation is detected when the recalculation is performed. Be careful when using it in event handlers or ternary operators as it is not detected by expression parsing. If detected as an anomalous expression, execution will be interrupted and a CRS-354 exception will be thrown before the value is evaluated.

Reference operator constraints

Right side of reference operator

On the right side of the reference operator, you can write an expression that satisfies the following conditions.

1. Do not involve update operation.

Throws a CRS-159 exception when the interpreter detects an update behavior. Update operations include ++ and --operators, methods that involve changing, creating, and deleting objects, and function calls. For example, the following description will result in an error.

A &= B++;

Also, calling a user-defined function involves the creation of an internal object because the interpreter allocates a stack frame different from the caller. Therefore, user-defined functions cannot be called by writing them on the right side of the reference expression.

2. Must be connected to an object tree starting with // or located in the global namespace.

You cannot use var variables or objects created with new and not connected to the object tree.

3. Have a name

Describe on the right side an anonymous object that does not have a unique name, such as an object created by new or an object-specific method ( such as the File object returned by the FileSystem.open() method ), or an event object passed to an event handler. You can not.

Left side of reference operator

On the left side of the reference operator, you can specify an object or property that meets the following conditions. You cannot specify a var variable or any other element.

1. Must be connected to an object tree starting with //

You cannot use var variables, objects located in the global namespace, or objects created by new etc. that are not connected to the object tree.

2. Have a name

Anonymous objects that do not have a unique name, such as new, objects created by object-specific methods, or event objects passed to event handlers, cannot be written on the left side.

Conditions for recalculation

The recalculation is executed under the following conditions.

1. All the objects or properties referenced on the right side are actually accessible.

The CRS interpreter cannot verify expression dependencies if the expression contains inaccessible properties. In such cases, no successful recalculation will be performed.

In particular, be careful about recalculation using the index property in an arrayed object.

ListBox L1 {
    ListItem item1[3];
}
ListBox L2 {
    ListItem item2[3] {
        Selected &= F.L1.item1[index].Selected;… [1]
    }
}

This example tries to match the selection position of the ListBox of L2 with the selection position of L1. However, in the case of such a description, the index property, which is a property unique to array elements, cannot be accessed in the scope of [1]. Therefore, in this expression, the CRS interpreter cannot detect the dependency on the L1.item1[n].selected property, and the recalculation is not performed even if the selected position of L1 changes.

In order to perform the recalculation correctly, you need to make the property you always reference accessible as follows:

ListBox L1 {
    ListItem item1[3];
}
ListBox L2 {
    ListItem item2[3] {
        Selected &= index != null ? F.L1.item1[index].Selected : F.L1.item1.Selected;
    }
}

Note The index property, which does not specify the position of array elements, is affected by the ChangeProfile function to maintain compatibility with previous versions. See the global function ChangeProfile for more information.

2. The object or property directly referenced on the right side is updated.

Properties may be accessible by methods specific to the object, user-defined functions, and so on.

In the example below, the value is obtained from the user-defined function provided in the TextBox and the reference operator tries to recalculate the value.

The CRS interpreter does not detect dependencies due to indirect access to such properties. Therefore, the following example does not perform a recalculation.

TextBox TextBox1 {
    ::
    Value = "123";

    Function GetValue() {
        return this.Value;
    }
}
Label Label2 {
    ::
    /* Value &= ^.TextBox1.Value; */
    Value &= ^.TextBox1.GetValue();
}

If you write a commented-out expression instead of the GetCell expression, the recalculation will be executed because you are directly describing the property to actually access.

3. The recalculation of the arrayed objects is performed in ascending order of the array elements.

The recalculation order of array elements always starts with the youngest element.

Release reference operator

The automatic calculation by the recalculation formula is canceled by deleting the object to be calculated, deleting the object that is the base point of the recalculation formula, or assigning another value.

A &= B + 1; [1]
   ::
B = 5; [2]
A = 20; [3]
B = 6; [4]

In this example, recalculation is specified for A in [1], so if 5 is assigned to B in [2], A will automatically become 6. Next, since 20 is assigned to A in [3], the automatic recalculation for A is canceled at this point. Therefore, even if B is updated in [4], A remains 20.

Form F1 {
    TextBox T1 {
        ::
    }
    Label L1;
    Label L2 {
        ::
        F1.T1.Value &= F1.L1.Value * 2;
        Function OnClick(e){
            Delete();
        }
    }
}

In this example, the value of T1.Value is automatically recalculated with L1.Value * 2, but tapping L2 deletes L2. In this case, the T1.Value recalculation formula must be executed with the L2 object as the base point (this), but since the L2 object no longer exists, the automatic recalculation of T1.Value is also canceled.


constant

CRS can handle numbers and character strings as constants, and there are the following types.

type |  | CRS type | Notation example
Numerical value | Decimal integer | Number | 100, -100
 | Hexadecimal integer |  | 0xFF, -0xFF
 | Real number |  | 3.14, -3.14
 | Logical type |  | true, false
letter | String | String | "sky \n"
time | date | Date | "2003/09/01"
 | Times of Day |  | "2003/09/01 12:10:11"

You can also use the special character "\" to include control codes, string delimiters, etc. in the string. The control code and its notation are shown below.

Control code, character | Notation | Example of use
new line | \n | "1st line \n2nd line"
return | \r | "1st line \r\n2nd line"
tab | \t | "Item1 \t Item2"
\\ | \\ | "\\100"

In addition to the above, you can use package-specific constants defined in the package, such as CSV constants. Package-specific constants are typically used when initializing an object with the << operator.

Example CSV constant

CsvDocument csvdoc << csv {
1,2,3
4,5,6
};

Package-specific constants are defined in the following format:

Prefix ['(' argument list')'] Start CODE Data body End CODE

For the previous CSV constant, the prefix is ​​"CSV", the argument list is omitted, the start CODE is "{", the end CODE is "}", and the data bodies are 1,2,3 and 4,5,6. The prefix, start CODE, and end CODE are defined by the package. For example, in the case of an xml constant, the prefix is ​​"XML", the start CODE is "<<-", and the end CODE is "->>".

XML constant example

XmlDocument xmldoc << xml <<-
<? xml version = "1.0"?>
<sample>
    <node/>
</sample>
->>;

The CRS specification has no effect inside the package-specific constant description. You cannot write CRS-specific constants or expressions.

$DESIGNTIME constant

The $DESIGNTIME constant is used during CRS script development by Biz/Designer.

In Biz/Desiger, changes to the CRS script are immediately reflected in the design pane. This operation is convenient for checking the creation screen, but you may feel that it is unnecessary for processing that does not need to be checked immediately.

By using the $DESIGNTIME constant, it is possible to write it so that it does not work during design.

$DESIGNTIME constant

true | Writing CRS script by Biz/Designer
false false | Debugging with Biz/Desiger Or running with Biz/Browser

Example of use

if(!$DESIGNTIME){
    /* Please describe the initial processing here */
}

Some methods and properties may result in an error when executed during design. You can avoid the error by describing those processes in the if statement with the condition! $DESIGNTIME(other than at design time) as in the above usage example.


$$ symbol (external resource constant)

Symbols starting with $$ are identified as external resource constants.

External resource constants are described in the XML format file located in the same directory as the CRS file as shown below. This file is called a resource file.

<?xml version="1.0"?>
<resource>
      <symbol_1>String Text 1 </symbol_1>
      <cust>
              <name>Customer name</name>
              <addr>customer address</addr>
      </cust>
      :
</resource>

The symbol can be any name that can be specified as an XML node name consisting of only alphanumeric characters and underscores (_). String Text 1 is the string that replaces $$ symbol_1.

Button1.Title = $$symbol_1;

If you write "," "String Text 1" is displayed on the button.

To retrieve deeper elements, connect the node names with a period (.). For example, $$ cust.addr is replaced with "Customer Address".

The $$ symbol is replaced as a string constant. Since it cannot be replaced as an expression or a constant of another type, the conversion by CRS script is also used if necessary.

Form1.BgColor = val($$color); /* Numerical conversion example */

If the node corresponding to the symbol cannot be found in the resource file, the constant will not be replaced and it will be treated as a normal variable name. No error will occur.

The resource files to be referenced will be as follows, depending on the language environment at runtime.

language | Resource file
English | resource.en.xml
Japanese | resource.ja.xml
Simplified Chinese | resource.zh.xml
Other | resource.en.xml
Resource file for the language does not exist. | resource.xml (Available since v1.2.4. In earlier versions, the string will be empty.)

If there is no resource file to reference, the string will be empty.

CRS scripts that support different languages ​​can support multiple languages ​​by translating resource files by writing the string constant part using the $$ symbol.

The resource file is downloaded only once when the CRS compiler first encounters the $$ symbol and is kept in memory.

Even if you run multiple CRS files in the same directory in succession, they will only be downloaded once. Resource files are also cached with the same rules as CRS files.

This download and replacement is done at compile time, so the intermediate code stored in the cache will contain the string after replacement.

Therefore, on the first execution, the CRS file as well as the resource files are downloaded, which requires more communication time, more execution time, and more memory than when writing "String Text 1" directly to the CRS file.

However, if the file is executed from the cache a second time or later, there is no overhead at all.


Global function

Global functions built into Biz/Browser can be used for expressions. By using global functions, more complicated calculation formulas can be expressed, and in most cases, interactive operations can suppress requests to the server.

Example of global function

sum() …Calculates the sum.
avg() …Calculates the average.
mid() …Extracts a portion of the string.

Global functions are similar to the methods that objects have, but they are not tied to a particular object and you can write the function name directly in the expression.

In addition to the functions built into Biz/Browser, you can also define application-specific functions.

package MyPackage {
    Function func1(p1, p2){
        return p1 + p2;
    }
}

This example is a function that takes two arguments and returns the sum.

Like global functions, Functions defined in a package are not tied to a particular object. By loading it with the import statement, it can be called regardless of the object scope like a global function.

import MyPackage;
::
var ans = MyPackage.func1(10, 20);
::


Control structure

The control structure of CRS is defined with almost the same grammar as JavaScript.

if… else statement

It is a conditional branch.

if(conditional expression) statement 1 [other statement 2]

Statement 1 is executed when the conditional expression is true. If the option else is specified, statement 2 is executed when the conditional expression is false.

Example

if(item1 == "1"){
    print("item1 is 1");
}else{
    print("item1 is not 1");
}

for statement

It is a for loop.

for (initialization expression; end conditional expression; increment expression) statement

After executing the initialization expression, execute the statement while the termination conditional expression is true. Execute the increment expression before checking the next termination condition.

Executing a break statement within a statement immediately ends the loop. Also, executing a continue statement within a statement enters the next loop without executing subsequent statements.

Example

for(var n = 0; n<10; n++){
    print("n is", n, "");
}

for(var n=0; n<20; n++){
    if(n == 5) continue;
    if(n == 9) break;
    print("n is", n, "");
}

for in statement

A loop that corresponds to elements such as arrays.

for(loop variable in target variable) statement

Execute the statement while assigning a value to the loop variable to enumerate the contents of the target variable. The target variable can be an array of objects, an Array object, and some objects that support iterators. Executing a break statement within a statement immediately ends the loop. Also, executing a continue statement within a statement enters the next loop without executing subsequent statements.

Example

var a = new Array("aa", "bb", "cc")
var n;
for(n in a) {
    print(a[n], "\n");
}

The order of elements in a for in statement is not guaranteed.

while statement

It is a conditional loop.

while(conditional expression) statement

Execute the statement while the conditional expression is true. The conditional expression is evaluated before the statement is executed. Executing a break statement within a statement immediately ends the loop. Also, executing a continue statement within a statement enters the next loop without executing subsequent statements.

Example

var a = 0;
while(a < 10){
    print("a is", a, "\n");
    a ++;
}

do… while statement

It is a conditional loop.

do statement while (conditional expression)

Execute the statement while the conditional expression is true. The conditional expression is evaluated after the statement is executed. Executing a break statement within a statement immediately ends the loop. Also, executing a continue statement within a statement enters the next loop without executing subsequent statements.

Example

var a = 0;
do{
    print("a is", a, "\n");
    a ++;
} while (a <10);

switch case statement

Branch depending on the condition

switch(evaluation formula) {
case Result 1:
    Execution statement
case Result 2:
    Execution statement

    ::
case result n:
    Execution statement
default: default:
    Execution statement
}

Evaluate the evaluation expression and jump to the case label that matches the result. If the default label is defined, it will jump if the evaluation expression does not match any other case label.

Executes the statement after the jumped label, but continues executing the statement that continues even when the next case label is reached. Place a break statement to interrupt the execution of the statement and jump to the end of the switch block.

Example

var data = 1;
switch (data) {
case 0:
    print("data is 0 \n");
case 1:
    print("data is less than or equal to 1 \n");
case 2:
    print("data is less than or equal to 2 \n");
case 3:
    print("data is 3 or less \n");
}

For this example, the result is:

data is less than or equal to 1
data is 2 or less
data is 3 or less

Example of using break statement

var data = 1;
switch (data) {
case 0:
    print("data is 0 \n");
    break;
case 1:
    print("data is 1 \n");
    break;
case 2:
    print("data is 2 \n");
    break;
case 3:
    print("data is 3 \n");
    break;
default: default:
    print("data is 3 \n");
    break;
}

Execution result

data is 1


Exception handling

CRS can handle exceptions with try… catch, much like JavaScript.

try… catch throw statement

try{
    Execution statement 1
}
catch(e){
    Execution statement 2
}

Execution statement 1 surrounded by try blocks is executed, and if an exception occurs during the execution process, statement execution is stopped in subsequent execution statement 1 and control is transferred to execution statement 2.

The formal argument e of the catch statement is passed an Exception object. You can see what kind of exception occurred by the property of the Exception object.

e.Message error message
e.Method Function classification that caused the exception
e.Code Exception code

Example

try{
    var a = foo1(1);
    var b = foo2(2);
    var c = foo3(3);
}
catch(e){
    print("Exception", e.Message, "occurred \n");
}

Within the catch block, you can throw the exception received by catch to a higher block by executing a throw statement with no arguments or by throwing the Exception object received by the catch statement.

try{
    var a = foo1(1);
    var b = foo2(2);
    var c = foo3(3);
}
catch(e){
    if(e.Method == "DOM") {
        print("DOM exception", e.Message, "occurred \n");
    }else{
        throw e;
    }
}

try… catch scope

Exception handling with try… catch is only valid at runtime. Note that even if you put the entire CRS file generated by Biz/Designer in the try block, you will not be able to catch the exception caused by the execution of the event handler.

try {         ← try block start
    Form form1 {
        Width = 100;
        Height = 100;
        ::
        Function OnTouch(e){
            ::
            throw new Exception("app", 1, "test");
            ::
        }
    }
}          ← end of try block
catch(e){
    print(e.Message, "\n");

}

In this example, the entire Form is put in the try block, but this try block catches the exception that occurs when the form is generated, but it exits the try block when the form is generated, so it is in the OnTouch event handler. The exception that occurs in is not catchable.

To catch the exception that occurs in OnTouch, write as follows.

Form form1{
    Width = 100;
    Height = 100;
    ::
    Function OnTouch(e){
        try{         ← try block start
            ::
            throw new Exception("app", 1, "test");
            ::
        }          ← end of try block
        catch(e){
            print(e.Message, "\n");
        }
    }
}

User-defined exception

You can raise an application-specific exception by creating an Exception object and passing it to the throw statement.

Example

Function foo(a){
    if(a == 0){
        throw new Exception("app", 5, "argument is 0");
    }
    return 100 / a;
}

Pass the following values ​​to the constructor of the Exception object.

First parameter: Specifies the type of exception. It is the value of the Method property.

Second parameter: Specify the exception number. It is the value of the Code property.

Third parameter: Specify the description. It is the value of the Message property.

Global exception handler

By defining the OnException function in "//" (Root object), all uncatched exceptions will be caught and called.

::
// {
    Function OnException(e){
        MessageBox("An error has occurred. Please contact your administrator");
        Login("http://server/startup.crs");
        return false;
    }
}
::

The OnException handler is a feature provided to provide an application-specific error reporting method that normally reports an error to the user and exits. When control is passed to the OnException handler, all the call stacks that are being executed are released, so it is not possible to continue processing the script that caused the error.

Also, if another exception occurs while processing OnException, the error handler built into Biz/Browser will be executed.

If the OnException function returns true, the CRS interpreter will continue processing while preserving the session. If it returns anything other than true, the CRS interpreter resets the session and stops it.

Exceptions that can continue processing should be caught by try ... catch in each processing so that control is not passed to OnException. When OnException is executed, the position and contents of the exception cannot be specified, so there is a possibility that the screen is not displayed normally or the object generation is stopped in the middle of the process. there is. After reporting an error, OnException recommends that you stop processing or reset the session with the Login() method and restart the application.


Reserved word

The following keywords are reserved in the CRS language. These keywords cannot be used for variables, object names, etc.

symbol

// ^ + - * / % =

& && &= | || ++ += --

-= *= /= %= == ==& !=

!=& < <= << > >> >= ?

[ ] ( ) { } , .

; : # ~ “ '

keyword

catchevent peekevent break case

catch continue default delete

do else finally for

function if in instanceof

new return switch this

throw try typeof var

void while with abstract

as class const export

extends false final implements

import interface is namespace

null package private public

static super true use

debugger enum goto native

protected synchronized throws transient

volatile


Character encoding that can write CRS programs

The character encoding that can write a CRS program depends on the operating system and the Biz/Browser that runs it.

Biz/Browser version | Corresponding character encoding
Biz/Browser 4.0 or earlier | Shift-JIS
Biz/Browser XE (4.1-4.3) | Native character encoding in the running OS language Example) Japanese OS = Shift-JIS, Simplified Chinese OS = GB2312
Biz/Browser V (5.0) | 1. UTF-8, UTF-16LE with BOM * Since it is internally converted to native character encoding, Unicode characters that cannot be converted to native characters are interpreted as "?" Characters. 2. Native character encoding in the execution OS language
Biz/Browser Mobile 4.0 or earlier | Shift-JIS
Biz/Browser Mobile 4.5 | 1. UTF-8, UTF-16LE with BOM * Since it is internally converted to native character encoding, Unicode characters that cannot be converted to native characters are interpreted as "?" Characters. 2. Native character encoding in the execution OS language
Biz/Browser AI 1.0.0.0-1.0.2.1 | 1. UTF-8, UTF-16LE with BOM 2. If the language set in the "Language" option is Japanese, Shift-JIS, and if it is another language, ISO-8859-1
Biz/Browser AI 2.0.0-2.0.2 | 1. UTF-8, UTF-16LE with BOM 2.Shift-JIS
Biz/Browser AI 2.1.0 or later Biz/Browser SmartDevice 1.0.0 or later Biz/Browser HT 1.0.0 or later | 1. Specify by #encoding pragma (described later) 2. UTF-8, UTF-16LE with BOM 3.Shift-JIS

#encoding pragma

In some Biz/Browser, you can specify which character encoding the CRS program source code is represented by using the #encoding pragma.

This makes it possible to use different character encodings for each CRS file in a multilingual environment and to write CRS programs in UTF-8 without BOM.

The usage of the #encoding pragma is as follows.

#encoding "character encoding name"

Please note the following points when using the #encoding pragma.

-Write the #encoding pragma in the first line of the script.

-In Biz/Browser HT, "Shift_JIS" and "UTF-8" character encoding can be specified.


Behavior when starting Biz/Browser

This section explains how the first screen is displayed after starting Biz/Browser.


Biz/Browser extension association

Extensions are not associated with Biz/Browser HT.
As an alternative, custom URL schemes are available.


Precautions when starting from a web browser

If you tap a hyperlink to a CRS file in a web browser such as Internet Explorer or FireFox, the CRS file will be downloaded by your web browser and passed to you when you start Biz/Browser.

Android version
extensions are not associated.
As an alternative, custom URL schemes are available.

Biz/Browser cannot identify whether the file passed from the web browser is a file downloaded from the server or a file that was originally placed as a local file. As a result, the download destination cannot be specified, and access to the CRS file specified by the relative path cannot be performed correctly.

To avoid this phenomenon, when you start Biz/Browser from a web browser, you need to explicitly tell Biz/Browser the location of the CRS file.

In the CRS file that the web browser downloads first, specify the URL that you should connect to and call the Login method. Biz/Browser loads the CRS passed from the web browser and immediately connects to the original URL.

--- X.CRS ---

Login("http://server/app/main.crs");


Launch Biz/Browser

When Biz/Browser starts, it performs the following operations.

System object generation

Build a SYS object under the Root object . It is generated before the application's CRS is loaded and can be referenced at any time.

Initial screen load

The initial screen changes depending on the command line parameters and the installation status.

When URL is specified in the startup parameter

Get the specified URL to "//" (Root object) with the Get method. This CRS file is not cached and is always downloaded from the server.

When the URL is not specified in the startup parameter

Display the login screen. The login screen is created with a CRS script, and the location differs depending on the platform and version.

If this CRS (login.crs) exists, get it in "//" (Root object) with the Get method.

If login.crs is not found, a login prompt dialog is displayed and the initialization operation is terminated.

Output control of debug information (core dump)

If an unhandled exception is caught in the CRS execution engine while Biz/Browser is running, debug information (core dump) is output and processing is interrupted.

From Biz/Browser V 5.0.2 and Biz/Browser Mobile 4.5.0, the output control of this debug information (core dump) can be performed by command line parameters.

The format of the command line parameters is as follows.

/ coreDump [n]

value

Explanation

0

Does not output debug information (core dump)

1

When an unhandled exception occurs, debug information (core dump) is output.

If the core dump already exists, it will be overwritten.

(Equivalent to the operation of the conventional Biz/Browser)

2

Debug information (core dump) is output each time an exception occurs, regardless of whether it is handled or not.

The process ID and 4-digit serial number are assigned to the core dump file name, and a new core dump is created each time a core dump is output.

If omitted, it is considered that 1 is specified.

It is possible to specify it when
creating the Android version shortcut .

Exclusive execution and URL move specification

In the Android version, multiple Biz/Browser HT cannot be started at the same time. If Biz/Browser HT is already running, it works as follows.

-If you start by tapping the Biz/Browser HT icon, activate the running Biz/Browser HT.

-If you start by tapping the shortcut of Biz/Browser HT where the login destination URL is specified or the URL of the custom URL scheme, activate the Biz/Browser HT that is already running and force it to the specified URL. Move (execute the login method).

This completes the startup process.


Behavior when logging in to Biz/Browser

When Biz/Browser connects to the server, it does the following:

Reset existing objects

All objects created by the application will be deleted. User-defined packages, user-defined classes, etc. are all released.

Reset existing session

Delete the session information (cookies, user ID, password, etc.) of the server you were previously connected to. Cookies received from the server connected before login and passwords received by HTTP authentication will be lost and cannot be sent to the newly connected server.

Regeneration of system objects

Rebuild and reset the //.SYS system object. The //.SYS.APPROOT and color palette set by the previously logged in server will be initialized and reset at this stage. However, //.ShellId is never reset.


Connection license

In the license management method based on the connection license , the license is managed for each Web server accessed from Biz/Browser HT.

Only the licensed web server can be accessed.

The connection license is registered by importing the connection license certificate (XML file) into Biz/Browser HT .

The connection license certificate is placed on the Web server and distributed to Biz/Browser HT of each client.

The connection license certificate also allows you to specify the security level .


Connection license mechanism

This section describes the technical mechanism and usage of the connection license.

Connection license overview

Information on the Web server that can be connected is registered in the connection license. Biz/Browser HT only allows communication to the registered web server.

A connection license is required for each server to connect to. The connection license to server A is not available on server B. Also, if the expiration date is specified, the connection license will be invalid after the indicated date.

Functions restricted by the presence or absence of a connection license

Biz/Browser HT has many communication functions, but only http or https communication using the Get method of the NetObject class is restricted by the presence or absence of a connection license.

The Login method of the Root class, the Get , Post method, and import instruction of the HttpSession class communicate regardless of whether or not there is a connection license.

If you do not have a connection license

Registration of connection license

The connection license is registered by importing the connection license certificate into Biz/Browser HT .

The connection license certificate (XML file) is placed on the Web server and distributed to Biz/Browser HT on each client terminal. Download the connection license certificate from the CRS program with the importConnectionLicense function. If there is no problem with the description, the connection license will be registered.

The registered connection license certificate is saved in the client terminal on which Biz/Browser HT is installed, and is automatically loaded the next time Biz/Browser Mobile is started.

In Biz/Browser V or later, the security level is described in the connection license certificate . The security level of the certificate is applied when connecting to the web server. By using the connection license certificate, the security level of each client PC can be managed collectively on the server side.

Confirmation of connection license

You can check the registered connection license from the Biz/Browser HT menu "View"-> "Show licenses".

You can also check it with the hasConnectionLicense function on the CRS program .

General license registration flow

A system using Biz/Browser HT starts by calling the Login method. (The Login method is also called when selecting the URL on the login screen.)

//.Login("http://server/start.crs");

Communication by the Login method is not restricted by the connection license. That is, the CRS file specified for this method can be run without restrictions. Normally, you write a program to register a connection license in this CRS file.

start.crs

/* Check and import connection license */
if(!hasConnectionLicense ("http://server")) {
    try {
        importConnectionLicense("http://server/license.xml");
    } catch(exp) {
        MessageBox(exp);
        Login();
    }
}
Get("appmain.crs");

The main CRS file of the system is called by the Get method of the NetObject class after confirming and registering the connection license .

Information on the connection destination Web server

"Protocol (http, https, etc.)", "Host name", and "Port number" are registered as Web server information in the connection license. (Example: http://example.com:8080)

Biz/Browser Mobile will only allow communication if it exactly matches this information.

For example, there are various notations for "host name" that indicate the same connection destination, such as the presence or absence of a domain, direct notation of IP address, and alias of host name, but only the notation that matches the host name registered in the connection license. Is enabled.

Since the connection license is registered for each Web server, it is not restricted by subsequent URLs. For example, URLs such as /app1/sample1.crs and /app2/sample2.crs are not restricted individually even if app1 and app2 are on different systems.

The connection destination is checked by the connection license for the URL accessed by the Get method. Even if the location of the CRS file actually placed is different (relay by another server, load balancer, etc.), the URL to be accessed first will be the target.

Starting with Biz/Browser HT 1.2.2, authentication by license is required even when executing CRS placed on a local address.

The local address is described by the file protocol. (Example: file:///sdcard/esample)

Storage location of connection license certificate

The storage location of the connection license certificate (XML file) on the client PC differs depending on the purpose of use (public, private), OS, and Biz/Browser version described in the certificate.

When the purpose of use is public

Android version
The intended use in the internal storage is stored in a different location than the public license. You will not be able to access the location where the license is stored.

When the purpose of use is private

Android version
is stored in the location where the purpose of use in the Android version internal storage differs from the public license. You cannot access the storage location of the license.


Connection license certificate

The connection license certificate is an XML file with the following format.

The connection license certificate will be issued by OpenStream based on the registered information.

Please contact Open Stream for details on how to obtain it.

Contents of connection license certificate

The connection license certificate contains the following information.

serial_no

The serial number. A unique number is assigned to each connection license certificate.

product

The product name and version to license.

company

The licensed company name. The registered company name (in English) will be set.

person

The name of the person who received the license. The registered name (English notation) will be set.

usage

It is the purpose of use.

Either public or private is set

public can be used in common regardless of the logged-in user of the client PC.

For private, the license is managed for each logged-in user of the client PC.

date

The date and time when this connection license was issued.

expire

The expiration date when this connection license becomes invalid. This field is not available for perpetual licenses.

security

The security level is set.

url

URL of the licensed web server to connect to.

This field may contain an * (asterisk) for unlimited connections.

This field may be listed multiple times.

Starting with Biz/Browser HT 1.2.2, authentication by license is required even when executing CRS placed on a local address.

The local address is written in the file protocol. (Example: file:///sdcard/example)

The following special paths can also be registered.

Path | Notation in the license file
Apps downloaded locally in the app list | file://<APP_LAUNCHER>/(application-specific identification name)
Apps stored in the root path of public attributes | file://<PUBLIC_ROOT>/example

maxconnections

This represents the maximum number of clients that can connect with this license.

expire_action

This is the operation after the expiration date has expired.
If the field is omitted, it becomes the behavior of refuse .

value | motion
refuse | I can't connect.
warn | Display a warning message. The message content follows expire_message .
ignore | Do nothing

expire_message

This is a warning message when warn is specified in expire_action .

signature

It is a digital signature. Checking that the contents of the file have not been tampered with.


Customize the application list screen

In Biz/Browser HT, in addition to the conventional login using the bookmark of the connection destination URL, a visual and easy-to-use login method using the application list screen is available.

In the standard mode (app list screen) of the four types of start modes , you can customize the list of apps to display according to your business.
It is very similar to the format of importing the bookmark URL of the connection destination on the developer mode screen, but it is different in that visual information (thumbnail image), application download described later, local start, etc. can be performed.
This makes it possible to provide business applications (*) with flexible and easy-to-understand operations.

In addition, by changing the operation settings at startup, a system for making customization settings with a single click from a Web browser or Biz/Browser is also available, so these kitting tasks can be performed easily.

* In this section, "Business application that runs on Biz/Browser" is abbreviated as "Business application", including other terms.

App download / local start

By customizing the application list screen, business applications archived in a zip file can be downloaded locally so that they can be started even when the network is offline.
In addition, it is possible to mix business applications that are locally started on the application list screen and business applications that are started by logging in to a conventional server.

* Please note that the CRS file can be started locally, but the network must be online if there is a process involving communication.

How to create business application archive files

Business applications displayed on the application list screen must be archived as a zip file in order to download them locally.
You do not need a dedicated tool for archiving and use the general zip file creation function that comes with the OS standard.

Store the CRS files and image files that make up the business application in one directory, select the directory and create a zip file.
By placing the created zip file on the Web server and specifying that the zip file will be downloaded in the application list definition file described below, you can distribute the application that will be automatically started locally.

Flow of use

(1) Place the application list and business application itself on the server

The developer / administrator of the business application places the application list definition file and business application described below on the Web server.
At this time, the business application can be placed in a zip file that is a collection of CRS, image files, etc., in addition to the conventional format for accessing and starting the server.

(2) Get the app list definition file

application list definition file Download the application list definition file from the URL of the application list definition file preset in Biz/Browser HT by pressing the "Update app" button and based on that, the application list screen Build
The specified app that runs offline will retrieve the files needed for the app to work in bulk from the server, deploy it locally and keep it persistent until it is explicitly deleted or the app is updated. ..

(3) Application startup

Depending on the type of startup method described in the application list definition file, start it on the server or locally.

* By using a custom URL scheme for changing the startup settings, you can set the application list definition from the web page or CRS.

Screen description

The application list screen consists of the following displays.

Logo image

You can display an image of any size (company logo, etc.). Images and image size can be changed in the application list definition file.

App list

Display a list of business applications by the application list definition file that is acquired from the server or is retained locally.
The thumbnail image and application name of the business application are displayed. Click and tap the thumbnail image to log in to the business application.
The size of the thumbnail image is basically 640x480. It can be used for other sizes, but it will be displayed in a scaled version.
In the application list, demo applications are displayed by default.

Update the app

Based on the URL of the preset application list definition file, download the application list definition file from the server.
Also, the app list will be rebuilt at the same time as the download. If necessary, download the file for local operation from the server and extract it locally.
The downloaded application list definition file is also stored locally.
By default, the application list is updated based on the application list definition file for the demo application.

Configuration

Displays the setting dialog that allows you to set the URL of the application list definition file and delete all downloaded local files.

Application list definition file setting Specify the
    server and URL to change the application list definition settings.
Delete all settings Delete
    all files downloaded on the application list screen and application list definition settings, and restore the state immediately after installation.
    Note that Biz/Browser bookmarks and startup mode settings are not deleted.

Switch to developer mode (Android only)

Change the launch mode to developer mode and log in again.

Application list definition file settings

Describe the following setting items in the JSON data of the application list definition file.
For specific JSON data description format, please refer to "Application List Definition File Description Example".
(The character encoding of the app list definition file must be UTF-8 without BOM.)

listapi

Reserved for future expansion. Normally, specify 2.

thumbDir

Specify the directory that serves as the base point for the thumbnail image file name.
It refers to the directory to search for thumbnail images (thumbnail) defined for each application described below.
The directory is based on the connection destination URL (custom URL scheme setting item "appServer") set in the application list definition file.

logoFile

Specifies the file path to the image file that represents the top logo image. The extension can be JPEG, PNG, etc.

logoHeight

Specifies the height of the top logo image. Normally, specify the height of the image specified in logoFile.
If omitted, 80 is set.

applist

Specify the list data of each application. Each data is displayed as one application in the application list.
There is no limit to the number of settings, but operation may be slow if there are many settings.
The following are the setting items described under applist.

id | This is an identifier unique to the application. You can use alphanumeric characters, underscore "_", hyphen "-", and dot "." For the ID. IDs are not case sensitive, and if they are duplicates, the one defined first will be valid.
type | Specify the app type. One of the following values ​​can be specified. archive Unzip the archived zip file locally and launch it offline. url Log in to the specified URL.
name | Specify the app name. The app name is displayed on the screen. There is no limit on the number of characters, but names with a width greater than the display width will not be displayed.
url | Specify the URL for operating the application. This setting operates differently depending on the type. For archive, specify the URL of the archived zip file. If url Login to the specified URL.
startup | When you run the app, specify the path to the CRS file you want to log in first. It is valid only when the value of the app type type is archive.
thumbnail | Specify the thumbnail image of the app. The thumbnail image is displayed on the screen. Only image files with extensions ".jpg" and ".png" can be specified.
attrs | Specify the platform and API version that can display the app on the screen. Multiple conditions can be described. If any of the conditions are met, it will be displayed, and if none of them match, it will not be displayed. The following can be specified. Type, minapi, maxapi are 3 sets to 1 set and cannot be omitted. type Platform type (4 types of "iPhone", "iPad", "Android", " Wintab " can be specified) minapi minimum API version (number of 1 or more or -1 (unlimited) can be specified) maxapi maximum API version (A number greater than 1 or -1 (unlimited) can be specified)

Execution example

The following is a sample that places two apps on the app list screen, one that can be deployed locally and started even when offline, and the other that starts CRS on the server as before.
If you read the JSON data of the application list definition file described below, it will be displayed as the following image.

Execution result

Description example of application list definition file

[
{
    "listapi":"2",
    "thumbDir":"/ appserver / thumbnails",
    "logoFile":"/appserver/corp_logo.png",
    "logoHeight":"45",
    "applist":[
        {
            "id":"system001",
            "type":"archive",
            "name":"Local startup sample",
            "url":"http://example.com/appserver/system001.zip",
            "startup":"/LocalSample/frmMain.crs",
            "thumbnail":"LocalSample_v1.png",
            "attrs":[
                        {"type":"iphone","minapi":"10","maxapi":"-1"},
                        {"type":"ipad","minapi":"10","maxapi":"-1"},
                        {"type":"android","minapi":"10","maxapi":"-1"},
                        {"type":"wintab","minapi":"10","maxapi":"-1"}
                     ]
        },
        {
            "id":"system002",
            "type":"url",
            "name":"Server startup sample",
            "url":"http://example.com/appserver/system002/frmMain.crs",
            "startup":"",
            "thumbnail":"ServerSample_v1.png",
            "attrs":[
                        {"type":"iphone","minapi":"-1","maxapi":"42"},
                        {"type":"ipad","minapi":"10","maxapi":"255"},
                        {"type":"android","minapi":"-1","maxapi":"42"},
                        {"type":"wintab","minapi":"10","maxapi":"255"}
                     ]
        },
        {
            "id":"dummy",
            "type":"url",
            "name":"dummy (always hidden)",
            "url":"http://www.example.com",
            "startup":"",
            "thumbnail":"dummy.png",
            "attrs":[
                        {"type":"ipad","minapi":"0","maxapi":"0"},
                        {"type":"iphone","minapi":"0","maxapi":"0"},
                        {"type":"android","minapi":"0","maxapi":"0"},
                        {"type":"wintab","minapi":"0","maxapi":"0"}
                     ]
        }
    ]
}
]


Check cache integrity

Most CRS files are cached on the client PC the first time they are downloaded, and will be executed from the cache without downloading from the next time onwards. This feature is essential for speeding up applications, but care must be taken to maintain cache integrity.

Updating the CRS file placed on the server does not automatically update the cache. To manage the cache of the client PC, the programmer who creates the application needs to consciously describe the process.

Only the first CRS file loaded from the Root object is not cached. By using this file, you can describe the process to check the consistency of the cache of the client PC.

Use the following function to check the consistency of the cache.

cachedate function

The cachedate function returns the latest modification date of the cache currently held by the client.

If there is a file on the server that is newer than this modification date, it is possible that an older version of that file has been cached.

//.DeleteCache method

The DeleteCache method deletes the cache for the specified URL. If you do not specify a URL, it clears all caches downloaded from the server that downloaded the CRS script that executes the DeleteCache method.

The easiest way is to put it at the beginning of the first loaded CRS file

//.DeleteCache();

It is described as. This method clears all caches on every connection, so there is no inconsistency in the CRS file due to the cache, but performance is degraded.

In general, the method of managing the version number of an application is often used.

This method provides a CRS file, for example named version.crs, that simply sets the version number of the application.

----- version.crs -----
String version = "2.0.0.1";

Write the latest version number in the CRS file that is loaded first, and load version.crs by GET. If the old version.crs is cached, it will be loaded from the cache and should be different from the version number of menu.crs.

----- menu.crs -----
String curVersion = "2.0.0.2";
Get("version.crs");
if(curVersion! = version) {
    //.DeleteCache();
    Get("version.crs");
}

In this way, cache integrity can be managed in a variety of ways. Make sure to take the best management method according to the characteristics of the application.


Operation settings at startup

With Biz/Browser HT, you can select the screen that operates when the application starts from several types according to the purpose.

Biz/Browser HT has the following 4 startup modes.

Standard mode (app list screen)

This mode displays a list of each business application that can be executed from Biz/Browser.
Normally, the demo application is displayed, but you can customize the content displayed on the screen and provide it.
For details , refer to Customizing the application list screen .
For Android and Windows only, a button that can be switched to the developer mode screen is available at the bottom of the screen.
The timeout period for HTTP communication is set to 120 seconds.

Developer mode

This mode displays the login screen in the conventional format that displays a list of bookmark URLs for connection destinations saved by Biz/Browser.
There are also convenient functions for remote debugging with Biz / Designer.
For Android and Windows only, a button that can be switched to the standard mode screen is available at the bottom of the screen.

Blank mode

This mode displays a blank screen at startup. Can be used if you only want to log in with a custom URL scheme.
Only Android can be used.

Custom mode

It is the mode to log in to the preset connection destination URL at startup.
Only Android can be used.

Change operation settings at startup

Biz/Browser startup mode settings and application list definition file settings can be performed directly by executing a link from a browser or Biz/Browser.
Only Android can be used.

Build the URL in the following format and execute the link from the browser or Biz/Browser.

biz-browser://settings?param=<parameter>

For the parameter, specify the URL-encoded data of the JSON data of the following setting items.
Refer to "Parameter JSON data description example" for the specific description format.

apiver | Reserved for future expansion. Normally, specify 1.
appServer | On the application list screen, specify the server to connect to the application list definition file. If manifestFile and either setting item are omitted, both current settings are not changed.
manifestFile | On the application list screen, specify the path to the JSON file of the application list definition file.
homeType | Specify the startup mode of Biz/Browser. The following can be specified. In all other cases, standard mode is selected. If the setting item is omitted, the current setting is not changed. default Standard mode (App list screen) developer Developer mode blank Blank mode (Android only) custom Custom mode (Android only)
homeCustomUrl | Specify the URL to log in when the Biz/Browser startup mode is set to Custom mode.

Parameter JSON data description example (before URL encoding)

[
{
    "apiver":"1",
    "appServer":"http://example.com",
    "manifestFile":"/biz/appserver/applist.json",
    "homeType":"default",
    "homeCustomUrl": "http://example.com/biz/appserver/login.crs"
}
]

Link description example

<a href="biz-browser://settings?param=%5b%0d%0a%7b%0d%0a%09%22apiver ~ %0d%0a%5d">Configure Biz/Browser startup</a>


Manipulating objects

This chapter describes in detail how to work with objects in CRS scripts.


Initial state of the object

Objects have different initial states depending on the class, but this section describes the initialization operations that are commonly performed.

1 Check the type of the default property

Depending on the class of the object to be generated, you can specify the type of the default property (often the Value property), but it will be checked if the specified type is the type accepted by the class, and if it is not accepted If an exception occurs, object creation is interrupted.

2 Separation of objects with the same name

When the object to be created is connected to the object tree, if an object with the same name is already connected to the same hierarchical position, the object will be detached before the new object is created. The function is not an object, but the function with the same name is also deleted.

3 Static connection confirmation to the object tree

The connection is considered before the object is created. Depending on the nature of the object you are connecting to, the connection may be refused. For example, if you connect a Label object that is not allowed to connect to an object of the FlexView class, you will get an exception. However, the checks made here are static, only checks such as the availability of classes and arrays.

4 Object generation

When the object is created, all properties are set to their default values. If the default value is undefined, it will be the initial value according to the property type.

Property type | initial value
Number | 0
Date | 0 (invalid date)
String | Empty string
Object | null

5 Dynamic connection confirmation to the object tree

It is confirmed whether the generated object can actually be connected. This check is dynamic based on the state of the object at that time. For example, if you connect a FlexHeader as a child object of FlexRecord, an exception will be thrown if an object that forms a cell such as FlexLabel is already connected.

6 Connection to the object tree

If the object you create is connected to the object tree, it is now actually connected to the tree.

7 Calling the constructor function

If the created object has a constructor function, it will be executed.

8 Expansion of array elements

If the object is created as an array, the specified number of array elements will be expanded. The objects created up to 7 above are set to function as "array definition information" that indicates the structure of the array. For more information on array objects, see the section on array objects .

9 Recalculation processing

Creating an object can affect recalculation formulas that use the reference operator (&=). The CRS execution engine considers the need for recalculation and performs the recalculation if necessary.

The above is the initialization operation of object creation.

There are parts of the object tree in the description, but if they are not connected to the object tree, their validation will not be performed.

In the case of a class that has a complex structure that includes object creation in the class definition, child objects are created in 4 above, and the processing described here is executed recursively.

Also note that if an exception occurs during object creation, the object in the process of creation will be destroyed, but the detached object with the same name described in 2 above will not be restored.


Object creation

Object is created using the following syntax.

ObjectType[:ValueType] ObjectName;… [1]
ObjectType[:ValueType] ObjectName[n];… [2]

var VariableName = new ObjectType[: ValueType];… [3]
var VariableName = new ObjectType[: ValueType]();… [4]
var VariableName = new ObjectType[: ValueType](constructor argument);… [5]

In the case of the formats [1] and [2], the object that executed this program is connected to the hierarchical structure that becomes the parent object, and the object with the name specified by ObjectName is generated.

[:ValueType] is an optional option that specifies the data attributes of the object.

Example

 TextBox:Number b;

In the above example, a text input field is generated as numeric type data. ValueType may be fixed depending on the type of class. For example, DateEdit class object is always Date type object, so ValueType cannot be specified. If you do not specify ValueType in the creation of an object that can specify ValueType like TextBox, it will be executed as a String type.

[N] of format [2] specifies arraying. When [] is added, the object is created as an array, and n specifies the number of elements at the time of creation.

In the case of the format of [3] [4] [5], the reference of the generated object is stored in the var variable. In this case, the object will not have a unique name and will be accessed by variable name. Variables are not objects, so their names may change depending on the situation.

Example

var text = new String("sample1");
var sample = text;

In this example, the String object can be referenced by the name text or sample. Both point to the same instance in the String object reference. Therefore,

text.value = "sample2";
print(sample);

Then, "sample2" will be displayed in the debugger by the print function.

In the case of format [4], the constructor of the class is called and the default initialization is performed. In the case of format [5], the initialization of the object can be instructed by the constructor argument. The content to be initialized, the content to be specified, the meaning, and the number of parameters of the constructor vary depending on the type of object.

Example Array class constructor

var a = new Array("aaa", "bbb", "ccc");

"aaa", "bbb" and "ccc" are generated as Array elements.

Example String class constructor

var s = new String("sample");

The content will be the sample character string.

Object initialization

You can initialize by setting properties at the same time as creating an Object.

DisplayType ObjectName {
    X = 10;
    Y = 10;
    Width = 20;
    Height = 20;
    :
}
DataType ObjectName = 10;

Some class properties cannot be changed after initialization. Such properties must always be set during initialization.

Hierarchical structure of objects

Most objects belong to a hierarchical structure starting from "//" (Root object). To add a new object to the hierarchical structure, write as follows.

DataType Object1 {
    DataType Object2 {
        DataType Object3 {
            ::
        }
    }
}

Some objects have restrictions on the hierarchical structure. For example, in the case of a FlexView object that displays in a tabular format, the objects that can be created as children are limited to FlexRecord, and the objects that can be created as children of FlexRecord are limited to each class derived from FlexItem.

This constraint is that FlexView objects do not represent tables by themselves.

-FlexView object that defines the table frame and overall display format

-FlexRecord object that defines the display format of table rows

-FlexItem derived object that defines the display form of table columns and the initial value of cells

This is because the table is expressed as a complex of.

The name of the object

Objects in the object tree that originate from "//" (Root object) can be named. Object names have the following restrictions:

1. Start with alphabetic or double-byte characters

2. The second and subsequent characters must be alphanumeric, underscore (_) or double-byte characters

Correct example

ABC

Japanese object name

txt customer code

txt_custcode

Illegal example

12_code ← Starts with a number

txtCustCode ← including whitespace

txt-custcode ← Including symbol

txt Customer address (from prefecture to city) ← Too long

You can use double-byte spaces and symbols, but please avoid using them as much as possible because it is easy to make a mistake.

Variable names in double-byte characters may be garbled and difficult to handle depending on the environment (such as when managing CRS sources on a UNIX-based OS). Please be careful.

Object name collision

Collisions between objects

If an object with the same name already exists in the same hierarchy that created the new object, the existing object will be automatically deleted.

Collision with property

If you create a child object with the same name as the property name, the object search takes precedence. Properties are hidden behind objects and cannot be used.

Conflict with method

If you create a child object with the same name as the method name, the object search takes precedence. The method is hidden behind the object and cannot be used.

Collision with class name

If you create an object with the same name as the class name, you will not be able to access the static methods and properties of the conflicting class within the scope of that object.


Delete object

All objects are maintained by reference relationships. This concept is the same as JavaScript.

Objects referenced by some other object are maintained until the reference relationship is broken.

The object tree starting with "//" is maintained because the parent object references the child object and the vertex "//" object is referenced by the Biz/Browser Mobile runtime.

Objects that do not belong to the object tree are also maintained by reference.

Objects that do not belong to the object tree are typically referenced as variables in the CRS program and are retained until they are lost from scope.

How to delete

All references must be disconnected in order to delete the object.

Use the Delete method to break the reference relationship between parent and child .

Example

//.Form1.Button1.Delete();

This example disconnects the reference between Form1 and Button1.

References by CRS program variables are disconnected as soon as the variable scope disappears, so you do not need to be aware of it. The following example details this.

Example

Function OnTouch(e){
    var csvobj = new CSVDocument; /* 1 */
    var session = getHttpSession(); /* 2 */
    csvobj.Load(session.Get("test.csv")); /* 3 */
    Form1.Spread1.Row << csvobj;
}

1. First, a CSVDocument object is created by new and its reference is stored in the csvobj variable.

2. The getHttpSession function then returns an HttpSession object and its reference is stored in the session variable.

3. In addition, the HttpSession.Get method is executed as an argument to the CSVDocument.Load method and the HttpResponse object is passed to the Load method.

So far, the CSVDocument, HttpSession, and HttpResponse have been referenced. The reference relationships for these objects are as follows:

The operation at the time of opening is as follows.

1. Upon termination of the CSVDocument.Load method, the HttpResponse object will no longer be referenced and will be deleted.

2. Closing the OnTouch event handler clears the out-of-scope csvobj and session variables.

3. The CSVDocument object referenced by the csvobj variable is no longer referenced anywhere and is deleted.

4. The HttpSession object referenced by the session variable is still referenced by Biz/Browser itself and will be preserved without being deleted.


Search for object name

Objects contained in the hierarchical structure starting with "//" (Root object) have the properties of global variables and can be referenced from any position beyond the variable scope of the script. This section describes in detail how the interpreter searches for the object names described in the script to find the corresponding object.

Base point for object search

CRS programs have the concept of this as well as languages ​​such as JavaScript, JAVA, and C ++. Object searches are always resolved with this as the starting point. This, which is the base point, is defined as follows.

This immediately after starting Biz/Browser

The "//" object is this.

Object creation block

The object of the block is this.

Form Form1 {
    X = 10; [1]
    Y = 10; [2]
    Button Button1 {
        X = 10; [3]
        Y = 20; [4]
        String str1 {
            Value = "abc"; [5]
        }
    }
}

[1]-[2]: this is Form1
[3]-[4]: this is Button1
[5]: this is str1

Event handler this

The object that has the event handler is this

User-defined function this

The object that owns the function is this

Search for objects

Object search is expressed by concatenating names with "." (Period) starting from this. The name is not case sensitive.

Form1.Button1.str1 = "xyz";

The CRS interpreter searches for and resolves object search expressions that concatenate such names with periods according to the following rules:

1. Search for the var variable from the inside to the outside of the program block.

The search continues until the run-time context is lost or the block in the current script file ends.

Run-time context breaks

Button B1 {
    var x1 = 10; (A)
    X = 10;
    ::
    Function OnTouch(e){
        ::
        var x2 = 20; (B)
        var x3 = 20; (C)
        for(…) {
            var x3 = 30; (D)
            x1 = 1; [1]
            x2 = 2; [2]
            x3 = 3; [3]
        }
    }
}

In [1], the execution context differs depending on the Function, so x1 in (A) cannot be detected and the search fails.

In [2], x2 of (B) is searched.

In [3], (D) detected first is searched out of x3 defined in (C) and (D).

Search in the current script file

If the same structure as the above example is divided into two script files using the Get method, the resolution result of the search expression will be different.

Button B1 {
    var x1 = 10; (A)
    X = 10;
    ::
    Function OnTouch(e){
        var x2 = 20; (B)
        var x3 = 20; (C)
        Get("for_loop.crs");
    }
}
----- for_loop.crs -----
for (…) {
    var x3 = 30; (D)
    x1 = 1; [1]
    x2 = 2; [2]
    x3 = 3; [3]
}

[1] fails the search as in the previous example.

In [2], the search fails because x2 cannot be detected in for_loop.crs.

[3] searches for (D).

The var variable is renamed at compile time, not at run time, and converted to an intermediate code binary that the interpreter executes. Such script file-dependent name resolution applies only to var variables.

2. Compare with the object name located below this.

3. Compare with the property name of this object.

4. Compare with the method name of this object.

5. Compare with the name of this.

6. Compare with the parent object name of this. From then on, it searches for higher-level objects until it finds the appropriate object.

7. Search from the global namespace.

If the above search does not find the target object, the name will be unresolved. It also resolves all names concatenated by periods that follow the following rule after resolving the first name.

8. If the resolved name is not an object name (property name, method name, etc.), the search will fail.

9. Finds its child objects starting from the object resolved by the rvalue of the period.

10. Find the properties of the object, starting from the object resolved by the rvalue of the period.

11. Finds a method for that object, starting from the object resolved by the rvalue of the period.

Special object name

"//" can be specially used as a name to refer to an object at the top of a hierarchy.

"^" can be specially used as a name to refer to the parent object of this.


Automatic recalculation between objects

For objects included in the hierarchical structure starting with "//", by connecting the objects with the reference operator (&=), the value on the left side is automatically reset in synchronization with the change in the value on the right side of the operator. You can calculate.

How to use reference operators

Example Adjust the display position of the button according to the size of the window

Form Form1 {
    Width = 500;
    Height = 400;
    Button Button1 {
        X &= Form1.Width / 5;
        Y &= Form1.Height / 5;
        Width &= (Form1.Width / 5) * 3;
        Height &= (Form1.Height / 5) * 3;
    }
}

Form1 directly under "//" (Root object) automatically follows the resizing of the window and changes the Width and Height properties. In this example, Button1's X, Y, Width, and Height are related to Form1's Width and Height with the &= operator, so the display position and size of Button1 change as the window is resized. I will.

Example TextBox error display

Form Form1 {
    Width = 500;
    Height = 400;
    TextBox Text1 {
        X = 10;
        Y = 10;
        Width = 100;
        Height = 30;
        BgColor &= (Err == 0? $STD: $RED);
        Number Err {
            Value = 0;
        }
    }
    Button Button1 {
        X = 10;
        Y = 50;
        Width = 100;
        Height = 30;
        Function OnTouch(e){
            if(Form1.Text1 == "") {
                Form1.Text1.Err = 1;
            }else{
                Form1.Text1.Err = 0;
            }
        }
    }
}

In this example, the event handler that reacts when Button1 is pressed sets Form1.Text1.Err to 1 if Text1 is empty, and 0 if Text1 is not empty.

The background color of Text1 is related to Err by the &= operator, so it reacts red when Err is set to 1.

By using the reference operator &= in this way, the script can be written in a more essential process of "setting an error" instead of the process of "making the background red".

Reference operator constraints

Only available in the object tree

The reference operator can only be used for objects contained in an object tree whose vertices are "//" (Root object). It cannot contain anonymous objects referenced by var variables on either the left or right side of the reference operator, or user objects loaded in the global namespace.

Expressions and functions with update behavior cannot be written on the right side

Writing an expression with an update operation on the right-hand side of the reference operator complicates the dependency dependency and is not supported by CRS. Operators that involve update operations include ++ and --operators.

User-defined functions cannot be written on the right side

A user-defined function defined by Function cannot be written on the right side of the reference operator.

Dependency analysis is performed by the symbols that appear on the right side.

Global functions and methods that do not involve update behavior can be written on the right side of the reference operator. Since the CRS interpreter manages dependencies by relying on the symbols (object names and property names) that appear on the right side, recalculation is not executed when a value that changes secondarily by calling a method is described on the right side. You may.


Implicit object creation

CRS automatically creates an anonymous type-aware object when a property or method access occurs on a primitive (String, Number, Date, etc.).

Example

var a = "Sample" .Length;

In this example, the .Length property is referenced for a primitive of the character type "Sample", so the CRS interpreter automatically decomposes this expression as follows and executes it.

var temp = new String("Sample");
var a = temp.Length;

The automatically generated object is automatically deleted when the reference is finished. Therefore, even if you make a method call that involves an update operation, you cannot get the modified result from the object.

However, it is possible to get the return value of the method call.

var a = "abcdefg". ToUpperCase();


Global namespace

References to objects contained in a hierarchical structure starting with "//" (Root object) are always referenced by the object tree hierarchy, but there is a global namespace that can be referenced from anywhere regardless of the object tree.

Objects located in the global namespace can be referenced directly by name without decoration with periods such as //. Form1.

The global functions built into Biz/Browser as standard are located in the global namespace, so you can use them at any time.

When you load a user-defined function into the global namespace, it becomes available like a built-in global function.

Loading user-defined objects into the global namespace uses the following syntax:

import global_name;

global_name is the name of the object to be the global name. The CRS interpreter executes the import statement as follows:

1. Check the global_name.

An error will occur if global_name is duplicated with the class name or global function name.

If global_name has the same name as a user-defined object already loaded in the global namespace, do nothing to complete.

2. Generate a URL.

Add the extension ".crs" to global_name and generate the URL so that the CRS script that executed the import statement downloads from the same directory as the downloaded URL.

In the CRS script at http://server/app1/menu.crs

import sample;

Will generate the URL http://server/app1/sample.crs.

3. Download the CRS file from the generated URL and execute it. This download is cached like the Get method.

4. Check the result.

If the Package object specified by global_name is not created as a result of execution, an error will occur.

The following description is assumed for the CRS file to be imported.

Package sample1 {← This name is placed in the global namespace.
    Number data1;
    Number data2;
    Function func1(){
        ::
    }
    Function func2(){
        ::
    }
    Function func3(){
        ::
    }
}

If you import such a CRS, you will be able to access it from any scope as follows:

var d1 = sample1.data1;
var d2 = sample1.func2();

By loading user-defined objects in the global namespace, you can effectively use common functions and so on.


Manipulating array objects

This chapter describes in detail how to work with array objects in CRS scripts.


Array object overview

The CRS language supports one-dimensional arrays, and most objects can be defined as arrays.

Example

Number num[3];

Objects defined as arrays can access array elements by subscripts. For the subscript, specify an integer starting from 0. Associative arrays with strings as subscripts used in JavaScript Array objects etc. are not supported. (The Array class supports associative arrays)

Example

Number num[3];
for(var n = 0; n <3; n ++){
    num[n] = n * 10;
}
print(num[0], num[1], num[2], "\n");

--- Execution result ---
0 10 20

All array objects function as variable length arrays, and the number of elements can be changed dynamically by using the Insert and Truncate methods for array operations .

When you delete an array element with the Delete method, the element is also deleted from the array object.

Reference: Array class

Similar processing can be performed by using the Array class separately from the array object . The Array class is not an array as a CRS language, but it allows you to access elements by subscripts.

Unlike array objects, the Array class has the following characteristics.

1. The number of elements is automatically expanded by accessing the elements.

var a = new Array;
a[0] = 1;
a[5] = 3;

In this example, the elements of a are expanded from 0 to 5.

2. Individual elements can contain objects of different types.

Button button1;
TextBox text1;
var a = new Array;
a[0] = button1;
a[1] = text1;

In this example, the first element stores the Button object and the second element stores the TextBox object's reference.

3. Supports associative arrays with strings as subscripts.

var a = new Array;
a["ABC"] = 1;
a["DEF"] = 2;

4. In addition, you can sort the elements by the method unique to the Array class.

See the Array class section for more information.


Creating an array object

The array object is created using the following syntax.

ObjectType[: DataType] ObjectName[n] ・ ・ ・ [1]

var variable name = new ObjectType[n] ・ ・ ・ [2]

In the case of the format of [1], the object that executed this program is connected to the hierarchical structure that becomes the parent object, and the object with the name specified by ObjectName is generated.

[: DataType] is an optional option that specifies the data attributes of the object.

Example

TextBox: Number b[2];

Generates an array of text input fields as numeric data.

In the case of the format of [2], the reference of the generated array object is stored in the var variable. In this case, the object will have no unique name and will be accessed by variable name. Variables are not objects, so their names may change depending on the situation.

Example

var text = new String[2];
var sample = text;

In this example, the String array object can be referenced by the name text or sample. Both point to the same instance in the String array object reference. Therefore,

text[0].value = "sample2";
MessageBox(sample[0]);

Then, what is displayed by MessageBox is "sample2".


Manipulating array objects

Arrayed objects are given properties and methods for adding and removing elements that are array-specific operations. These methods and properties are defined in the Object class.

Array object

Property

name | Type | Explanation
Length | integer | Number of elements in the array object

Method

name | Explanation
Insert | Add an element to the array object
Truncate | Delete all elements of the array object

Array elements

Property

name | Type | Explanation
Index | integer | Position of array elements

Method

name | Explanation
Insert | Adds a new element just before the array element


Displaying array objects

I will explain the behavior when displaying objects such as Form and TextBox are arranged.

The basic operation of an array of display objects is the same as that of hidden objects such as Number and Record, and you can operate the array by using array methods and properties such as Insert and Truncate .

For display array objects, in addition to these features, display characteristics are added.

Display coordinates of array objects

The display position of the arrayed display objects is determined by the Layout , LayoutMargin , and LayoutSpacing properties.

The Layout property represents how the object is laid out. LayoutMargin indicates the display interval, and LayoutSpacing indicates the size of the margin.

If Layout = $VERTICAL

If Layout = $HORIZONTAL

$BLANK is another option for Layout. Selecting $BLANK disables the adjustment of the display position of array elements and allows the script to explicitly set individual coordinates.

If Layout = $BLANK

Button btn[3]{
    Width = 80;
    Height = 30;
    Layout = $BLANK;
    Title &= str(Index + 1) + "th";
}
btn[0].X = 10;
btn[0].Y = 10;
btn[1].X = 40;
btn[1].Y = 50;
btn[2].X = 70;
btn[2].Y = 90;

Event handler for array objects

If you array objects that generate events by user operations, such as Button objects, you can define event handlers in the same way as normal non-array.

Form f{
    Width = 400;
    Height = 200;
    Button btn[3]{
        X = 20;
        Y = 20;
        Width = 80;
        Height = 30;
        LayoutMargin = 5;
        Title &= str(Index + 1) + "th";

        Function OnTouch(e){
            MessageBox(e.From.Title);
        }
    }
}

In this way, when adding a Function to an array object, note that the Function also becomes a part of the array element and is copied by the number of elements in the array. Normally, it is not necessary to prepare a Function that only has executable code for each element, which reduces memory efficiency.

Functions that handle array element events work more efficiently if they are defined above the array object. The code in the above example works the same even if you write it as follows. There is a difference in the definition position of Function.

Form f{
    Width = 400;
    Height = 200;
    Button btn[3]{
        X = 20;
        Y = 20;
        Width = 80;
        Height = 30;
        LayoutMargin = 5;
        Title &= str(Index + 1) + "th";
    }
    Function OnTouch(e) {
        MessageBox(e.From.Title);
    }
}


Manipulating array objects with a hierarchical structure

You can create a layered object as an array.

Example

Form frm {
    Width = 800;
    Height = 600;
    Form fArray[3]{
        X = 10;
        Y = 10;
        Width = 190;
        Height = 100;
        Border = $TRUE;
        LayoutMargin = 2;
        Button btn {
            X = 10;
            Y = 10;
            Width = 170;
            Height = 30;
            Title = "button";
        }
        Button btnArray[3]{
            X = 10;
            Y = 50;
            Width = 50;
            Height = 30;
            Layout = $HORIZONTAL;
            LayoutMargin = 10;
            Title &= str(Index + 1) + "number";
        }
    }
}

Even for arrays with such a structure, you can operate array elements by using the Insert and Delete methods.

Example

frm.fArray[1].Delete();

Display the result of executing

Example

frm.fArray[1].btnArray[2].Delete();
frm.fArray[0].btnArray.Insert (1);

Display the result of executing

The GET method from an arrayed object allows you to load and execute another CRS script on an array element.

Example

Form frm {
    Width = 800;
    Height = 600;
    Form fArray[3]{
        X = 10;
        Y = 10;
        Width = 190;
        Height = 90;
        Border = $TRUE;
        LayoutMargin = 2;
    }
    fArray[0].Get("frm1.crs");
    fArray[1].Get("frm2.crs");
    fArray[2].Get("frm3.crs");
}

In this example, frm.fArray is an array object, but the checkboxes and buttons defined in the individually loaded CRS script are not related to the array in frm.fArray and are unique to each array element. Note that it connects to the object tree. Therefore, running frm.fArray.Insert() does not show any objects in the new elements of fArray.


Note on classes that have array objects as child objects

In classes with arrayed child objects such as CheckBox and OptionButton , the Clear and ClearChild methods may not work as intended. This is because the Clear and ClearChild methods do not work on the element objects of the array.

For example, executing the CheckBox.ClearChild method to initialize the list of CheckBoxes has no effect.

Execute the Clear method for each element.


Global function

There are six types of global functions:

String manipulation function

Date function

Arithmetic function

Statistical function

Financial function

System function


String manipulation function

String functions operate on characters and strings.

name | Explanation
find | Search for a string
fullp | Convert half-width characters to full-width characters
halfp | Converts full-width characters to half-width characters
left | Takes a string from the left
length | Finds the length of a string
lower | Convert uppercase letters to lowercase
mid | Takes out a character string from the middle
replace | Replaces a string
right | Takes a string from the right
split | Get elements by separating strings
str | Converts the value to a string
strf | Create a string with a format string
suuji | Converts numbers to Chinese numerals
trim | Removes extra white space in strings
upper | Converts lowercase letters to uppercase
val | Converts a string to a number


find function

iOS Android Windows

Explanation

The target character string is searchedfromthe start position of the character string, and the start position of the matching part is obtained. The position iscounted with 0 at the beginningof the character string .

Call format

var i = find ( character string , target character string , start position [, processing unit ])

Return value

Start position of the matched part

argument

String string

Character string to search

String target string

Search target character string

integer start position

The position to start the search in the target character string

integer processing unit

It is retained for compatibility.

Ignored and does not distinguish half-width and full-width regardless of argument

Mobile compatibility mode
Process the arguments as follows:
value | motion
0 | It does not distinguish between half-width and full-width characters and treats it as one character uniformly.
1 | One half-width character is regarded as one character, and two-byte character is regarded as two-byte characters.

exception

None

Example of use

var str = "I have a book. I have a pen.";
var i = -1;
while(true){
    i = find(str, "have", i + 1);
    if(i<0) {
        break;
    }
    print(i, "\n");
}

Related item


fullp function

Explanation

Converts half-width characters in a character string to full-width characters.

Call format

var s = fullp ( string [, flag ])

Return value

Character string converted from half-width characters to full-width characters

argument

String string

Original string

boolean flag

Specify the processing of voiced sound mark and semi-voiced sound mark.

In the case of $TRUE, the voiced and semi-voiced sound marks are processed.

If $FALSE or omitted, voiced and semi-voiced sound marks are not processed.

exception

None

Example of use

print(fullp("ABCabc123 +-"), "\n");

Related item

halfp function


halfp function

Explanation

Converts full-width characters in a character string to half-width characters.

Call format

var s = halfp( string [, flag ])

Return value

Character string converted from full-width characters to half-width characters

argument

String string

Original string

boolean flag

Specify the processing of voiced sound mark and semi-voiced sound mark.

In the case of $TRUE, the voiced and semi-voiced sound marks are processed.

If $FALSE or omitted, voiced and semi-voiced sound marks are not processed.

exception

None

Example of use

print(halfp("ABCabc123+-"), "\n");

Related item

fullp function


left function

Explanation

Extracts the specified length from the beginning (left end) of the character string .

Call format

var s = left ( string , length [, unit of processing ])

Return value

Extracted character string

argument

String string

Original string

integer length

Number of characters to extract

integer processing unit

It is retained for compatibility.

Ignored and does not distinguish half-width and full-width regardless of argument

Mobile compatibility mode
Process the arguments as follows:
value | motion
0 | It does not distinguish between half-width and full-width characters and treats it as one character uniformly.
1 | One half-width character is regarded as one character, and two-byte character is regarded as two-byte characters.

exception

None

Example of use

var str = "I have a book. I have a pen.";
var s = left(str, 14);
print(s, "\n");

Related item

mid , right function


length function

Explanation

Find the length of the string .

Call format

var n = length ( string [, unit of processing ])

Return value

Specified string length

argument

String string

String to check the length

integer processing unit

It is retained for compatibility.

Ignored and does not distinguish half-width and full-width regardless of argument

Mobile compatibility mode
Process the arguments as follows:
value | motion
0 | It does not distinguish between half-width and full-width characters and treats it as one character uniformly.
1 | One half-width character is regarded as one character, and two-byte character is regarded as two-byte characters.

exception

None

Example of use

var s = "Axis Soft Co., Ltd.";
print(length(s), length(s, 1), "\n");

Related item


lower function

Explanation

Converts uppercase letters in strings to lowercase letters.

Call format

var s = lower ( string )

Return value

String with uppercase converted to lowercase

argument

String string

Original string

exception

None

Example of use

var str = "I have a book. I have a pen.";
var s = lower(str);
print(s, "\n");

Related item

upper function


mid function

Explanation

Extracts a character string of the specified length from the specified position of the character string. The position iscounted with 0 at the beginningof the character string .

Call format

var s = mid ( string , position , length [, unit of processing ])

Return value

Extracted character string

argument

String string

Original string

integer position

Position to start retrieval

integer length

Number of characters to extract

integer processing unit

It is retained for compatibility.

Ignored and does not distinguish half-width and full-width regardless of argument

Mobile compatibility mode
Process the arguments as follows:
value | motion
0 | It does not distinguish between half-width and full-width characters and treats it as one character uniformly.
1 | One half-width character is regarded as one character, and two-byte character is regarded as two-byte characters.

exception

None

Example of use

var str = "I have a book. I have a pen.";
var s = mid(str, 9, 4);
print(s, "\n");

Related item

left , right function


replace function

Explanation

String specified in the position specified from the length just to remove, its position in the replacement string and insert the.

Call format

var s = replace ( string , position , length , replacement string [, processing unit ])

Return value

Replaced string

argument

String string

Original string

integer position

Position to operate in the character string

integer length

Length to delete

String replacement string

String to replace

integer processing unit

It is retained for compatibility.

Ignored and does not distinguish half-width and full-width regardless of argument

Mobile compatibility mode
Process the arguments as follows:
value | motion
0 | It does not distinguish between half-width and full-width characters and treats it as one character uniformly.
1 | One half-width character is regarded as one character, and two-byte character is regarded as two-byte characters.

exception

None

Example of use

var s = "I have a book. I have a pen.";
s = replace(s, 9, 4, "pencil");
s = replace(s, 0, 1, "You");
print(s, "\n");

Related item


right function

Explanation

Extracts the specified length from the end (right end) of the character string .

Call format

var s = right ( string , length [, unit of processing ])

Return value

Extracted character string

argument

String string

Original string

integer length

Number of characters to extract

integer processing unit

It is retained for compatibility.

Ignored and does not distinguish half-width and full-width regardless of argument

Mobile compatibility mode
Process the arguments as follows:
value | motion
0 | It does not distinguish between half-width and full-width characters and treats it as one character uniformly.
1 | One half-width character is regarded as one character, and two-byte character is regarded as two-byte characters.

exception

None

Example of use

var str = "I have a book. I have a pen.";
var s = right(str, 13);
print(s, "\n");

Related item

left , mid function


split function

Explanation

Separates the string with a delimiter string and gets its elements.

Call format

var s = split ( string , delimiter string , element position )

Return value

Element corresponding to the specified element position

If there is no corresponding element at the specified element position , an empty string is returned.

argument

String string

Original string

String Delimiter string

String to use as a delimiter

integer element position

Position of the element to be taken out

Specify by the number where the leftmost element is 0.

exception

None

Example of use

var s = "1999/08/10";
print(split(s, "/", 0), "\n"); /* 1999 is cut out */
print(split(s, "/", 1), "\n"); /* 08 is cut out */
print(split(s, "/", 2), "\n"); /* 10 is cut out */

Related item


str function

Explanation

Converts a number, date, or string to a string.

Call format

var s = str( value [, format string ])

Return value

Converted string

argument

Object value

Value to convert

String Format string

See Format property (optional)

exception

None

Example of use

var n = new Number(1234.56);
var d = sysdate();
var s = "string";
print(str(n), str(d), str(s), "\n");
print(str(n, "999,990.99"), "\n");
print(str(d, "WSWYY.MM.DD"), "\n");

Related item

val function

Format property


strf function

Explanation

Replace %n that appears in the format string with the string specified by the subsequent argument str_n .

%n specifies the next argument in the format string as %1 and the next argument as %2.

If the number of arguments is less than %n, the empty string is assumed and% n is deleted.

If you want to include the character "%" in the format string, specify it as "%%".

However, if the number does not follow the%, the% is output as is.

Call format

var s = strf ( format string [, str_1 [, str_2 , ...]])

Return value

Replaced string

argument

String format string

A formatted string

String str_n

String to replace

exception

None

Example of use

var filename = "sample.txt";
MessageBox(strf("Delete %1. Are you sure?", Filename), "Confirm", $OKCANCEL);

var y = 2011;
var m = 9;
var p = 120;
print(strf("%1 year %February sales are year over year %3 %% \n", y, m, p));

var d = sysdate();
print(strf ("Today is %1 year %2 month %3 day \n", year(d), month(d), day(d)));

Related item


suuji function

Explanation

Converts a number to a string of Chinese numerals. Numbers after the decimal point are rounded off.

Call format

var s = suuji ( number [, display format ])

Return value

Character string converted to Chinese numerals

argument

Number numerical value

Numerical values ​​to convert to Chinese numerals

integer display format

If the number is 321

1: 321

2: San Hyaku 2 Pickup Ichi

3: San Er Yi

If omitted, the display format will be 1.

exception

None

Example of use

var s = suuji(12345);
print(s, "\n");

Related item


trim function

Explanation

Remove all leading and trailing whitespace and line feed code of the character string, and if there are consecutive whitespace in the middle of the character string, make it one.

Call format

var s = trim ( string )

Return value

String with whitespace removed

argument

String string

Original string

exception

None

Example of use

var s = "Aiueo Kakikukeko";
print("[" + trim (s) + "] \n");

Related item


upper function

Explanation

Converts lowercase letters in strings to uppercase.

Call format

var s = upper ( string )

Return value

String with lowercase letters converted to uppercase

argument

String string

Original string

exception

None

Example of use

var str = "I have a book. I have a pen.";
var s = upper(str);
print(s, "\n");

Related item

lower function


val function

Explanation

Converts a string to a number.

Call format

var v = val ( string )

Return value

Converted number

argument

String string

String to convert to number

exception

None

Example of use

var s1 = "123.456";
var s2 = "789";
var v1 = val(s1);
var v2 = val(s2);
print(s1 + s2, v1 + v2, "\n");

Related item

str function


Date function

A function that processes dates and times.

name | Explanation
datedif | Calculate date difference
dateval | Converts a character string into a date serial number
day | Ask for the day
hour | Ask for time
minute | Ask for minutes
month | Ask for the moon
second | Ask for seconds
year | Ask for the year
youbi | Ask for day number


datedif function

Explanation

Returns the periodfrom the start date to the end date .

The start and end date times are ignored.

Call format

var y = datedif( start date , end date , output specification )

Return value

Output Returnsthe difference between the end date and the start date as the specified value.

argument

Date start date

Start date

Date end date

End date

String output specification

"y" years elapsed

"m" Number of months elapsed

"d" Elapsed days

"md" Fraction of days less than a month

"ym" Fraction of months less than a year

"yd" Fraction of days less than a year

exception

None

Example of use

var d1 = dateval ("1964/8/10");
var d2 = sysdate();
var s = datedif(d1, d2, "y");

Related item


dateval function

Explanation

Specifies the format of the date string . Returns 0 if the date string cannot be interpreted as a date.

If you do not include the time in the date string , the time will be 0:00:00. If seconds are not included, it will be 0 seconds.

Call format

var d = dateval ( date string )

Return value

Returns a Date object.

argument

String date string

Specify one of the following formats:

"YY/MM/DD"

"YY/MM/DD HH24:MI"

"YY/MM/DD HH24:MI: SS"

"YYYY/MM/DD"

"YYYY/MM/DD HH24:MI"

"YYYY/MM/DD HH24;MI:SS"

exception

None

Example of use

var d = dateval("2002/2/28");

Related item


day function

Explanation

date Returns the value of the date on which is represented by.

Call format

var d = day( date )

Return value

Returns a number from 1 to 31 that represents 1 to 31 days.

Otherwise it will be 0.

argument

Date date

Date object to retrieve the date

exception

None

Example of use

var d = sysdate();
var t = day(d);

Related item

year , month , youbi functions


hour function

Explanation

Returns the time value of the time represented by date .

Call format

var h = hour( date )

Return value

Returns a number from 0 to 23 that represents 0 to 23 o'clock.

Otherwise it will be 0.

argument

Date date

Date object to retrieve time

exception

None

Example of use

var d = sysdate();
var h = hour(d);

Related item

minute , second function


minute function

Explanation

Returns the minute value of the time represented by date .

Call format

var m = minute( date )

Return value

Returns a number from 0 to 59 that represents 0 to 59 minutes.

Otherwise it will be 0.

argument

Date date

Date object to retrieve minutes

exception

None

Example of use

var d = stsdate();
var m = minute(d);

Related item

hour , second function


month function

Explanation

date Returns the value of the date of the month represented by.

Call format

var m = month( date )

Return value

Returns a number from January to December, from 1 to 12.

Otherwise it will be 0.

argument

Date date

Date object to retrieve the month

exception

None

Example of use

var d = sysdate();
var m = month(d);

Related item

year , day , youbi functions


second function

Explanation

Returns the second value of the time represented by date .

Call format

var s = second( date )

Return value

Returns a number from 0 to 59 that represents 0 to 59 seconds.

Otherwise it will be 0.

argument

Date date

Date object to retrieve seconds

exception

None

Example of use

var d = sysdate();
var s = second(d);

Related item

hour , minute function


year function

Explanation

date Returns the value of the year of the date represented by.

Call format

var y = year( date )

Return value

Returns a number representing the year between 1900 and 2099.

Otherwise it will be 0.

argument

Date date

Date object to retrieve the year

exception

None

Example of use

var d = sysdate();
var y = year(d);

Related item

month , day , youbi functions


youbi function

Explanation

date Returns the day of the week number of the date represented by.

Call format

var y = youbi( date )

Return value

The day numbers are as follows.

0: Mon 1: Tue 2: Wed 3: Thu 4: Fri 5: Sat 6: Sun

argument

Date date

Date object to retrieve the day of the week

exception

None

Example of use

var d = sysdate();
var w = youbi(d);

Related item

year , month , day functions


Arithmetic function

Arithmetic functions are used for general numerical calculations.

name | Explanation
abs | Find the absolute value of a number
and | Finds the logical product
int | Truncate the digits after the decimal point of a floating point number
or | Find the disjunction
rand | Returns a random number in the range 0 to 1
round | Round to the specified digit
rounddown | Truncate at the specified digit
roundup | Round up to any digit
roundm | Makes the original value a multiple of the specified value
sign | Determine the sign of a number
xor | Finds exclusive or

Note that the decimal point operation is a floating point operation internally, so there is a rounding error.


abs function

Explanation

Find the absolute value of the number.

Call format

var a = abs ( arg )

Return value

Returns the absolute value of the number given as an argument.

argument

Number arg

Numerical value for absolute value

exception

None

Example of use

var a;
var b;
b = -123;
a = abs(b); /* a is 123 */

Related item

sign function


and function

Explanation

Finds the logical product of two numbers.

Call format

var s = and( arg1 , arg2 )

Return value

Calculation result

argument

Number arg1

The target number. It is automatically converted to a 32-bit integer internally.

Number arg2

The target number. It is automatically converted to a 32-bit integer internally.

exception

None

Example of use

var a;
a = and(0x0000FFFF, 0x4000C000); / * a becomes 0x0000C000 * /

Related item

or , xor function


int function

Explanation

Truncate the digits after the decimal point of a floating point number.

Call format

var a = int ( arg )

Return value

Returns the number given by the argument, rounded down to the nearest whole number.

argument

Number arg

Original number

exception

None

Example of use

var a;
var b;
b = 123.456;
a = int(b); /* a becomes 123 */

Related item


or function

Explanation

Finds the logical sum of two numbers.

Call format

var s = or ( arg1 , arg2 )

Return value

Calculation result

argument

Number arg1

The target number. It is automatically converted to a 32-bit integer internally.

Number arg2

The target number. It is automatically converted to a 32-bit integer internally.

exception

None

Example of use

var a;
a = or(0x40000000, 0x0000C000); / * a becomes 0x4000C000 * /

Related item

and , xor function


rand function

Explanation

Generate a random number.

Call format

var r = rand()

Return value

Returns a random number in the range 0 to 1.

argument

None

exception

None

Example of use

var a;
a = rand(); /* a is between 0 and 1 */

Related item


round function

Explanation

Rounds to the specified digit.

If the number of digits is omitted, the number after the decimal point is rounded off.

Rounding of the round function (when the number of digits = 0) is

Value + 0.5 or less integers that are the largest (positive direction)

It will be.

Call format

var r = round ( arg , n )

Return value

Returns the value rounded to the specified number of digits.

argument

Number arg

Original number

Number n

Position of the digit to be rounded

exception

None

Example of use

print(round(12345.678, -2)); /* 12300 */
print(round(12345.678)); /* becomes 12346 */
print(round(12345.678, 2)); /* becomes 12345.68 */

print(round(0.49)); /* 0 */
print(round(0.50)); /* 1 */
print(round(0.51)); /* 1 */
print(round(-0.49)); /* 0 */
print(round(-0.50)); /* 0 */
print(round(-0.51)); /* becomes -1 */

Related item

rounddown , roundup , roundm functions


rounddown function

Explanation

Truncate at the specified digit.

If the number of digits is positive, the digits after the decimal point are truncated.

If the number of digits is negative, the integer part is truncated at the specified digit.

When the digit is omitted, the decimal point is truncated.

Truncation of the rounddown function (when the number of digits = 0) is

Maximum (positive direction) of integers less than or equal to the value

It will be.

Call format

var r = rounddown( arg , n )

Return value

Returns a number that is truncated after the specified digit.

argument

Number arg

Original number

Number n

Position of the digit to be truncated

exception

None

Example of use

print(rounddown(12345.678, -2)); /* 12300 */
print(rounddown(12345.678)); /* becomes 12345 */
print(rounddown(12345.678, 2)); /* becomes 12345.67 */

print(rounddown(0.50)); /* 0 */
print(rounddown(-0.50)); /* becomes -1 */

Related item

round , roundup , roundm functions


roundup function

Explanation

Rounds up to the specified digit.

If the digit position to be rounded up is positive, it will be rounded up to the specified digit after the decimal point.

If the digit position to be rounded up is negative, the integer part is rounded up to the specified digit.

When the digit position to be rounded up is omitted, the number after the decimal point is rounded up.

Roundup of the roundup function (when the number of digits = 0) is

The smallest (negative direction) of integers greater than or equal to the value

It will be.

Call format

var r = roundup ( arg , n )

Return value

Returns a number rounded up to the specified digit or less.

argument

Number arg

Original number

Number n

Position of the girder to round up

exception

None

Example of use

print(roundup (12345.678, -2)); /* 12400 */
print(roundup(12345.678)); /* becomes 12346 */
print(roundup(12345.678, 2)); /* becomes 12345.68 */

print(roundup(0.50)); /* 1 */
print(roundup(-0.50)); /* 0 */

Related item

round , rounddown , roundm functions


roundm function

Explanation

Rounds the original value to be a multiple of the specified value.

Call format

var r = roundm( arg , n , m )

Return value

Returns a number rounded to a multiple of the specified value.

argument

Number arg

Original number

Number n

Numerical value for rounding

Number m

Rounding method

value | Explanation
Value greater than 0 | Round up to round
0 | Round to round
If omitted | Round to round
Value less than 0 | Round by truncation

exception

None

Example of use

var a;
var b;
b = 50.67;
a = roundm(b, 10, 1); /* a is 60 */
a = roundm(b, 10); /* a is 50 */
a = roundm(b, 10, -1); /* a is 50 */

Related item

round , rounddown , roundup functions


sign function

Explanation

Determines the sign of a number.

Call format

var s = sign( arg )

Return value

The sign is judged and the following values ​​are returned.

-1: Numerical value is negative

0: The number is zero

1: Numerical numbers are positive

argument

Number arg

Numerical value to judge the sign

exception

None

Example of use

var a;
a = sign(2); /* a is 1 */
a = sign(-1); /* a becomes -1 */
a = sign(0); /* a becomes 0 */

Related item

abs function


xor function

Explanation

Finds the exclusive or of two numbers.

Call format

var s = xor ( arg1 , arg2 )

Return value

Calculation result

argument

Number arg1

The target number. It is automatically converted to a 32-bit integer internally.

Number arg2

The target number. It is automatically converted to a 32-bit integer internally.

exception

None

Example of use

var a;
a = xor(0x0000FFFF, 0x4000C000); / * a becomes 0x40003FFF * /

Related item

or , and function


Statistical function

Statistical functions are functions related to statistical processing such as mean and variance.

name | Explanation
avg | Find the average value
max | Find the maximum value
min | Find the minimum value
std | Find the standard deviation of the data as a whole population
stds | Find the standard deviation using the data as an extraction sample
var | Find the variance of the data as a whole population
vars | Find the variance using the data as an extraction sample
rank | Find the order of the specified data
sum | Find the total


avg function

Explanation

Find the average value.

Call format

var a = avg ( range )

Return value

Mean of data in range

argument

Date or Number range

Array object name

exception

None

Example of use

var arr = new Number[10];
for(var n = 0; n<arr.Length; n++){
    arr[n] = n + 1;
}
print(avg(arr), "\n");

Related item

sum function


max function

Explanation

Find the maximum value.

Call format

var m = max ( range )

Return value

Maximum value of data in range

argument

Date or Number range

Array object name

exception

None

Example of use

var arr = new Number[10];
for(var n = 0; n<arr.Length; n++) {
    arr[n] = n + 1;
}
print(max(arr), "\n");

Related item

min function


min function

Explanation

Find the minimum value.

Call format

var m = min ( range )

Return value

Minimum value of data in range

argument

Date or Number range

Array object name

exception

None

Example of use

var arr = new Number[10];
for(var n = 0; n <arr.Length; n++) {
    arr[n] = n + 1;
}
print(min(arr), "\n");

Related item

max function


std function

Explanation

Consider the data as the entire population and find its standard deviation.

Call format

var s = std ( range )

Return value

Standard deviation of data within range

argument

Number range

Array object name

exception

None

Example of use

var arr = new Number[20];
for(var n = 0; n <arr.Length; n++) {
    arr[n] = int(rand() * 10);
    print(arr[n], "");
}
print(std(arr), "\n");

Related item

stds function


stds function

Explanation

Use the data as a sample extracted from the population to find the standard deviation of the population.

Call format

var s = stds ( range )

Return value

Standard deviation of data within range

argument

Number range

Array object name

exception

None

Example of use

var arr = new Number[20];
for(var n = 0; n<arr.Length; n++) {
    arr[n] = int(rand() * 10);
    print(arr[n], "");
}
print(stds(arr), "\n");

Related item

std function


var function

Explanation

Consider the data as the entire population and find its variance.

Call format

var v = var ( range )

Return value

Distribution of data within range

argument

Date or Number range

Array object name

exception

None

Example of use

var arr = new Number[20];
for(var n = 0; n<arr.Length; n++) {
    arr[n] = int(rand() * 10);
    print(arr[n], "");
}
print(var(arr), "\n");

Related item

vars function


vars function

Explanation

Use the data as a sample extracted from the population to find the variance of the population.

Call format

var v = vars ( range )

Return value

Distribution of data within range

argument

Date or Number range

Array object name

exception

None

Example of use

var arr = new Number[20];
for(var n = 0; n <arr.Length; n++) {
    arr[n] = int(rand() * 10);
    print(arr[n], "");
}
print(vars(arr), "\n");

Related item

var function


rank function

Explanation

Finds the order of the specified data.

Call format

var r = rank ( specified data , order , range )

Return value

Specified data of range order in the data in the

Returns -1 if not found in the data

argument

Date or Number specified data

Data for ranking

Number order

0: Descending order 1: Ascending order

Date or Number range

Array object name

exception

None

Example of use

var arr = new Number[20];
for(var n = 0; n<arr.Length; n++) {
    arr[n] = int(rand() * 10);
    print(arr[n], "");
}
print(The value of "arr[0] is" + str(arr[0]) + ". The rank is" + str(rank(arr[0], 0, arr)) + "rank \n");

Related item


sum function

Explanation

Find the total.

Call format

var s = sum ( range )

Return value

Total of data in the specified range

argument

Date or Number range

Array object name

exception

None

Example of use

var arr = new Number[10];
for (var n = 0; n<arr.Length; n++) {
    arr[n] = n + 1;
}
print(sum(arr), "\n");

Related item

avg function


Financial function

A financial function is a function related to finance.

name | Explanation
cterm | Period when the principal reaches the target maturity amount
db | Depreciation amount by declining balance method
ddb | Depreciation amount by multiplying depreciation method
fv | Future value due to constant investment every period
gankin | Interest on equal repayment of principal
ganri | Interest on equal repayment of principal and interest
irr | Internal rate of return
npv | Net present value of cash flow
pmt | Equal repayment amount of debt
pv | Present value of investment
rate | Period interest rate
sln | Straight-line depreciation
syd | Depreciation amount in arithmetic progression
term term | Number of accumulation periods


cterm function

Explanation

Principal is the target maturities will determine the period to reach.

Call format

var c = cterm ( interest , target maturity , principal )

Return value

Returns the period (year) until the target maturity is reachedwhen the principal is invested at the interest rate

argument

Number interest

For 5%, specify 0.05.

Number Target maturity amount

Target amount

Number principal

exception

None

Example of use

var a = cterm (0.05, 1000000, 800000);
/* a is the number of years to operate 800,000 principal at an annual rate of 5% to 1 million */

Related item


db function

Explanation

Finds the depreciation amount for the specified annual declining balance method.

Call format

var d = db ( acquisition cost , residual price , useful life , years of use )

Return value

Returns the depreciation amount of the annual declining balance method specified by the number of years of use .

argument

Number acquisition cost

Number residual price

Number Service life

Number Years of use

exception

None

Example of use

Related item


ddb function

Explanation

Finds the depreciation amount for the specified annual multiple depreciation method.

Call format

var d = ddb ( acquisition cost , residual price , useful life , years of use )

Return value

Returns the depreciation amount in the annual multiple amortization method specified by the number of years of use .

argument

Number acquisition cost

Number residual price

Number Service life

Number Years of use

exception

None

Example of use

Related item


fv function

Explanation

We seek future value through constant investment every period.

Call format

var f = fv ( reserve amount , interest rate , number of periods , reserve date )

Return value

Calculated with compound interest for each period and returns the amount at maturity.

argument

Number reserve amount

The amount of reserve for each period.

Number interest rate

Interest rate per month. Specify as a decimal.

Number Number of periods

Number of reserves.

Number accumulation date

1 at the beginning of the term, 0 at the end of the term.

If omitted, it will be reserved at the end of the term.

exception

None

Example of use

Related item


gankin function

Explanation

Ask for interest on equal repayment of principal. In the case of monthly repayment interest rate specifies the interest rate per month as a decimal.

Call format

var g = gankin ( borrowing amount , interest rate , number of repayments , period )

Return value

Return interest on equal repayment of principal.

argument

Number Borrowing amount

Number interest rate

Number Number of repayments

Number period

exception

None

Example of use

Related item


ganri function

Explanation

Ask for interest on equal repayment of principal and interest. In the case of monthly repayment interest rate specifies the interest rate per month as a decimal.

Call format

var g = ganri ( borrowing amount , interest rate , number of repayments , period )

Return value

Returns the interest on the equal repayment of principal and interest.

argument

Number Borrowing amount

Number interest rate

Number Number of repayments

Number period

exception

None

Example of use

Related item


irr function

Explanation

The internal rate of return is calculated from the cash flow generated by the investment.

Call format

var i = irr ( estimated rate of return , cash flow range )

Return value

Returns the internal rate of return from the cash flow generated by the investment. In addition, the approximate calculation is repeated based on the estimated rate of return, but if the error does not become less than 0.0000001 even after repeating the approximate calculation 32 times, an error value is returned. In this case, you need to reset the estimated rate of return.

argument

Number Estimated rate of return

Estimated rate of return

Number Cash flow range

Specifies an arrayed object that has cash flow data. (The initial investment amount is specified as negative.)

exception

None

Example of use

Related item


npv function

Explanation

Find the net present value of cash flow.

Call format

var n = npv ( interest rate , cash flow range )

Return value

Returns the net present value of cash flow.

argument

Number interest rate

Number Cash flow range

Objects that are arrayed

exception

None

Example of use

Related item


pmt function

Explanation

Borrowing the interest rate in repayment number of times you ask for repayment of each period in the case of borrowing in principal and interest equal repayment of. In the case of monthly repayment interest rate specifies the interest rate per month as a decimal.

Call format

var p = pmt ( borrowing amount , interest rate , repayment count , payment date )

Return value

Borrowing the interest rate in repayment number of times and returns the repayment amount of each period in the case of borrowing in principal and interest equal repayment of.

argument

Number Borrowing

Number interest rate

Number Number of repayments

Number of repayments

Number payment date

1 for beginning payment, 0 for year-end payment.

If omitted, payment will be made at the end of the term.

exception

None

Example of use

Related item


pv function

Explanation

The amount accumulated for each period is converted to the present value. In the case of monthly reserve interest rate specifies the interest rate per month as a decimal.

Call format

var p = pv ( reserve amount , interest rate , number of periods , payment date )

Return value

The amount accumulated for each period is converted back to the present value.

argument

Number reserve amount

Number interest rate

Number Number of periods

Number of reserves

Number payment date

1 for beginning payment, 0 for year-end payment.

If omitted, payment will be made at the end of the term.

exception

None

Example of use

Related item


rate function

Explanation

Principal is the number of periods in the target amount will determine the interest rate to reach.

Call format

var r = rate ( target amount , principal , number of periods )

Return value

Principal is the number of periods in the target amount and returns the interest rate to reach.

argument

Number Target amount

Number principal

Number Number of periods

exception

None

Example of use

Related item


sln function

Explanation

Find the depreciation amount using the straight-line method.

Call format

var s = sln ( acquisition cost , residual value , useful life )

Return value

Returns the straight-line depreciation amount.

argument

Number acquisition cost

Number Residual value

Number Service life

exception

None

Example of use

Related item


syd function

Explanation

Find the depreciation amount in arithmetic progression.

Call format

var s = syd ( acquisition cost , residual value , useful life , years of use )

Return value

Returns the depreciation amount in the arithmetic progression of the year specified by the number of years of use .

argument

Number acquisition cost

Number Residual value

Number Service life

Number Years of use

exception

None

Example of use

Related item


term function

Explanation

Find the period until the target amount is reachedwhen the reserve amount isaccumulatedat the interest rate .

Call format

var t = term ( reserve amount , interest rate , target amount , reserve date )

Return value

Returns the period until the target amount is reachedwhen the reserve amount isaccumulatedat the interest rate .

argument

Number reserve amount

Number interest rate

Number Target amount

Number accumulation date

1 at the beginning of the term, 0 at the end of the term.

If omitted, it will be reserved at the end of the term.

exception

None

Example of use

Related item


System function

System functions are used to get information about the system.

name | Explanation
cachedate | Returns the latest update date of cache information obtained from the currently connected server
clearCoreDump | Delete the output core dump file
debugMessage | Display debug messages in Biz/Designer
deleteCache | Delete cache
decodeURL | URL decode the string
encodeURL | URL encode the string
findHttpSession | Search and create the specified HTTP session
getBookmark | Get Bookmark List
getCoreDump | Get a File object for the core dump file
getCoreDumpList | Get the list of output core dump files
getHttpSession | Get the current HTTP session
hasConnectionLicense | Check connection license
importConnectionLicense | Import connection license certificate
link | Execute a hyperlink
print | Display debug messages in Biz/Designer
remBookmark | Delete bookmark entry
setBookmark | Add or change bookmark entries
setPalette | Change the color of the color constant
sleep | Stops the process for a specified amount of time.
syncObject | Forcibly reflect GUI changes
sysdate | Returns the current system date and time


cachedate function

Explanation

Finds the update date of the data with the latest update date among the cached data acquired from the currently connected server and port and saved. If no cached data exists, 0:00:00 January 1, 1970 is returned, and if no cache is used, the current system date is returned. The date returned by this function is expressed in GMT (Greenwich Mean Time) regardless of the time zone setting.

Call format

var c = cachedate()

Return value

Returns the latest update date of the cached information retrieved from the currently connected server.

argument

None

exception

None

Example of use

var d = cachedate();
//.MessageBox(d);

Related item


debugMessage function

Explanation

Display debug messages in Biz/Designer. Ignored except while debugging on Biz/Designer.

The abbreviation print function is also available.

Call format

debugMessage ( msg_1 [, msg_2 [, msg_3 ...]])

Return value

None

argument

Object msg_n

Specifies the object to display.

The object is converted to a string and displayed.

To start a new line at the end of a line, specify "\n" at the end.

exception

None

Example of use

var d = 100;
var s = "sample";
debugMessage(d, s, "\n");

Related item

print function


deleteCache function

Explanation

Deletes the cache indicated by the URI.

This function is left for compatibility with older versions, but is available. Internally transferred to a call to the Root.DeleteCache method. For new programs, use the Root.DeleteCache method.

Call format

deleteCache([ URI ])

Return value

None

argument

String URI

Specify the URI to delete.

If you omit the URI , delete all caches from the server that downloaded the CRS file that called the deleteCache function.

If * (asterisk) is specified at the end of the URI , all prefix-matching URLs will be deleted. The cache to be deleted is determined by the prefix match in the URL string comparison, so the directory name and file name are not distinguished.

You cannot specify the protocol and host name in the URI , and if you include it, it will be ignored. Therefore, it is not possible to delete the cache generated from a server other than the server that downloaded the CRS file that called the deleteCache function. This is a constraint provided to prevent unintentional deletion of the cache used by another application.

One thing to note about this constraint is the cache control of the image file. Image files loaded by URL into SVG, ImageLabel, etc. are also cached, but if the image file is downloaded from a server different from the application, there is no way to delete the cache of that image file from the script.

exception

None

Example of use

deleteCache("/app1/form1.crs");

Related item

cachedate function

Root.DeleteCache method


decodeURL function

Explanation

Decodes URL-encoded strings.

Call format

var ret = decodeURL ( str )

Return value

Returns the decoded string.

argument

String str

Specify the character string to decode.

exception

None

Example of use

var url = decodeURL("http://server/app1?name=%83%41%83%4e%83%56%83%58&value=Browser%26Designer");
print(url, "\n");

Related item

encodeURL function


encodeURL function

Explanation

URL-encode the string.

Call format

var ret = encodeURL ( str )

Return value

Returns an encoded string.

argument

String str

Specify the character string to encode.

exception

None

Example of use

var name = "Biz Browser & Designer";
var value = "Biz/Browser&Designer";
var url = "http://server/app1?name=" + encodeURL(name) + "&value=" + encodeURL(value);
print(url, "\n");

Related item

decodeURL function


findHttpSession function

Finds and returns the HttpSession object that corresponds to the specified URL .

This function is retained for compatibility with older versions, but is available. It will be transferred internally to the call of the HttpSession.FindSession method. In new programs, use the HttpSession.FindSession method.


getBookmark function

Get the bookmark list.

This function is left for compatibility with older versions, but is available. Internally transferred to a call to the Root.GetBookmark method. For new programs, use the Root.GetBookmark method.


getHttpSession function

Returns the session that downloaded the running CRS as an HttpSession object.

This function is retained for compatibility with older versions, but is available. It will be transferred internally to the call to the HttpSession.GetSession method. In new programs, use the HttpSession.GetSession method.


hasConnectionLicense function

Explanation

Check ifa connection license is registeredfor the connection destination Web server indicated by the URL .

Connection license verification is identified by the URL protocol name (http, https, etc.), host name, and port number string (http://example.com:8080, etc.). There are various notations that represent the same connection destination, such as direct IP address notation and host name alias, but only the notation that matches the Web server information on the connection license certificate is valid.

Call format

var flag = hasConnectionLicense ( URL )

Return value

$TRUE is returned if a connection license to the URL is registered, otherwise $FALSE is returned.

argument

String URL

URL of the connection destination Web server to check

exception

None

Example of use

if(!hasConnectionLicense("http://server")) {
    importConnectionLicense("http://server/License.xml");
}

Related item

importConnectionLicense function


importConnectionLicense function

Explanation

Import the connection license . Download the connection license certificate from the location indicated by the URL and register it in Biz/Browser.

The URL has nothing to do with the destination URL on the connection license certificate. The connection license certificate can be placed on any web server.

If a connection license with the same serial number as the connection license you are importing is already registered, the old one will be overwritten if the issue date is new, and an exception will occur if the issue date is old.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

importConnectionLicense ( URL )

Return value

None

argument

String URL

URL to download the license certificate file

exception

CRS-394

The import URL is invalid

CRS-396

Connection to the designated server is restricted for security protection

CRS-331

Communication error

CRS-398

The license certificate could not be recognized as a legitimate license

CRS-399

A license newer than the specified license certificate has already been registered

Example of use

if(! hasConnectionLicense ("http: // server")) {
    importConnectionLicense ("http://server/License.xml");
}

Related item

hasConnectionLicense function


link function

Follow the hyperlink.

This function is retained for compatibility with older versions, but is available. It is transferred internally to the Runtime.ShellLink method call. In new programs, use the Runtime.ShellLink method.


print function

Explanation

Display debug messages in Biz/Designer. Ignored except while debugging on Biz/Designer.

It has the same function as the debugMessage function.

Call format

print( msg_1 [, msg_2 [, msg_3 ...]])

Return value

None

argument

Object msg_n

Specifies the object to display.

The object is converted to a string and displayed.

To start a new line at the end of a line, specify "\n" at the end.

exception

None

Example of use

var d = 100;
var s = "sample";
print(d, s, "\n");

Related item

debugMessage function


remBookmark function

Delete the bookmark entry.

This function is left for compatibility with older versions, but is available. It is internally transferred to the call to the Root.RemBookmark method. For new programs, use the Root.RemBookmark method.


setBookmark function

Add or change bookmark entries.

This function is left for compatibility with older versions, but is available. Internally transferred to a call to the Root.SetBookmark method. For new programs, use the Root.SetBookmark method.


setPalette function

Explanation

Change the color of the color constant .

Call format

setPalette ( color , R , G , B )

Return value

None

argument

integer color

Specifies the 0-based color number to change. Specify $RED-1 to change the color of $RED. You can specify 0 to 115.

integer R

Specifies the intensity of the new color red, in the range 0-255.

integer G

Specifies the intensity of the new color green, in the range 0-255.

integer B

Specifies the intensity of the new color blue, in the range 0-255.

exception

None

Example of use

setPalette(8, 128, 128, 255);

Related item


sleep function

iOSAndroidWindows

Explanation

Stops the process for the specified time.

Call format

sleep( timeSec );

Return value

None

argument

Number timeSec

Specify the time to stop processing in seconds.

Valid up to the third decimal place. (The accuracy of the actual time to stop depends on the system.)

If a negative value is specified, a FUNC-4 exception will be raised.

exception

FUNC-4

Invalid argument value

Example of use

/* Enter the time in TextBox1 */
var sleeptime = val(Form1.TextBox1.Value);
sleep(sleeptime);

Related item


syncObject function

Explanation

Biz/Browser improves performance by separating the script execution engine and GUI operation threads and executing them asynchronously.

Therefore, the value will be reflected to the GUI asynchronously after the script is executed.

As a negative effect, I cannot write the code that works by confirming that the GUI state is changed during script execution.

Using this function immediately synchronizes the state with the GUI.

By synchronizing the state, you can code in the script while considering the changes in the GUI.

Precautions for use

This function forcibly modifies the normal Biz/Browser behavior sequence. If it is executed continuously in a loop, there may be adverse effects such as poor performance and GUI update failure.

We encourage you to use one point as much as possible.

Call format

syncObject()

Return value

None

argument

None

exception

None

Example of use

Function OnTouch (e) {

    /* Display processing dialog */
    Get("Dialog1.crs");

    /* Synchronize GUI and display dialog */
    syncObject();

    /* Time-consuming process */
    var COUNT = 1000;
    for(var i = 0; i < COUNT; i++) {
        /* Process execution */
    }

    /* Delete dialog */
    Dialog1.Delete();
}

Related item


sysdate function

Explanation

Finds the current system date and time.

Call format

var d = sysdate()

Return value

Returns the current system date and time.

argument

None

exception

None

Example of use

var d = sysdate();
print(d, "\n");

Related item


Package and class

This chapter describes in detail how to use packages and classes in CRS scripts.

package

name | Explanation
System | A native class package included in the CRS language specification
Standard | Standard GUI package
Extension3 | An extended GUI package added in Biz/Browser 3.0
Extension4 | Extended GUI package added in Biz/Browser 4.0
Extension5 | Extended GUI package added in Biz/Browser 5.0
Extension6 | Extended GUI package added in Biz/Browser HT
CSV | A package for handling CSV (comma-separated text) format data
XML | A package for handling XML format data
DB | It is a package for handling a database
HTTP | A package for communicating with a web server
FTP | A package for communicating with an FTP server
Runtime | It is a package that collects classes that perform operations that depend on the execution environment.
Converter | A package of conversion-related classes
Security | A package of security-related classes
JSON | It is a package for handling JSON format data
Speech | It is a package for handling voice control functions.
SmaPri | It is a package to work with SATO printers by using SmaPri Library.
OCR | Package for handling character recognition functions


System package

A package of native classes included in the CRS language specification.

class

API | name | Explanation
4 | Array | Holds a dynamic array
4 | ByteArray | Holds binary data
4 | Date | Hold the date and time
4 | Event | An event that occurs in a CRS program
4 | Exception | Exceptions that occur in CRS programs
6 | Fixed | Holds numbers in fixed-point format
4 | Math | A class that collects mathematical calculation functions
4 | NetObject | CRS file is a base class of executable classes
4 | Number | Hold the number
4 | Object | The base class for all classes
4 | Record | It is a class for collecting multiple objects
6 | RegexMatcher | Is a regular expression engine
6 | RegexPattern | Holds the regular expression pattern
4 | String | Holds the string


Array class

Object
 | Array

A class that holds a dynamic array.

CRS programs can handle arrays in two ways: the Array class and array objects .

The Array class does not require you to specify a specific type for each element, and each element can store values ​​such as objects, numbers, and strings that have different types.

The Array class, unlike array objects, automatically expands the number of elements.

You can access elements with subscripts with "[]", but you can also use letters as subscripts instead of numbers. (Associative array)

Note that the behavior is different between an associative array that uses strings as subscripts and an array that uses numbers. You can sort if the subscript is a number, but you cannot sort it in an associative array.

When referring to each element in a for in statement, the order of the elements is not guaranteed.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


Array property

API version 4

Property

The following properties are defined in the Array class.

API | name | access | Type | Explanation
4 | Length | R | integer | Number of array elements
4 | Value | R | String | String representation of array elements

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Array.Length property

The number of array elements stored in the Array.

This property is read-only and cannot be changed.


Array.Value property

A string that represents the currently stored array element.

Similar to the result of the ToString method.

This property is read-only and cannot be changed.


Array method

API version 4

Method

The following methods are defined in the Array class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Array object
4 | Erase | Deletes the element at the specified position or all elements
4 | Join | Returns each element of the Array as a string separated by the specified delimiter
4 | Reverse | Inverts the order of each element in the Array
4 | Sort | Sort each element of the Array in ascending order
4 | ToString | Returns each element of the Array as a comma separated string

Class overview

Base class methods


Array constructor

Explanation

Initialize the Array object.

If item_n is specified, item_n will be initialized as an array element.

If len is specified,it will be initialized as len empty elements.

Call format

var arr = new Array([ item_1 [, item_2 [,…]]])

var arr = new Array( len )

Return value

Array object

argument

Object item_n

Object to be an array element

Integer len

Number of elements in the array

exception

None

Example of use

var arr1 = new Array("test1", "test2", "test3");
var arr2 = new Array(3);
arr2[0] = "test1";
arr2[1] = "test2";
arr2[2] = "test3";
print(arr1.ToString(), "\n");
print(arr2.ToString(), "\n");

Related item


Array.Erase method

Explanation

Deletes the element at the specified position or all elements.

Call format

arr.Erase([ index ])

Return value

None

argument

index

Specify the index that specifies the element you want to delete.

If index is a number, subsequent elements with the number as a subscript are padded forward.

If index is omitted, all elements will be deleted.

exception

None

Example of use

var arr = new Array("test1", "test2", "test3", "test4");
print(arr, "\n");
arr.Erase(2);
print(arr, "\n");
arr.Erase();
print(arr.Length, "\n");

Related item


Array.Join method

Explanation

Returns each element of the Array as a string separated by separators .

Call format

var data = arr.join( separater )

Return value

Returns a string that combines the elements of an Array.

argument

String seperater

Separator character that joins elements

exception

None

Example of use

var arr = new Array;
arr[0] = "test1";
arr[1] = "test2";
arr[2] = "test3";
print(arr.Join("-"), "\n");

Related item


Array.Reverse method

Explanation

Inverts the order of each element in the Array.

Call format

arr.Reverse()

Return value

None

argument

None

exception

None

Example of use

var arr = new Array;
arr[0] = "test1";
arr[1] = "test2";
arr[2] = "test3";
print(arr.ToString(), "\n");
arr.Reverse();
print(arr.ToString(), "\n");

Related item


Array.Sort method

Explanation

Sorts each element of the Array in ascending order.

Call format

arr.Sort()

Return value

None

argument

None

exception

None

Example of use

var arr = new Array;
arr[0] = "test2";
arr[1] = "test3";
arr[2] = "test1";
print(arr.ToString(), "\n");
arr.Sort();
print(arr.ToString(), "\n");

Related item


Array.ToString method

Explanation

Returns each element of the Array as a comma separated string.

Call format

var data = arr.ToString()

Return value

Returns a string that combines each element of the Array as a string.

argument

None

exception

None

Example of use

var arr = new Array;
arr[0] = "test1";
arr[1] = "test2";
arr[2] = "test3";
print(arr.ToString(), "\n");

Related item


Array event

API version 4

Event

There are no events defined in the Array class.

Class overview

Base class event


Array operator

API version 4

operator

The following operators are defined in the Array class.

API | operator | Explanation
4 | Array[] | Extract elements in array format

Class overview


Array[] operator

Explanation

An operator that accesses the elements of Array in array format.

Call format

var obj = arr[ indx ]

Return value

Returns a reference to the element specified by indx . If no corresponding element is found for indx , a reference pointing to NULL is returned and the number of elements is expanded.

argument

indx

Subscript that specifies the element position of a number or string

If you specify a number for indx, it indicates the same element as the string with the same value. For example, arr[10] and arr["10"] have the same meaning.

When you specify a number for indx , you can specify a value between 0 and 2147483646.

exception

None

Example of use

var arr = new Array("test1", "test2", "test3", "test4");
print(arr[2], "\n");
arr["aa"] = "aaaa";
print(arr["aa"], "\n");

Related item


ByteArray class

Object
 | NetObject
 |  | ByteArray

A class that holds a set of binary data.

It is used when loading binary data from the File class, HttpResponse class, etc. with the ReadBinary method.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


ByteArray property

API version 4

Property

The following properties are defined in the ByteArray class.

API | name | access | Type | Explanation
4 | Length | R | integer | Number of array elements (data size)
4 | Value | CRW | ByteArray | Binary data

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


ByteArray.Length property

The number of array elements stored in ByteArray. Corresponds to the data size of binary data.

This property is read-only and cannot be changed.


ByteArray.Value property

Binary data stored in a ByteArray object.

Since ByteArray cannot be converted to any other type, referencing a Value value can result in a type conversion exception.


ByteArray method

API version 4

Method

The following methods are defined in the ByteArray class.

API | name | Explanation
4 | ( Constructor ) | Initialize the ByteArray object
4 | ByteAt | Returns the byte value at the specified position as an integer value
20 | GetInteger | Extracts a ByteArray in bytes or bits and return it as an integer value
20 | GetIntegerAsString | Extracts a ByteArray in bytes or bits, and returns the integer value as a string expressed in decimal
19 | ToHexString | Returns a string representing the value in hexadecimal.
4 | ToString | Convert to a string

Class overview

Base class methods


ByteArray constructor

Explanation

Initializes the ByteArray object.

If no argument is specified, it will be initialized empty.

You can specify multiple values ​​for the argument, and the specified values ​​are combined and initialized.

Call format

var barr = new ByteArray([ data_1 [, data_2 , [, ... [, data_n ]]]])

Return value

ByteArray object

argument

data_n

Specify the data to be set as the initial value.

You can specify strings, ByteArray objects, and binary data. Otherwise it will be converted to a string.

If you pass a positive integer as an argument, it will be stored as binary data as it is. This makes it possible to create non-character data strings such as control codes.

Numerical values ​​are stored in little endian as 1 byte from 0 to 255, 2 bytes from 256 to 65535, and 4 bytes from 65536 to 4294967295 (hexadecimal FFFFFFFF).

Numerical values ​​outside the above range and numerical values ​​including decimal numbers are stored as character strings.

exception

None

Example of use

var b1 = new ByteArray(file.Read());
var b2 = new ByteArray("sample", "test");
var b3 = new ByteArray(response.Read());

Related item


ByteArray.ByteAt method

Explanation

Returns the byte value at the specified position of the value stored in the ByteArray object as an integer value.

Call format

var b = barr.ByteAt( index )

Return value

Byte value

argument

integer index

Position to get the byte value

exception

None

Example of use

var barr = new ByteArray("test");
print(barr.ByteAt(0), "\n");

Related item


ByteArray.GetInteger method

iOSAndroidWindows

Explanation

Extracts a ByteArray in bytes or bits and return it as an integer value.

Integer values handled by Biz/Browser HT are signed 32 bits. If the extracted data exceeds 32 bits, it will be truncated.

Call format

var intVal = barr.GetInteger( pos , size [, options] )

Return value

Returns the value of data extracted from a byte string and converted to an integer.

argument

integer pos

Start position of the data cutout, starting from 0

The unit is specified by options.

If you specify a range that exceeds the data, FUNC-4 exception will occur.

integer size

Size of the data to be extracted

The unit is specified by options.

If you specify a range that exceeds the data, FUNC-4 exception will occur.

integer options

Specify options for extracting the data.

A combination of the following values can be specified:

Constant | Value | Explanation
ByteArray.BIG_ENDIAN | 0x0001 | Interprets the cut-out byte sequence as big-endian. This is the default when no options are specified.
ByteArray.LITTLE_ENDIAN | 0x0002 | Interprets the cut-out byte sequence as little-endian.
ByteArray.UNIT_BYTE | 0x0010 | Treats pos and size as byte units. This is the default when no options are specified.
ByteArray.UNIT_BIT | 0x0020 | Treats pos and size as bit units.
ByteArray.UNSIGNED | 0x0100 | Treats integer values as unsigned integers. This is the default when no options are specified.
ByteArray.SIGNED | 0x0200 | Treats integer values as signed integers.

exception

FUNC-4

Wrong argument value

Example of use

var barr = new ByteArray(0x41, 0x42, 0x43, 0x44, 0x45, 0x46);
var options = ByteArray.UNIT_BYTE + ByteArray.BIG_ENDIAN;
print(str(barr.GetInteger(1, 3, options)), "\n");

Related item

GetIntegerAsStringメソッド


ByteArray.GetIntegerAsString method

iOSAndroidWindows

Explanation

Extracts a ByteArray in bytes or bits, and returns the integer value as a string expressed in decimal.

Unlike the GetInteger method, there is no limit on the number of digits.

Call format

var intStr = barr.GetIntegerAsString( pos , size [, options] )

Return value

A string of data extract from a byte string, converted to an integer, and expressed as a decimal number

argument

integer pos

Start position of the data cutout, starting from 0

The unit is specified by options.

If you specify a range that exceeds the data, FUNC-4 exception will occur.

integer size

Size of the data to be extracted

The unit is specified by options.

If you specify a range that exceeds the data, FUNC-4 exception will occur.

integer options

Specify options for extracting the data.

A combination of the following values can be specified:

Constant | Value | Explanation
ByteArray.BIG_ENDIAN | 0x0001 | Interprets the cut-out byte sequence as big-endian. This is the default when no options are specified.
ByteArray.LITTLE_ENDIAN | 0x0002 | Interprets the cut-out byte sequence as little-endian.
ByteArray.UNIT_BYTE | 0x0010 | Treats pos and size as byte units. This is the default when no options are specified.
ByteArray.UNIT_BIT | 0x0020 | Treats pos and size as bit units.
ByteArray.UNSIGNED | 0x0100 | Treats integer values as unsigned integers. This is the default when no options are specified.
ByteArray.SIGNED | 0x0200 | Treats integer values as signed integers.

exception

FUNC-4

Wrong argument value

Example of use

var barr = new ByteArray(0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C);
var options = ByteArray.UNIT_BYTE + ByteArray.BIG_ENDIAN;
print(barr.GetIntegerAsString(1, 10, options), "\n");

Related item

GetIntegerメソッド


ByteArray.ToHexString method

iOSAndroidWindows

Explanation

Converts the data stored in a ByteArray object to hexadecimal and returns it as a string.

Call format

var str = barr.ToHexString()

Return value

String with the value converted to hexadecimal

argument

None

exception

None

Example of use

var barr = new ByteArray(0x41, 0x42, 0x43);
print(barr.ToHexString(), "\n");

Related item


ByteArray.ToString method

Explanation

Returns the data stored in the ByteArray object as a string. If a null character appears in the data, the data after that will be ignored.

Call format

var str = barr.ToString()

Return value

Converted string

argument

None

exception

None

Example of use

var barr = new ByteArray(0x41, 0x42, 0x43);
print(barr.ToString(), "\n");

Related item


ByteArray event

API version 4

Event

There are no events defined in the ByteArray class.

Class overview

Base class event


Date class

Object
 | NetObject
 |  | Date

A class that holds dates and times.

The date is represented by a real number with 1900/1/1 as 1.0, the daily interval is 1.0, and 1 second is 1 / 86,400. The disassembly accuracy is 1 second.

The valid range of the Date class is from January 1, 1900 to December 31, 2099. If you specify a number that exceeds the range, the date will be indefinite.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


Date property

API version 4

Property

The following properties are defined in the Date class.

API | name | access | Type | Explanation
4 | Value | CRW | Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Date.Value property

The value of the Date object.


Date method

API version 4

Method

The following methods are defined in the Date class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Date object
4 | GetTime | Returns the stored time
4 | GetFullYear | Returns the year of the date in local time
4 | GetMonth | Returns the month part of a date in local time
4 | GetDate | Returns the day part of a date in local time
4 | GetDay | Returns the day of the week for a date in local time
4 | GetHours | Returns the hour part of local time
4 | GetMinutes | Returns the minutes portion of local time
4 | GetSeconds | Returns the second part of local time
4 | GetMilliSeconds | Returns the millisecond portion of local time
4 | GetUTCFullYear | Returns the year of a UTC date
4 | GetUTCMonth | Returns the month of UTC date
4 | GetUTCDate | Returns the day part of a UTC date
4 | GetUTCDay | Returns the day of the week as UTC date
4 | GetUTCHours | Returns the hour part of UTC
4 | GetUTCMinutes | Returns the minutes part of UTC
4 | GetUTCSeconds | Returns the second part of UTC
4 | GetUTCMilliSeconds | Returns the millisecond value in UTC
4 | GetTimezoneOffset | Returns the time zone offset in minutes
4 | SetTime | Set date and time directly
4 | SetFullYear | Set the year part in local time
4 | SetMonth | Set the month part in local time in local time
4 | SetDate | Set the day part in local time
4 | SetHours | Set the hour part in local time in local time
4 | SetMinutes | Set the minute part in local time in local time
4 | SetSeconds | Set the seconds part in local time in local time
4 | SetMilliSeconds | Set the millisecond part in local time
4 | SetUTCFullYear | Set the year part in UTC
4 | SetUTCMonth | Set the month part in UTC
4 | SetUTCDate | Set the day part in UTC
4 | SetUTCHours | Set the hour part in UTC
4 | SetUTCMinutes | Set the minute part in UTC
4 | SetUTCSeconds | Set the seconds part in UTC
4 | SetUTCMillSeconds | Sets the millisecond part in UTC
4 | ToDateString | Returns the date as a string
4 | ToInternetString | Returns the date as a string in RFC822 format
4 | ToLocaleDateString | Returns the date as a locale-formatted string
4 | ToLocaleString | Returns the date and time as a locale-formatted string
4 | ToLocaleTimeString | Returns the time as a string in locale format
4 | ToString | Returns the date and time as a string
4 | ToTimeString | Returns the time as a string
4 | ToUTCString | Returns the date as a UTC string
4 | ValueOf | Returns the number of milliseconds since the UTC time

Static method

API | name | Explanation
4 | Parse | Parses the date string
4 | UTC | Returns the number of milliseconds between 0:00:00, January 1, 1970, UTC, and the specified date.

Class overview

Base class methods


Date constructor

Explanation

Initializes the Date object.

If no arguments are taken, it will be initialized with the current date and time.

When one argument is specified, if the argument is a character string representing the date / time, the same interpretation as the parse method is performed, otherwise the date and time are initialized as milliseconds representing the elapsed time from UTC reference time. I will.

See Parse method for string format .

If two or more arguments are specified, up to seven will be initialized as year, month, day, hour, minute, second, and millisecond (actually invalid).

All omitted arguments will be 0.

Creating a Date object without a constructor call will generate a Date object with an invalid date and time without being initialized.

Call format

var d = new Date()

var d = new Date( value )

var d = new Date( year , month , date [, hours [, minute [, sec [, ms ]]]])

Return value

Date object

argument

Object value

An object that represents a date string or elapsed time

integer year

Specify the year numerically.

integer month

Specify the month number with January as 0

integer date

Specify the day numerically

integer hours

Specify the hour numerically

integer minute

Specify the minute numerically

integer sec

Specify the seconds as a number

integer ms

Ignored

exception

None

Example of use

var d1 = new Date();
var d2 = new Date(1964, 8, 10);
var d3 = new Date("2002/01/02 12:34:56");
var d4 = new Date(1022889600000);

Related item

Parse method


Date.GetTime method

Explanation

Returns a number in milliseconds that represents the elapsed time from 00:00 on January 1, 1970, UTC (Coordinated Universal Time). Since the time decomposition system of the Date class is in units of 1 second, milliseconds are always 0.

Call format

var v = d.GetTime()

Return value

Numerical value indicating elapsed time

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetTime(), "\n");

Related item


Date.GetFullYear method

Explanation

Returns the year of the date in local time.

Call format

var v = d.GetFullYear()

Return value

Numerical year number

argument

None

exception

None

Example of use

var d = new Date();
print(d.getFullYear(), "\n");

Related item


Date.GetMonth method

Explanation

Returns the month part of a date in local time with a month number with January as 0.

Call format

var v = d.GetMonth()

Return value

Numerical value indicating the month number

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetMonth(), "\n");

Related item


Date.GetDate method

Explanation

Returns the day part of a date in local time.

Call format

var v = d.GetDate()

Return value

Numerical value indicating the day

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetDate(), "\n");

Related item


Date.GetDay method

Explanation

Returns the day of the week for a date in local time.

Call format

var v = d.GetDay()

Return value

Numerical value indicating the day of the week

0 is Sunday, 1 is Monday ... 6 is Saturday.

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetDay(), "\n");

Related item


Date.GetHours method

Explanation

Returns the time part of local time.

Call format

var v = d.GetHours()

Return value

Numerical value indicating time

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetHours(), "\n");

Related item


Date.GetMinutes method

Explanation

Returns the portion of local time.

Call format

var v = d.GetMinutes()

Return value

Numerical value indicating minutes

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetMinutes(), "\n");

Related item


Date.GetSeconds method

Explanation

Returns the second portion of local time.

Call format

var v = d.GetSeconds()

Return value

Numerical value indicating seconds

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetSeconds(), "\n");

Related item


Date.GetMilliSeconds method

Explanation

Returns the millisecond portion of local time. Although defined for compatibility with JavaScript, the Date class has a decomposition precision of 1 second, so it always returns 0.

Call format

var v = d.GetMilliSeconds()

Return value

Numerical value indicating milliseconds

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetMilliSeconds(), "\n");

Related item


Date.GetUTCFullYear method

Explanation

Returns the year of the date in UTC time.

Call format

var v = d.GetUTCFullYear()

Return value

Numerical year number

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCFullYear(), "\n");

Related item


Date.GetUTCMonth method

Explanation

Returns the month part of a date in UTC time with a month number with January as 0.

Call format

var v = d.GetUTCMonth()

Return value

Numerical value indicating the month number

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCMonth(), "\n");

Related item


Date.GetUTCDate method

Explanation

Returns the day part of a date in UTC time.

Call format

var v = d.GetUTCDate()

Return value

Numerical value indicating the day

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCDate(), "\n");

Related item


Date.GetUTCDay method

Explanation

Returns the day of the week for a date in UTC time.

Call format

var v = d.GetUTCDay()

Return value

Numerical value indicating the day of the week

0 is Sunday, 1 is Monday ... 6 is Saturday.

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCDay(), "\n");

Related item


Date.GetUTCHours method

Explanation

Returns the portion in UTC time.

Call format

var v = d.GetUTCHours()

Return value

Numerical value indicating time

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCHours(), "\n");

Related item


Date.GetUTCMinutes method

Explanation

Returns the portion of UTC time.

Call format

var v = d.GetUTCMinutes()

Return value

Numerical value indicating minutes

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCMinutes(), "\n");

Related item


Date.GetUTCSeconds method

Explanation

Returns the second part of UTC time.

Call format

var v = d.GetUTCSeconds()

Return value

Numerical value indicating seconds

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCSeconds(), "\n");

Related item


Date.GetUTCMilliSeconds method

Explanation

Returns the millisecond portion of UTC time. Although defined for compatibility with JavaScript, the Date class has a decomposition precision of 1 second, so it always returns 0.

Call format

var v = d.GetUTCMilliSeconds()

Return value

Numerical value indicating milliseconds

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetUTCMilliSeconds(), "\n");

Related item


Date.GetTimezoneOffset method

Explanation

Returns the time zone offset in minutes.

Call format

var v = d.GetTimezoneOffset()

Return value

Numerical value indicating the amount of difference

argument

None

exception

None

Example of use

var d = new Date();
print(d.GetTimezoneOffset(), "\n");

Related item


Date.SetTime method

Explanation

Set the date and time directly.

Call format

d.SetTime ( value )

Return value

None

argument

integer value

Specifies a number in milliseconds that represents the elapsed time from 00:00 on January 1, 1970 in UTC.

exception

None

Example of use

var d = new Date();
d.SetTime (1015083255000);
print(d, "\n");

Related item


Date.SetFullYear method

Explanation

Set the year part in local time.

The omitted parameter items are not changed.

Call format

d.SetFullYear ( value [, mon [, date ]])

Return value

None

argument

integer value

Specify the year numerically.

integer mon

Specify the month as a month number with January as 0.

integer date

Specify the day numerically.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetFullYear(2000);
print(d, "\n");

Related item


Date.SetMonth method

Explanation

Set the month part in local time.

The omitted parameter items are not changed.

Call format

d.SetMonth( value [, date ])

Return value

None

argument

integer value

Specify the month as a month number with January as 0.

integer date

Specify the day numerically.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetMonth(10);
print(d, "\n");

Related item


Date.SetDate method

Explanation

Set the day part in local time.

Call format

d.SetDate( value )

Return value

None

argument

integer value

Specify the day numerically.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetDate(10);
print(d, "\n");

Related item


Date.SetHours method

Explanation

Set the hour part in local time.

The omitted parameter items are not changed.

Call format

d.SetHours ( value [, min [, sec [, ms ]]])

Return value

None

argument

integer value

Specify the hour as a 24-hour number.

integer min

Specify the minute numerically.

integer sec

Specify the seconds as a number.

integer ms

Specify milliseconds. The resolution accuracy of the Date class is 1 second, so even if you specify ms , it does not affect the result.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.setHours(13);
print(d, "\n");

Related item


Date.SetMinutes method

Explanation

Set the minute part in local time.

The omitted parameter items are not changed.

Call format

d.SetMinutes ( value [, sec [, ms ]])

Return value

None

argument

integer value

Specify the minute numerically.

integer sec

Specify the seconds as a number.

integer ms

Specify milliseconds. The resolution accuracy of the Date class is 1 second, so even if you specify ms , it does not affect the result.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetMinutes(0);
print(d, "\n");

Related item


Date.SetSeconds method

Explanation

Set the seconds part in local time.

The omitted parameter items are not changed.

Call format

d.SetSeconds ( value [, ms ])

Return value

None

argument

integer value

Specify the seconds as a number.

integer ms

Specify milliseconds. The resolution accuracy of the Date class is 1 second, so even if you specify ms , it does not affect the result.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetSeconds(0);
print(d, "\n");

Related item


Date.SetMilliSeconds method

Explanation

Sets the millisecond portion in local time. Although it is defined for compatibility with JavaScript, the decomposition precision of the Date class is 1 second, so the value does not change when this method is executed.

Call format

d.SetMilliSeconds ( value )

Return value

None

argument

integer value

Specify the number of milliseconds.

exception

None

Example of use

var d = new Date();
d.SetMilliSeconds (0);
print(d, "\n");

Related item


Date.SetUTCFullYear method

Explanation

Set the year part in UTC time.

The omitted parameter items are not changed.

Call format

d.SetUTCFullYear ( value [, mon [, date ]])

Return value

None

argument

integer value

Specify the year numerically.

integer mon

Specify the month as a month number with January as 0.

integer date

Specify the day numerically.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetUTCFullYear(2000);
print(d, "\n");

Related item


Date.SetUTCMonth method

Explanation

Set the month part in UTC time.

The omitted parameter items are not changed.

Call format

d.SetUTCMonth( value [, date ])

Return value

None

argument

integer value

Specify the month as a month number with January as 0.

integer date

Specify the day numerically.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetUTCMonth(10);
print(d, "\n");

Related item


Date.SetUTCDate method

Explanation

Set the day part in UTC time.

Call format

d.SetUTCDate( value )

Return value

None

argument

integer value

Specify the day numerically.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetUTCDate(10);
print(d, "\n");

Related item


Date.SetUTCHours method

Explanation

Set the hour part in UTC time.

The omitted parameter items are not changed.

Call format

d.SetUTCHours ( value [, min [, sec [, ms ]]])

Return value

None

argument

integer value

Specify the hour as a 24-hour number.

integer min

Specify the minute numerically.

integer sec

Specify the seconds as a number.

integer ms

Specify milliseconds. The resolution accuracy of the Date class is 1 second, so even if you specify ms , it does not affect the result.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetUTCHours(13);
print(d, "\n");

Related item


Date.SetUTCMinutes method

Explanation

Set the minute part in UTC time.

The omitted parameter items are not changed.

Call format

d.SetUTCMinutes ( value [, sec [, ms ]])

Return value

None

argument

integer value

Specify the minute numerically.

integer sec

Specify the seconds as a number.

integer ms

Specify milliseconds. The resolution accuracy of the Date class is 1 second, so even if you specify ms , it does not affect the result.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetUTCMinutes(0);
print(d, "\n");

Related item


Date.SetUTCSeconds method

Explanation

Set the seconds part in UTC time.

The omitted parameter items are not changed.

Call format

d.SetUTCSeconds ( value [, ms ])

Return value

None

argument

integer value

Specify the seconds as a number.

integer ms

Specify milliseconds. The resolution accuracy of the Date class is 1 second, so even if you specify ms , it does not affect the result.

exception

None

Example of use

var d = new Date();
print(d, "\n");
d.SetUTCSeconds(0);
print(d, "\n");

Related item


Date.SetUTCMilliSeconds method

Explanation

Set the millisecond portion in UTC time. Although it is defined for compatibility with JavaScript, the decomposition precision of the Date class is 1 second, so the value does not change when this method is executed.

Call format

d.SetUTCMilliSeconds ( value )

Return value

None

argument

integer value

Specify the number of milliseconds.

exception

None

Example of use

var d = new Date();
d.SetUTCMilliSeconds (0);
print(d, "\n");

Related item


Date.ToDateString method

Explanation

Returns the date as a string. The time part is truncated.

Call format

var text = d.ToDateString()

Return value

A string representing a date

argument

None

exception

None

Example of use

var d = new Date();
print(d.ToDateString(), "\n");

Related item


Date.ToInternetString method

Explanation

Returns the date and time as a string in RFC822 format.

Call format

d.ToInternetString ()

Return value

Returns a date string

argument

None

exception

None

Example of use

var d = new Date();
print(d.toInternetString(), "\n");

Related item


Date.ToLocaleDateString method

Explanation

Returns the date as a string in locale format. The time part is not included.

Currently, only Japanese-specific formats are supported.

Call format

var text = d.ToLocaleDateString()

Return value

Locale-formatted date string

argument

None

exception

None

Example of use

var d = new Date();
print(d.ToLocaleDateString(), "\n");

Related item


Date.ToLocaleString method

Explanation

Returns the date and time as a string in locale format.

Currently, only Japanese-specific formats are supported.

Call format

var text = d.ToLocalString()

Return value

Locale-formatted date and time string

argument

None

exception

None

Example of use

var d = new Date();
print(d.ToLocaleString(), "\n");

Related item


Date.ToLocaleTimeString method

Explanation

Returns the time as a string in locale format. The date part is not included.

Currently, only Japanese-specific formats are supported.

Call format

var text = d.ToLocaleTimeString()

Return value

Locale-formatted time string

argument

None

exception

None

Example of use

var d = new Date();
print(d.ToLocaleTimeString(), "\n");

Related item


Date.ToString method

Explanation

Returns the date and time as a string.

Call format

var text = d.ToString()

Return value

A string representing the date and time

argument

None

exception

None

Example of use

var d = new Date();
print(d.ToString(), "\n");

Related item


Date.ToTimeString method

Explanation

Returns the time as a string. The date part is not included.

Call format

var text = d.ToTimeString()

Return value

A string representing the time

argument

None

exception

None

Example of use

var d = new Date();
print(d.ToTimeString(), "\n");

Related item


Date.ToUTCString method

Explanation

Returns the date and time as a string of UTC time.

Call format

var text = d.ToUTCString()

Return value

A string representing the date and time

argument

None

exception

None

Example of use

var d = new Date();
print(d.ToUTCString(), "\n");

Related item


Date.ValueOf method

Explanation

Returns a number in milliseconds that represents the elapsed time from 00:00 on January 1, 1970, UTC (Coordinated Universal Time). Since the time decomposition system of the Date class is in units of 1 second, milliseconds are always 0.

Call format

var v = d.ValueOf()

Return value

Numerical value indicating elapsed time

argument

None

exception

None

Example of use

var d = new Date();
print(d.ValueOf(), "\n");

Related item


Date.Parse method

Explanation

Parses the date string.

This method is a static method. You can call it without creating an object.

Call format

var v = Date.Parse( value )

Return value

Returns the elapsed time in milliseconds since the UTC reference time, which represents the analyzed date and time.

argument

String value

Specify a character string that indicates the date and time.

The formats that can be parsed are as follows.

"YY / MM / DD"

"YY / MM / DD HH24: MI"

"YY / MM / DD HH24: MI: SS"

"YYYY / MM / DD"

"YYYY / MM / DD HH24: MI"

"YYYY / MM / DD HH24: MI: SS"

"dy, DD mon YYYY HH24: MI: SS TZ"

exception

None

Example of use

var d = new Date();
d.SetTime(Date.Parse("2002/2/28 20:00:00"));
print(d, "\n");

Related item


Date.UTC method

Explanation

Returns the elapsed time from the UTC reference time for the specified date in milliseconds.

This method is a static method. You can call it without creating an object.

Call format

var v = Date.UTC ( year , month , date [, hour [, min [, sec [, ms ]]]])

Return value

Returns the elapsed time in milliseconds since the UTC reference time.

argument

integer year

Specify the year in UTC time

integer month

Specify the month number with January as 0

integer date

Specify the day in UTC time

integer hour

Specify the time in UTC time

integer min

Specify the minutes in UTC time

integer sec

Specify seconds in UTC time

integer ms

Ignored

exception

None

Example of use

var d = new Date();
d.SetTime (Date.UTC (2002, 2, 28, 20, 0, 0));
print(d, "\n");

Related item


Date event

API version 4

Event

There are no events defined in the Date class.

Class overview

Base class event


Event class

Object
 | Event

This class represents an event that occurs in a CRS program, such as pressing a button.

It is also used when the PostEvent method raises an event from a CRS script.

Default properties and ValueType

The default property is Reason . The value type specification is invalid.


Event property

API version 4

Property

The following properties are defined in the Event class.

API | name | access | Type | Explanation
4 | EventName | CR | String | Event name
4 | From | R | reference | Source of the event
4 | Reason | CR | integer | Event type

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Event.EventName property

The name of the Event. Event handlers that are invoked are sorted by this name.


Event.From property

A reference that points to the source object of the Event. It is also set automatically when you throw an Event object with PostEvent.

This property is read-only and cannot be changed.


Event.Reason property

The type of event.

The type of event has its meaning determined by the type of object that triggered the event. Even if the value is the same, the meaning may be different if the type of the source object is different.

This property is read-only and cannot be changed.


Event method

API version 4

Method

The following methods are defined in the Event class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Event object

Class overview

Base class methods


Event constructor

Explanation

Initialize the Event object.

If you specify a reason , it initializes the Reason property.

If you specify eventName , it initializes the EventName property.

Call format

var ev = new Event([ reason [, eventName ]])

Or

var ev = new Event( eventName )

Return value

Event object

argument

integer reason

Specify the event type numerically. For user-specific events, specify a value greater than UserEvent.

String eventName

Specify the name of the event.

exception

None

Example of use

Function OnSampleEvent(e) {
    print("Event.Reason =", e.Reason, "\n");
    print("Event.EventName =", e.EventName, "\n");
    print("Event.From.Name =", e.From.Name, "\n");
}
PostEvent(new Event(UserEvent + 1, "SampleEvent"));

Related item

User-defined event


Event event

API version 4

Event

There are no events defined in the Event class.

Class overview

Base class event


Exception class

Object
 | Exception

A class that represents an exception that occurs in a CRS program.

Exceptions can be received as Exception objects with the try… catch… statement. It is also used when the throw statement raises a user-defined exception.

Default properties and ValueType

The default property is Message . The value type specification is invalid.


Exception property

API version 4

Property

The following properties are defined in the Exception class.

API | name | access | Type | Explanation
4 | Code | R | integer | Exception number
4 | Message | R | String | Exception description
4 | Method | R | String | The function that caused the exception
4 | SourceOffset | R | integer | Byte position of the CRS script that raised the exception
4 | SourceURL | R | String | URL of the CRS script that raised the exception

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Exception.Code property

A number that indicates the type of exception. Exceptions can be uniquely identified by the Method and Code properties.

This property is read-only and cannot be changed.


Exception.Message property

A descriptive text that indicates the content of the exception.

This property is read-only and cannot be changed.


Exception.Method property

iOSAndroidWindows

The identifier of the function that caused the exception. Exceptions can be uniquely identified by the Method and Code properties.

This property is read-only and cannot be changed.


Exception.SourceOffset property

The execution position of the CRS script that caused the exception is indicated by the byte position from the beginning.

This property is read-only and cannot be changed. It is set automatically when passed to the throw statement.

* Effective only when debugging from Biz/Designer to prevent performance degradation during execution.


Exception.SourceURL property

The URL where you downloaded the CRS script that caused the exception.

This property is read-only and cannot be changed. It is set automatically when passed to the throw statement.


Exception method

API version 4

Method

The following methods are defined in the Exception class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Exception object

Class overview

Base class methods


Exception constructor

Explanation

Initialize the Exception object.

Call format

var ex = new Exception ( method , code , message )

Return value

Exception object

argument

String method

Specifies the value of the Method property.

integer code

Specifies the value of the Code property.

String message

Specifies the value of the Message property.

exception

None

Example of use

if(data == 0) {
    throw new Exception ("APP1", 1, "data is 0");
}

Related item


Exception event

API version 4

Event

There are no events defined in the Exception class.

Class overview

Base class event


Fixed class

Object
 | NetObject
 |  | Fixed

This class holds the fixed-point number.

The Fixed class is stored in 64-bit signed integer format with a value scaled by 10000. Internally 1 is represented as 10000 and 0.1 as 1000.

Unlike the Number class, which retains internal data in floating-point format, errors due to the characteristics of floating-point do not occur in principle, but the representable range is limited to 15 digits for the integer part and 4 digits for the decimal part. .. When the operation result exceeds the expression range, the integer part is truncated from the largest digit position, and the decimal part is truncated from the 5th place or lower.

When the Fixed class is passed to the method or function that receives a numeric value or the operation between the Fixed class and other types of classes, the calculation is executed according to the result automatically converted to the Number type. Therefore, in such a case, it behaves as a floating point value.

Default property and ValueType

The default property is Value . The ValueType specification is invalid.


Fixed Property

API version 6

Property

The following properties are defined in the Fixed class.

API | name | access | Type | initial value | Explanation
6 | Value | CRW | Fixed | 0 | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Fixed.Value property

The value of the Fixed object.


Fixed method

API version 6

Method

The following methods are defined in the Fixed class.

API | name | Explanation
6 | ( Constructor ) | Initializes the Fixed object
6 | ToString | Returns a string

Static method

API | name | Explanation
6 | Round | Rounds as a Fixed object
6 | RoundDown | Truncate as a Fixed object
6 | RoundUp | Rounds up as a Fixed object

Class overview

Base class methods


Fixed Constructor

Explanation

Initializes the Fixed object.

Call format

var f = new Fixed([ value ])

Return value

Fixed object

argument

Number value

Format to specify the value to be initialized with Number

String value

Format to specify the value to be initialized with a character string

Fixed value

Format to specify the value to be initialized with Fixed

exception

None

Example of use

var f = new Fixed(5678);
print(f, "\n");

Related item


Fixed.ToString method

Explanation

Returns the value stored in the Fixed object as a string.

Call format

var text = f.ToString()

Return value

Converted character string

argument

None

exception

None

Example of use

var f = new Fixed("1234567890.1234");
print(f.ToString(), "\n");

Related item


Fixed.Round method

Explanation

Returns the specified parameters, rounded as a Fixed object.

This method is a static method. Can be called without creating an object.

Rounding of Fixed.Round method ( when the number of digits = 0) is

Maximum value (positive direction) of integers less than value + 0.5

Will be.

Call format

var f = Fixed.Round( n [, d ])

Return value

Rounded value (Fixed object)

argument

n

Specify the number you want to round off with Fixed type, Number type, or String type.

integer d

Specify the digit you want to round off.

-14 to 3 can be specified. A value of 0 rounds down the decimal point, and a value of 3 rounds down to the third decimal place. If it is a negative number, it is an integer value direction. If omitted, it is 0.

exception

None

Example of use

print(Fixed.Round(12345.678F, -2)); /* becomes 12300 */
print(Fixed.Round(12345.678F));      /* becomes 12346 */
print(Fixed.Round(12345.678F, 2) );   /* 12345.68 become */

print(Fixed.Round(0.49F));   /* becomes 0 */
print(Fixed.Round(0.50F));   /* becomes 1 */
print(Fixed.Round(0.51F));   /* 1 to become */
print(Fixed.Round(-0.49F)); /* 0 to become */
print(Fixed.Round(-0.50F)); /* 0 to become */
print(Fixed.Round(-0.51 F)); /* becomes -1 */

Related item


Fixed.RoundDown method

Explanation

Returns the specified parameter truncated as a Fixed object.

This method is a static method. Can be called without creating an object.

Fixed.RoundDown method truncation (when the number of digits = 0),

Nearest integer in the direction of decreasing absolute value (close to 0)

Will be.

Call format

var f = Fixed.RoundDown( n [, d ])

Return value

Truncated value (Fixed object)

argument

n

Specify the number to be truncated in Fixed type, Number type, and String type.

integer d

Specify the digit to be truncated.

-14 to 3 can be specified. A value of 0 rounds down the decimal point, and a value of 3 rounds down the decimal point . If it is a negative number, it is an integer value direction. If omitted, it is 0.

exception

None

Example of use

print(Fixed.RoundDown(12345.678F, -2)); /* becomes 12300 */
print(Fixed.RoundDown(12345.678F));      /* becomes 12345 */
print(Fixed.RoundDown(12345.678F, 2) );   /* 12345.67 become */

print(Fixed.RoundDown(0.50F));   /* 0 to become */
print(Fixed.RoundDown(-0.50F)); /* 0 to become */

Related item


Fixed.RoundUp method

Explanation

Returns the specified parameter rounded up as a Fixed object.

This method is a static method. Can be called without creating an object.

Rounding up of Fixed.RoundUp method (when the number of digits = 0) is

Nearest integer in the direction of increasing absolute value (far from 0)

Will be.

Call format

var f = Fixed.RoundUp( n [, d ])

Return value

Rounded up value (Fixed object)

argument

n

Specify the number you want to round up in Fixed type, Number type, or String type.

integer d

Specify the digit you want to round up.

-14 to 3 can be specified. 0 rounds up to the right of the decimal point, 3 rounds up to the second decimal place. If it is a negative number, it is an integer value direction. If omitted, it is 0.

exception

None

Example of use

print(Fixed.RoundUp(12345.678F, -2)); /* becomes 12400 */
print(Fixed.RoundUp(12345.678F));      /* becomes 12346 */
print(Fixed.RoundUp(12345.678F, 2) );   /* 12345.68 become */

print(Fixed.RoundUp(0.50F));   /* becomes 1 */
print(Fixed.RoundUp(-0.50F)); /* becomes -1 */

Related item


Fixed event

API version 6

Event

There are no events defined in the Fixed class.

Class overview

Base class events


Math class

Object
 | Math

This class is a collection of mathematical calculation functions.

This class defines only static properties and static methods. You don't need to create an instance.


Math property

API version 4

Property

The following properties are defined in the Math class.

Static property

API | name | Type | value | Explanation
4 | E | Number | 2.7182818284590452354 | Value of natural logarithm e
4 | LN10 | Number | 2.302585092994046 | Natural logarithm value of 10
4 | LN2 | Number | 0.6931471805599453 | Natural logarithm value of 2
4 | LOG2E | Number | 1.4426950408889634 | Logarithmic value of e with base 2
4 | LOG10E | Number | 0.4342944819032518 | Common logarithm value of e
4 | PI | Number | 3.1415926535897932 | Pi
4 | SQRT1_2 | Number | 0.7071067811865476 | Square root of 1/2
4 | SQRT2 | Number | 1.4142135623730951 | Square root of 2

Class overview

Base class properties


Math.E property

API version 4

Math.E properties

It is the value of the natural logarithm e (2.7182818284590452354).


Math.LN10 property

It is the value of the natural logarithm of 10 (2.302585092994046).


Math.LN2 property

It is a natural logarithm value of 2 (0.6931471805599453).


Math.LOG2E property

The base 2 logarithmic value of e (1.4426950408889634).


Math.LOG10E property

The common logarithm value of e (0.4342944819032518).


Math.PI property

It is the circumference ratio (3.1415926535897932).


Math.SQRT1_2 property

It is the square root of 1/2 (0.7071067811865476).


Math.SQRT2 property

It is the square root of 2 (1.4142135623730951).


Math method

API version 4

Method

The following methods are defined in the Math class.

Static method

API | name | Explanation
4 | abs | Find the absolute value
4 | acos | Find the inverted cosine
4 | asin | Find the inverse sine
4 | atan | Find the tangent
4 | atan2 | Find the angle of the coordinates (x, y)
4 | ceil | Find the value rounded up to the nearest whole number
4 | cos | Find the cosine
4 | exp | Finds the power of e (base of natural logarithm) with the specified value as the exponent
4 | floor | Find the value with the decimal places truncated
4 | log | Find the natural logarithm
4 | max | Find the maximum value
4 | min | Find the minimum value
4 | pow | Find the power
4 | random | Obtain a pseudo-random number
4 | round | Find the value rounded to the nearest whole number
4 | sin | Find the sine
4 | sqrt | Find the square root
4 | tan | Seeking tangent

Class overview

Base class methods


Math.abs method

Explanation

Find the absolute value.

Call format

var v = Math.abs ( x )

Return value

Returns the absolute value of x as a Number type.

argument

Number x

Value for which the absolute value is calculated

exception

None

Example of use

var v1 = Math.abs (0.1);
print(v1, "\n");
var v2 = Math.abs(-0.1);
print(v2, "\n");

Related item


Math.acos method

Explanation

Find the inverted cosine.

Call format

var v = Math.acos ( x )

Return value

Returns the inverse cosine of x as a Number type.

argument

Number x

Value for finding the inverted cosine

exception

None

Example of use

var v1 = Math.cos(Math.PI / 6);
print(v1, "\n");
var v2 = Math.acos(v1);
print(v2, "\n");

Related item

asin , atan , cos methods


Math.asin method

Explanation

Find the inverse sine.

Call format

var v = Math.asin ( x )

Return value

Returns the inverse sine of x as a Number type.

argument

Number x

Value to find the inverse sine

exception

None

Example of use

var v1 = Math.sin(Math.PI / 3);
print(v1, "\n");
var v2 = Math.asin(v1);
print(v2, "\n");

Related item

acos , atan , sin methods


Math.atan method

Explanation

Find the reverse tangent.

Call format

var v = Math.atan ( x )

Return value

Returns the arctangent of x as a Number type.

argument

Number x

Value for tangent

exception

None

Example of use

var v1 = Math.tan(Math.PI / 2);
print(v1, "\n");
var v2 = Math.atan(v1);
print(v2, "\n");

Related item

acos , asin , atan2 , tan methods


Math.atan2 method

Explanation

Find the angle of the coordinates ( x , y ).

Call format

var v = Math.atan2 ( y , x )

Return value

Returns the inverse tangent of y / x as a Number type.

argument

Number y

Y coordinate

Number x

X coordinate

exception

None

Example of use

var v = Math.atan2 (1, 1);
print(v, "\n");

Related item

atan , tan method


Math.ceil method

Explanation

Find the value rounded up to the nearest whole number.

Returns the smallest integer that is equal to or greater than x .

Call format

var v = Math.ceil ( x )

Return value

Returns the value rounded up to the nearest whole number as an integer.

argument

Number x

Value to round up after the decimal point

exception

None

Example of use

print(Math.ceil(0.9), "\n"); /* 1 */
print(Math.ceil(1.0), "\n"); /* 1 */
print(Math.ceil(1.1), "\n"); /* 2 */

print(Math.ceil(-0.9), "\n"); /* 0 */
print(Math.ceil(-1.0), "\n"); /* -1 */
print(Math.ceil(-1.1), "\n"); /* -1 */

Related item

floor , round method


Math.cos method

Explanation

Find the cosine.

Call format

var v = Math.cos ( x )

Return value

Returns the cosine of x as a Number type.

argument

Number x

Value for cosine

exception

None

Example of use

var v1 = Math.cos(Math.PI / 6);
print(v1, "\n");
var v2 = Math.acos(v1);
print(v2, "\n");

Related item

acos , sin , tan methods


Math.exp method

Explanation

Find the power of e (base of natural logarithm) with x as the exponent.

Call format

var v = Math.exp ( x )

Return value

Returns the value of e raised to the power of x as a Number type.

argument

Number x

A value that specifies a power

exception

None

Example of use

var v = Math.exp (2);
print(v, "\n");

Related item

log method


Math.floor method

Explanation

Calculates the value with the decimal places truncated.

Returns the largest integer equal to or less than x .

Call format

var v = Math.floor( x )

Return value

Returns an integer with the decimal point truncated.

argument

Number x

Value to round down to the nearest whole number

exception

None

Example of use

print(Math.floor(0.9), "\n"); /* 0 */
print(Math.floor(1.0), "\n"); /* 1 */
print(Math.floor(1.1), "\n"); /* 1 */

print(Math.floor(-0.9), "\n"); /* becomes -1 */
print(Math.floor(-1.0), "\n"); /* becomes -1 */
print(Math.floor(-1.1), "\n"); /* -2 */

Related item

ceil , round method


Math.log method

Explanation

Find the natural logarithm.

Call format

var v = Math.log ( x )

Return value

Returns the natural logarithm of x as a Number type.

argument

Number x

Value for finding the natural logarithm

exception

None

Example of use

var v = Math.log (20);
print(v, "\n");

Related item

exp method


Math.max method

Explanation

Find the maximum value.

Call format

var v = Math.max ([ value_1 [, value_2 [,…]]])

Return value

Returns the largest value of the specified arguments.

argument

Number value_n

Value to find the maximum

exception

None

Example of use

var v1 = Math.max (1, 2, 3);
print(v1, "\n");
var v2 = Math.max(-1, -2, -3);
print(v2, "\n");

Related item

min method


Math.min method

Explanation

Find the minimum value.

Call format

var v = Math.min ([ value_1 [, value_2 [,…]]])

Return value

Returns the smallest value of the specified arguments.

argument

Number value_n

Value to find the minimum

exception

None

Example of use

var v1 = Math.min (1, 2, 3);
print(v1, "\n");
var v2 = Math.min(-1, -2, -3);
print(v2, "\n");

Related item

max method


Math.pow method

Explanation

Find the power.

Call format

var v = Math.pow ( x , n )

Return value

Returns a power of x with n as an exponent oftype Number.

argument

Number x

Value for exponentiation

Number n

index

exception

None

Example of use

var v1 = Math.pow (10, 5);
print(v1, "\n");
var v2 = Math.pow(2, 10);
print(v2, "\n");

Related item

sqrt method


Math.random method

Explanation

Find a pseudo-random number.

Call format

var v = Math.random()

Return value

Returns a pseudo-random number in the range 0 to 1 of type Number.

argument

None

exception

None

Example of use

for(var n = 0; n < 10; n++) {
    var v = Math.random();
    print(v, "\n");
}

Related item


Math.round method

Explanation

Find the value rounded to the nearest whole number.

Returns the integer closest to the value (value + the largest (positive direction) of integers less than or equal to 0.5).

Call format

var v = Math.round ( x )

Return value

Returns an integer rounded to the nearest whole number.

argument

Number x

Value to round off to the nearest whole number

exception

None

Example of use

print(Math.round(0.49), "\n"); /* 0 */
print(Math.round(0.50), "\n"); /* 1 */
print(Math.round(0.51), "\n"); /* 1 */

print(Math.round(-0.49), "\n"); /* 0 */
print(Math.round(-0.50), "\n"); /* 0 */
print(Math.round(-0.51), "\n"); /* -1 */

Related item

ceil , floor method


Math.sin method

Explanation

Find the sine.

Call format

var v = Math.sin ( x )

Return value

Returns the sine of x as a Number type.

argument

Number x

Value to find the sine

exception

None

Example of use

var v1 = Math.sin(Math.PI / 3);
print(v1, "\n");
var v2 = Math.asin(v1);
print(v2, "\n");

Related item

asin , cos , tan methods


Math.sqrt method

Explanation

Find the square root.

Call format

var v = Math.sqrt ( x )

Return value

Returns the square root of x as a Number type.

argument

Number x

Value to find the square root

exception

None

Example of use

var v1 = Math.sqrt(2);
print(v1, "\n");
var v2 = Math.sqrt(16);
print(v2, "\n");

Related item

pow method


Math.tan method

Explanation

Ask for a tangent.

Call format

var v = Math.tan ( x )

Return value

Returns the tangent of x as a Number type.

argument

Number x

Value for tangent

exception

None

Example of use

var v1 = Math.tan(Math.PI / 2);
print(v1, "\n");
var v2 = Math.atan(v1);
print(v2, "\n");

Related item

atan , atan2 , cos , sin methods


Math event

API version 4

Event

There are no events defined in the Math class.

Class overview

Base class event


NetObject class

Object
 | NetObject

CRS file is a base class of executable classes. It has a function to communicate with the WEB server and a function to compile and execute the downloaded CRS file. A class derived from NetObject class can execute a new CRS program by using the Get method.

The NetObject class is a virtual class and cannot instantiate itself.


NetObject property

API version 4

Property

The following properties are defined in the NetObject class.

API | name | access | Type | initial value | Explanation
4 | UseChange | CRW | boolean | $FALSE | Whether to raise the Change event by changing the default property

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


NetObject.UseChange property

Select whether to raise the Change event by changing the default property .

Setting $TRUE raises the Change event. If you set $FALSE, the Change event will not fire.


NetObject method

API version 4

Method

The following methods are defined in the NetObject class.

API | name | Explanation
4 | Cache | Download and cache the CRS file from the WEB server
4 | Eval | Run the CRS script given as a string
4 | Get | Download the CRS file from the WEB server and execute it

Class overview

Base class methods


NetObject.Cache method

Explanation

Download the CRS file from the WEB server and cache it.

It works the same as the Get method, except that it does not execute the downloaded CRS. See the Get method for details.

If "Do not use cache" is set in the Biz/Browser environment settings, it will not be cached. Also, if the cache prohibition attribute is added to the response header from the server or the time stamp is unknown, it will not be cached.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

obj.Cache( URL [, param1 [, param2 [, ...]]])

Return value

None

argument

String URL

URL of the CRS file

Same as the URL of the Get method .

Object param

Parameters to be added to the request

Same as param of Get method .

A general WEB server adds a cache prohibition attribute to the response header of a POST request with parameters. When using param , it is necessary to consider the behavior of such a WEB server.

exception

CRS-331

Communication error

Same as the Get method exception.

Example of use

Function LoadCache() {
    //.Cache("Form1.crs");
    //.Cache("Form2.crs");
    //.Cache("Form3.crs");
}

Related item

Get method

Root.CacheSetup method

Root.CacheMode property


NetObject.Eval method

Explanation

Run the CRS script.

Executing a script using the Eval method works in the same way as executing a Function from the caller. The CRS script to be executed can be given as a character string with the crs argument, and the return value can be returned with the return statement, which is the return value of the Eval method.

Call format

obj.Eval( crs )

Return value

Depends on the return statement of the script

argument

String crs

Specify the CRS script as a character string.

exception

None

Example of use

var t = Eval("return new" + str(type) + ";");
Append(t, "data");

Related item


NetObject.Get method

Explanation

Download the CRS file from the WEB server and execute it.

The target CRS file specified in the URL is searched in the following order.

(1) If it is already cached on the local computer, read it from the cache.

(2) If it is included in the CRS archive (CAR file) imported in advance, it will be read from the archive.

(3) Send a request to the WEB server and get the CRS file.

The acquired content is immediately executed as a CRS script. If possible, save the CRS file obtained from the WEB server in the cache.

For cache control , see Controlling the cache with HTTP headers below.

If you do not specify param , the request will be sent via HTTP GET.

If you specify param , the request will be sent via HTTP POST.

If the web server does not return 200 ($HTTP_OK) for the HTTP status code, a CRS-331 exception will occur.

It is also possible to raise an arbitrary exception by using the HTTP response header.

See Controlling Exceptions with HTTP Headers for more information.

The current scope (this) of the acquired CRS script is the object that executed the Get method. For example, executing the Get method inside the OnTouch event handler of the Button class will create an object as a child of the Button object. When getting the CRS that defines the screen (Form class), it is common to execute the Get method on the Root object (//) or Form object.

The Get method does not return until the execution of the acquired CRS script is completed.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

obj.Get( URL [, param1 [, param2 [, ...]]])

Return value

None

argument

String URL

URL of the CRS file

The URL is determined by the following rules.

Specified from protocol

If specified from a protocol such as http: //, the request will be sent as is.

The URL cannot start with the host name. If you want to specify the host name, be sure to specify it from the protocol.

Example)

Get("http://server/path/form1.crs");
Get("https://server/path/form1.crs");

Absolute path specification

URLs starting with "/" are absolute paths. Send the request to the server that downloaded the CRS file that executed the Get method.

Example) When the CRS that executes the Get method is downloaded from http://server/path1/form1.crs

Get("/path2/form2.crs");
↓
Get("http://server/path2/form2.crs")

Relative path specification

URLs that do not start with "/" are relative paths. Send the request to the same path on the server where you downloaded the CRS file that executed the Get method.

Example) When the CRS that executes the Get method is downloaded from http://server/path/form1.crs

Get("form3.crs");
↓
Get("http://server/path/form3.crs")

Using the APPROOT property of the SYS object behaves differently than above with relative path specifications. The APPROOT property is retained for compatibility with versions prior to version 3.0 and should not be used in new programs.

Object param

Parameters to be added to the request

There is no limit to the number of parameters that can be specified.

It is converted to a character string and added to the request according to the conversion rules for each object type specified in the parameter .

exception

CRS-331

Communication error

The Exception object has the following structure.

Exception{
    String RequestURL; /* URL of the request that caused the exception */
    Number StatusCode; /* HTTP Status Code */
    String ContentType; /* HTTP Header Content-Type */
    String Body; /* Response body */
}

Example of use

Function OnTouch(e){
    //.Form1.Delete();
    //.Get("Form2.crs");
}

Related item

Cache , CsvDocument.Get method

Conversion rules for each type of object specified in param

type

Explanation

String literal

Example) "key = 100", "abc"

If the specified character string contains "=", the left side of "=" is the parameter name and the right side is the data value.

If "=" is not included, "argN" (N is a number according to the position of the parameter) is used as the parameter name, and the entire character string is used as the data value.

Numeric literal

Example) 100, 1.2

The parameter name is "argN" (N is a number according to the position of the parameter), and the data value is a character string converted in the standard format of Number type.

String

The object name is the parameter name, and the entire character string of the Value property is the data value.

Number

Date

The object name is the parameter name and the Value property is the data value.

The value of the Value property is converted to a string in the standard format according to the data type.

PulldownList

OptionButton

ListBox (single selection)

It is a single-selection composite object.

The object name is the parameter name and the Value property is the data value.

The Value property represents the currently selected element. -1 when no element is selected.

The value of the Value property is converted to a string.

CheckBox

ListBox (multiple selection)

This is a multi-select compound object.

The object name is the parameter name, and the Selected property of each element (CheckItem, ListItem) is the data value.

Parameters are generated for all elements.

Example)

CheckBox CheckBox1 {
   CheckItem item[3];
}

In this example, three parameters with the same name "CheckBox1" are generated, and item [0] .Selected, item[1] .Selected, and item[2] .Selected are the data values.

It is "1" in the selected state and "0" in the non-selected state.

Root

Dialog

Form

Record

TabForm

Finds child objects and makes all found objects parameters.

The object name is the parameter name and the default property is the data value.

Example)

Form Form1 {
   Button Button1;
   Label Label1;
   String String1;
}

In this example, we will generate three parameters named "Button1", "Label1", and "String1", and set their default properties as data values.

The value of the default property is converted to a string in the standard format according to the data type.

Objects other than the above

The object name is the parameter name and the default property is the data value.

The value of the default property is converted to a string in the standard format according to the data type.

Controlling the cache with HTTP headers

If the HTTP response header returned from the server is specified as no-cache by the standard HTTP headers Cache-Control header and Pragma header, Biz/Browser will not cache the acquired file.

Cache-Control: no-cache
Pragma: no-cache

The CRS-Cache-Control header, which is a header unique to Biz/Browser, can control the cache in preference to the cache control (Cache-Control, Pragma header) by the standard HTTP header.

CRS-Cache-Control: no-cache
Or
CRS-Cache-Control: cache

If no-cache is specified in the CRS-Cache-Control header, it will not be cached. If cache is specified, it will be cached.

This function can be used when you want to perform different cache control in Biz/Browser with a proxy server that relays HTTP messages. For example, if you specify no-cache in the Cache-Control header and cache in the CRS-Cache-Control header, it will not be cached by the relay proxy server, and Biz/Browser can instruct the cache operation.

Controlling exceptions with HTTP headers

You can raise an arbitrary exception by using the header of the HTTP response returned from the server. This function can be used for application-specific communication error handling.

By specifying the CRS-Exception header in the response header with HTTP status code 200 ($HTTP_OK), you can raise an exception even in normal communication.

The CRS-Exception header is specified in the following format.

CRS-Exception: Method: Method ; Code: Code ; Message: Message ;

Method, Code, and Message correspond to the properties of the same name in the Exception class.

The content of the Method is set in the Method property. If Method is not specified, "Server-Error" will occur.

The contents of the Code are set in the Code property. If Code is not specified, it will be 0.

The content of the Message is set in the Message property. If you do not specify Message, the entire CRS-Exception header is set to Message.

The Exception object of the exception that occurs has the same structure as the CRS-331 exception and stores the same information (RequestURL, StatusCode, etc.).


NetObject event

API version 4

Event

The following events are defined in the NetObject class.

API | name | Explanation
4 | Change | Occurs due to changes in default properties

Class overview

Base class event


NetObject.Change event

An event that occurs when the default property of an object with the UseChange property set to $TRUE changes.

Since the Change event occurs when the default property changes, it can be used when the behavior is linked to the change in the object value.

In many classes, changes in the default properties cause another class-specific event. For example, in the TextBox class, the Touch event is fired when there is input. If there is input, it will be stored in the default property Value, so setting the UseChange property to $TRUE will also generate a Change event, but it is usually more efficient to use the Touch event.

It makes sense to use the Change event with the UseChange property set to $TRUE if the class does not fire an event when the default property changes. For example, in the String class, the event does not occur even if the Value property changes. If you need to monitor a String object and react to changes in its value, setting the UseChange property to $TRUE raises the Change event.

Another use is when you want to handle the change of value by screen input and script with a common event handler. For example, if you set the UseChange property to $TRUE in the TextBox class, keystrokes from the screen will fire the Touch and Change events, and changing values ​​from the script will only fire the Change event.


Number class

Object
 | NetObject
 |  | Number

A class that holds numbers.

Values ​in the Number class are managed in floating-point notation, have a maximum precision of 15 digits, and represent numbers in the range of approximately 1.7E-308 to 1.7E + 308.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


Number property

API version 4

Property

The following properties are defined in the Number class.

API | name | access | Type | initial value | Explanation
4 | Value | CRW | Number | 0 | Object value

Static property

API | name | Type | value | Explanation
4 | MAX_VALUE | Number | 1.7976931348623158e + 308 | Maximum value of Number class
4 | MIN_VALUE | Number | 2.2250738585072014e-308 | Minimum value of Number class

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Number.Value property

The value of the Number object.


Number.MAX_VALUE property

Indicates the maximum value (1.7976931348623158e + 308) that can be expressed in the Number class.


Number.MIN_VALUE property

Indicates the minimum value (2.2250738585072014e-308) that can be expressed in the Number class.


Number method

API version 4

Method

The following methods are defined in the Number class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Number object
4 | ToExponential | Returns as a string in exponential notation
4 | ToFixed | Returns as a fixed-point string
4 | ToLocaleString | Convert to a string using locale format
4 | To Precision | Returns a string in exponential or fixed-point notation for the specified number of digits
4 | ToString | Returns a string
4 | ValueOf | Returns the stored number

Class overview

Base class methods


Number constructor

Explanation

Initialize the Number object.

Call format

var num = new Number ([ value ])

Return value

Number object

argument

Number value

Value to initialize

exception

None

Example of use

var num = new Number (5678);
print(num, "\n");

Related item


Number.ToExponential method

Explanation

Returns the value stored in the Number object as a string in exponential notation.

Call format

var text = num.ToExponential ([ fractionDigits ])

Return value

Exponential notation string

argument

integer fraction Digits

Number of digits in the mantissa

Specify 0 to 15. If omitted, it will be 15.

exception

Func-4

The argument value is invalid

Example of use

var num = new Number;
num.Value = 5678.12345;
print(num.ToExponential(3), "\n");

--- Output result ---
5.678e + 003

Related item


Number.ToFixed method

Explanation

Returns the value stored in the Number object as a fixed-point string.

Call format

var text = num.ToFixed ([ fractionDigits ])

Return value

Fixed-point notation string

argument

integer fraction Digits

You can specify 0 to 15 digits after the decimal point . If omitted, it will be 0.

exception

Func-4

The argument value is invalid

Example of use

var num = new Number;
num.Value = 5678.12345;
print(num.ToFixed(3), "\n");

--- Output result ---
5678.123

Related item


Number.ToLocaleString method

Explanation

Returns the value stored in the Number object as a locale-formatted string.

The current implementation returns the same value as the ToString method.

Call format

var text = num.ToLocaleString()

Return value

Locale format string

argument

None

exception

None

Example of use

var num = new Number;
num.Value = 5678;
print(num.ToLocaleString(), "\n");

Related item

ToString method


Number.ToPrecision method

Explanation

Returns the value stored in the Number object as a string in exponential or fixed-point notation for the specified number of digits.

If the argument is omitted, the result equivalent to the ToString method is returned.

Call format

var text = num.ToPrecision ([ fractionDigits ])

Return value

String in exponential or fixed-point notation

Returns the shorter expression.

argument

integer fraction Digits

Number of digits

Specify 1 to 15.

exception

Func-4

The argument value is invalid

Example of use

var num = new Number;
num.Value = 5678.12345;
print(num.ToPrecision(3), "\n");
print(num.ToPrecision(6), "\n");

--- Output result ---
5.68e + 003
5678.12

Related item

ToExponential , ToString method


Number.ToString method

Explanation

Returns the value stored in the Number object as a string.

Returns as a radix base string by specifying an argument .

Call format

var text = num.ToString([ radix ])

Return value

Converted string

argument

integer radix

radix

You can specify a value between 2 and 36. For hexadecimal numbers, specify 16.

The default number is decimal.

exception

Func-4

The argument value is invalid

Example of use

var num = new Number;
num.Value = 5678;
print(num.ToString(16), "\n");

--- Output result ---
162e

Related item


Number.ValueOf method

Explanation

Returns the value stored in the Number object.

Call format

var v = num.ValueOf()

Return value

Number type value

argument

None

exception

None

Example of use

var num = new Number;
num.Value = 5678;
print(num.ValueOf(), "\n");

Related item


Number event

API version 4

Event

There are no events defined in the Number class.

Class overview

Base class event


Object class

Object

The base class for all classes. All the classes contained in Biz/Browser are derived from the Object class.

The Object class has the most basic functionality of an object, such as managing the object tree and maintaining and opening the object.

The Object class is a virtual class and cannot instantiate itself.


Object property

API version 4

Property

The following properties are defined in the Object class.

API | name | access | Type | Explanation
HT (10) | Class | R | String | name of the class
4 | ClassName | R | String | name of the class
4 | IsArray | R | boolean | Whether the object is an array
4 | Name | R | String | The name of the object
4 | ValueType | - | - | Object data type

Properties that are added only to array objects

API | name | access | Type | Explanation
4 | Index | R | integer | Position of array elements
4 | Length | R | integer | Number of elements in the array object

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview


Object.ClassName property

Indicates the class name of the object as a character string.

This property is read-only and cannot be updated.


Object.IsArray property

$TRUE if the object is an array, $FALSE otherwise.

This property is read-only and cannot be modified.


Object.Name property

Indicates the name of the object as a string. The name of the object is the name identified in the object tree.

CRS allows you to access an object by multiple names by storing the object reference in the var variable. The Name property indicates the name given to the object when it is connected to the object tree, regardless of the name (label) of these var variables. The Name property of objects that are not connected to the object tree is usually an empty string and anonymous.

The object name is specified in a regular object tree connection statement or in the Append method.

Object tree connection statement example

Form form1 {
     :
    Button Button1 {
        :
    }
     :
}

In this example, form1 and button1 are stored in the Name property.

Append example

:
var obj = new String;
Append (obj, "StringA");
:

In this example, StringA is stored in the Name property.

This property is read-only and cannot be updated.


Object.ValueType property

* ValueType is not strictly a property, but it is treated as a property here for convenience.

ValueType represents the data type of the object. ValueType is specified in the following format.

ClassName:ValueType Name

Example

TextBox:Number TextBox1{
    ...
}

The above example defines a textbox with a data type of Number.

ValueType can be omitted. If ValueType is omitted in a class that can be specified like the TextBox class, it will be a String type.

TextBox TextBox1{
    /* Default ValueType is String */
}

Some object data types are fixed by class. For example, the DateEdit class is always of type Date, so specifying ValueType is invalid.

ValueType is also the data type of the default property, because the default property of each class represents the value of the object.

The type of data type that can be specified for ValueType depends on the class specifications. See the description of each class for details.

ValueType can be set like a property in the property view in Biz/Designer, but since it is not strictly a property, the following cannot be specified in the CRS script.

TextBox TextBox1{
    ValueType = Number; /* Example of incorrect specification */
}


Object.Index property

A property attached only to the array element object, which indicates the position (subscript) of the array element.

This property is attached to each array element. Note that it is not attached to the array object.

Number num[3];
MessageBox(num[1].Index); /* 1 is displayed in this line */
MessageBox(num.Index); /* This line is an error. Index is not added to the array object */

This property has no effect on non-arrayed objects.

This property is read-only and cannot be updated.


Object.Length property

A property attached only to array objects that represents the number of elements in the array.

This property is attached to the array object. Note that it is not attached to individual array elements.

Number num[3];
MessageBox(num.Length); /* 3 is displayed on this line */
MessageBox(num[1].Length); /* This line is an error. Length is not added to the element */

This property has no effect on non-arrayed objects.

This property is read-only and cannot be updated.


Object.Class property

Indicates the class name of the object as a character string. Refers to the same value as the ClassName property.

This property is read-only and cannot be updated.


Object method

API version 4

Method

The following methods are defined in the Object class.

API | name | Explanation
4 | Append | Connects the specified object to the object tree
4 | Clear | Initializes the object's default properties
4 | ClearChild | Initializes the default properties of all child objects
23 | ClearEvent | Remove an event from the event queue
4 | Delete | Disconnect the object from the object tree
4 | DeleteChild | Disconnects all child objects from the object tree
4 | FindChild | Finds a child object with the specified name
4 | FindObject | Search for an object from the object tree
4 | GetChildObjects | Gets all child objects
4 | PostEvent | Send an event to the object

Methods that only array objects are added

API | name | Explanation
4 | Insert | Add an element to the array object
4 | Truncate | Delete all elements of the array object

Class overview


Object.Append method

Explanation

Connects the specified object as a child object to the object tree.

Objects connected to the object tree are no longer deleted when the variable scope disappears and can be referenced from the object tree at any time. If you want to keep the object permanently, connect to the object tree. The connected object can be deleted with the Delete method.

Be aware that connecting many objects to the object tree can be memory inefficient and slow.

Call format

obj.Append ( child [, name ])

Return value

None

argument

Object child

Child object to connect

The following objects cannot be specified.

· DisplayObject object of the class that the class inherits

-Objects that violate the rules of the hierarchical structure

· Objects that are already connected to another parent object

-Array element object

String name

The name of the child object

Cannot be specified if child has already been given a name.

An exception will be thrown if there are objects with the same name in the same hierarchy to connect.

exception

CRS-334

Only objects can be connected

CRS-335

Objects with the same name cannot connect

CRS-336

Already connected to the object tree

CRS-357

Cannot Append with another name

CRS-362

Objects with array elements or structures cannot be Append

Example of use

Function OnTouch(e){
    var child = new Array(1, 2, 3, 4, 5);
    Append (child, "TheArray");
}

Related item

Delete , DeleteChild methods


Object.Clear method

Explanation

Initializes the object's default properties.

Initialize

Initialization is done according to the data type of the default property ( ValueType of the object ). (It does not return to the initial value set when the object was created)

For example, a String object will be initialized to an empty string, and a Number object will be initialized to 0.

The Clear method differs from assigning an initial value to a default property in that it can be initialized without being aware of the details of the object to be operated.

Even if the operation target is a Number object or String object with different values ​​to be initialized, the Clear method can be used to safely initialize it using the same procedure.

Default property

The default property is the Value property in many classes, but some classes have other properties as default properties.

Also, some classes do not have default properties. The Clear method has no effect on classes that do not have default properties.

See the documentation for each class for default properties.

Array object

Even if you execute the Clear method on an array object, it will not be reflected in each element object. You must execute the Clear method on each array element object individually.

Call format

obj.Clear()

Return value

None

argument

None

exception

None

Example of use

Function OnTouch(e){
    var childArray = GetChildObjects();
    for (var i in childArray){
        childArray[i].Clear();
    }
}

Related item

ClearChild method


Object.ClearChild method

Explanation

Initializes the default properties of all child objects connected to the object.

See the Clear method for initializing the default properties .

Call format

obj.ClearChild()

Return value

None

argument

None

exception

None

Example of use

Function OnTouch(e){
    //.Form1.ClearChild();
}

Related item

Clear method


Object.ClearEvent method

iOSAndroidWindows

Explanation

Deletes an event from the event queue.

When a large number of events occur, events may accumulate in the event queue and delay the occurrence of other events.

In such cases, this method can be used to quickly abort processing by removing the event from the event queue.

See "Events and event handlers" for more information on events.

Call format

obj.ClearEvent( ev )

Return value

None

argument

Event ev

Event object of user-defined event to be sent

Or system-defined event name

exception

None

Example of use

/* Post a large number of events */
for (var i = 0; i < 10000; i++) {
    /* user-defined event */
    PostEvent(new Event(UserEvent + 1, "AppEvent1"));

    /* system-defined event */
    PostEvent(Touch);
}

Function OnAppEvent1(e) {
    print("AppEvent1\n");
}
Function OnTouch(e) {
    print("Touch\n");
}
Button btnClear{
    X = 10;
    Y = 10;
    Title = "clear event";
    TapEventMode = Object.POST_FRONT;
    Function OnTouch(e) {
        /* user-defined event */
        ^.ClearEvent(new Event(UserEvent + 1, "AppEvent1"));
        /* system-defined event */
        ^.ClearEvent(Touch);
    }
}

Related item

PostEvent method

Event class


Object.Delete method

Explanation

Disconnects the object from the object tree.

If the disconnected object is not referenced anywhere, all connected child objects will also be disconnected in a chain.

Objects that are disconnected from the object tree and are no longer referenced anywhere are deleted. See Deleting Objects for more information.

Array object

Calling the Delete method on an element of an array deletes only that element (and its child objects). As a result, the sequence number (index) of subsequent elements is carried down.

Object reuse

As a general rule, objects disconnected from the object tree cannot be reused. Please note that objects may not work properly when reconnecting and reusing the object tree. In particular, do not reuse each class that inherits the DisplayObject class, such as buttons and text boxes .

Call format

obj.Delete()

Return value

None

argument

None

exception

None

Example of use

Function OnTouch(e){
    //.Form1.Delete();
    //.Get("Form2.crs");
}

Related item

DeleteChild , Append method


Object.DeleteChild method

Explanation

Disconnects all child objects connected to the object from the object tree.

See the Delete method for disconnecting from the object tree .

Call format

obj.DeleteChild()

Return value

None

argument

None

exception

None

Example of use

Function OnTouch(e){
    //.Form1.DeleteChild();
    //.Form1.Get("Form1Sub.crs");
}

Related item

Delete , Append method


Object.FindChild method

Explanation

Finds the child object with the specified name.

If a class identifier is specified for name , the object of the specified class will be searched.

Call format

obj.FindChild ( name )

Return value

If found, it returns a reference to that object.

Returns null if the object was not found.

argument

String name

Or

Class identifier

The name or class identifier of the object to search

exception

None

Example of use

/* Search by object name */
var child = FindChild("TEST");
if(child! = null){
    child.Value = "Hello";
}

/* Search by class */
var form_obj = FindChild(Form);
if(form_obj! = null){
    form_obj.BgColor = $WHITE;
}

Related item

GetChildObjects method


Object.FindObject method

Explanation

Search for an object in the object tree.

Similar in functionality to the FindChild method, but with more flexibility in finding objects.

Call format

obj.FindObject( name [, rule ])

Return value

If found, it returns a reference to that object.

Returns null if the object was not found.

argument

String name

Or

Class identifier

The name or class identifier of the object to search

integer rule

Search rules

Specify the rule to search from the following.

constant | Explanation
Object.FIND_CHILD | Search from child objects. The operation is similar to the FindChild method.
Object.FIND_ANCESTOR | Search by parent or ancestor.
Object.FIND_SCOPEPATH | Search for child, myself, parent, ancestor.
Object.FIND_EVENTPATH | Search for child, parent, child of parent, ancestor, child of ancestor.

If omitted, the same operation will be performed as when Object.FIND_CHILD is specified.

exception

None

Example of use

/* Find Form object from parent or ancestor */
var form_obj = FindObject(Form, FIND_ANCESTOR);

/* Search for a function with the same rule as the event handler */
var fnc = FindObject("OnTouch", FIND_EVENTPATH);
if(fnc! = null){
    fnc(e);
}

/* Search for txCode in object scope rules */
var obj = FindObject("txCode", FIND_SCOPEPATH);
if(obj! = null){
    obj.BgColor = $red;
}

Related item

FindChild method


Object.GetChildObjects method

Explanation

Gets all child objects connected to the object.

Call format

obj.GetChildObjects()

Return value

Array object containing all child objects

Returns an Array object that contains a reference for the child object. The elements of the Array object are stored as an associative array with the name of the child object as the key. To access the stored child objects

childArray["object name"]

Access by specifying the name as a character string in the format of

for(var i in childArray){
       print(childArray[i].value, "\n");
       :
}

Access sequentially in a for in loop as in.

Please note that access by name is case sensitive.

The GetChildObjects method does not get the array elements of the arrayed child objects. If you need access to array elements, do the following:

var childArray = GetChildObjects();
var obj = childArray["item"][index];

argument

None

exception

None

Example of use

Function setData(objName, objValue){
    var ca = GetChildObjects();
    if(ca[objName]! = null) {
        if(ca[objName].Value! = null) {
            ca[objName].Value = objValue;
        }
    }
}

Related item

FindChild method


Object.PostEvent method

API version 4

Object.PostEvent method Change History

Explanation

Send an event to the object.

This method allows the CRS program to raise an event at any time.

Events are passed through the event queue to the corresponding event handler. See Events and Event Handlers for more information.

When sending a user-defined event, use the event number of the Reason property after the code number indicated by UserEvent(such as UserEvent + 1) so that it does not overlap with the system-defined event number.

When sending a system-defined event, you can specify the event name as is for ev .

You can forward the event to the parent object by calling the PostEvent method in the event handler with no arguments.

Call format

obj.PostEvent([ ev ])

Return value

None

argument

Event ev

Event object for user-defined events to send

Or system-defined event name

If omitted, the event is forwarded to the parent object as it is.

integer mode

Specifies how events are added to the event queue. *1

Specify a combination of the following values. If omitted, the value will be Object.POST_DEFAULT.

constants

value

Explanation

Object.POST_DEFAULT

0

Add the event to the back of the event queue (works as before).

Object.POST_FRONT

1

Add the event to the head of the event queue.

Specify if you want the event to occur immediately.

Object.POST_UNIQUE

2

If the same type of event exists in the event queue with the same originating object, the event is not added to the queue.

When a large number of events occur, events may accumulate in the event queue and delay the occurrence of other events.

Object.POST_UNIQUE may prevent too many events from accumulating in the event queue.

Do not specify if ev is omitted.

exception

None

Example of use

/* User-defined event */
PostEvent(new Event(UserEvent + 1, "AppEvent1"));

/* System-defined event */
PostEvent(Touch);

Function OnAppEvent1(e) {
    print("AppEvent1 \n");
}
Function OnTouch(e){
    print("Touch \n");
}

Related item

Event class

Change History
*1　The specification has been changed since API version 23.


Object.Insert method

Explanation

Add elements to the arrayed objects.

This method is added only to array objects and array elements. This method has no effect on non-arrayed objects.

Running on an array object inserts a new element at the end of the array.

When executed on an array element, a new element is inserted at the previous position.

Call format

obj.Insert ([ count ])

obj[ index].Insert([count])

Return value

None

argument

integer count

Specifies the number of elements to insert. If omitted, one item will be inserted.

integer index

Specify the insertion position with a subscript. The element at the specified position must exist.

exception

None

Example of use

/* Example of use with array object */
Record arrayRec[]{
    Number numItem;
    String strItem;
}
arrayRec.Insert(10);

/* Example of use with array elements */
Record arrayRec[5]{
    Number numItem;
    String strItem;
}
arrayRec[1].Insert(2);

Related item

Truncate method


Object.Truncate method

Explanation

Deletes all the elements of the arrayed object.

This method only appends array objects. This method has no effect on non-arrayed objects.

It works faster than repeating the Delete method for individual array elements .

Unlike calling the Delete method on an array object, the definition is not deleted, so you can later recreate the array element with the Insert method.

Call format

obj.Truncate()

Return value

None

argument

None

exception

None

Example of use

Record arrayRec[5] {
    Number numItem;
    String strItem;
}
arrayRec.Truncate();

Related item

Insert method


Object event

API version 4

Event

There are no events defined in the Object class.

Class overview


Record class

Object
 | NetObject
 |  | Record

A class for grouping multiple objects.

The Record class itself has no functionality and is used to place another object underneath the Record object.

For example, you can use the Record class to return structured data in the return value of a Function.

Function sample() {
    var ret = new Record {
        Number code;
        String text;
    }
    ret.code = 100;
    ret.text = "abcdefg";
    return ret;
}

It can also be used when you want to create a simple data structure with a CRS program.

Record custDB[] {
    Number custCode;
    String custName;
    String custAddr;
}
custDB << CSV {
    1001, "Tokyo Taro", "Tokyo"
    1002, "Osaka Hanako", "Osaka"
    :
};

Default properties and ValueType

The default property is Value . The value type specification is invalid.


Record property

API version 4

Property

The following properties are defined in the Record class.

API | name | access | Type | initial value | Explanation
4 | Value | CRW | Number | 0 | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Record.Value property

The value of the object. Holds a value of type Number.

The value of this property does not affect the behavior of the object.


Record method

API version 4

Method

There are no methods defined in the Record class.

Class overview

Base class methods


Record event

API version 4

Event

There are no events defined in the Record class.

Class overview

Base class event


RegexMatcher class

Object
 | RegexMatcher

Regular expression patternA regular expression engine for interpreting and matching the input string.

Create an object of the RegexMatcher class with the Matcher method of the RegexPattern class . The RegexMatcher class has various methods for match and replace operations.

Default property and ValueType

The default property is InputString . The ValueType specification is invalid.

About reference to forward reference group of replacement operation method

The substring of the forward reference group can be referenced by writing "$n" in the replacement string specified in the AppendReplacement , ReplaceAll , and ReplaceFirst methods. Enter the group number in n. For example, to refer to group 1, enter "$ 1".

If you want to include "$" as a literal in the replacement string, escape it with "\". When writing in a CRS program, "\" is also an escape character in the CRS program, so it is necessary to overlap two "\" like "\\ $ text".


RegexMatcher property

API version 6

Property

The following properties are defined in the RegexMatcher class.

API | name | access | Type | Explanation
6 | GroupCount | R | integer | Number of forward reference groups specified in the regular expression pattern
6 | InputString | R | String | Input string set in the regular expression engine
6 | Pattern | R | RegexPattern | RegexPattern object from which the RegexMatcher object was created

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


RegexMatcher.GroupCount property

The number of forward reference groups specified in the regular expression pattern.

This property is read only.


RegexMatcher.InputString property

This is the input string set in the regular expression engine.

This property is read only.


RegexMatcher.Pattern property

The RegexPattern object from which the RegexMatcher object was created.

This property is read only.


RegexMatcher method

API version 6

Method

The following methods are defined in the RegexMatcher class.

API | name | Explanation
6 | AppendReplacement | Perform continuous addition and replacement
6 | AppendTail | Do an end addition replacement
6 | End | Get the tail index of the matched result
6 | Find | Find next substring matching regular expression pattern from input string
6 | GetInputString | Gets the input string set in the regular expression engine
6 | Group | Get substring of matching result
6 | LookingAt | Matches the regular expression pattern from the beginning of the input string
6 | Matches | Matches the entire input string with a regular expression pattern
6 | ReplaceAll | Replaces all occurrences of the regular expression pattern with the specified string
6 | ReplaceFirst | Replaces the first match of the regular expression pattern with the specified string
6 | Reset | Reset the regular expression engine
6 | Start | Get the first index of the matching result

Class overview

Base class methods


RegexMatcher.AppendReplacement method

Explanation

Performs continuous addition and replacement.

Returns the string from the input string after the addition position to the part that matched the last time. In this case, the matched part is replaced by the replacement string. After that, the additional position moves to the position after the last index of the matched part.

Call format

var s = rm.AppendReplacement( replacement )

Return value

From the input string after the addition position to the last matched part, the matching part is replaced with the replacement string and returned.

argument

String replacement

Replacement string

You can use a reference to the forward reference group by "$n" .

exception

Func 4

Invalid argument value

Func 14

Value cannot be referenced

Example of use

var p = RegexPattern.Compile("([0-9])([0-9])([0-9])");
var m = p.Matcher("Biz/Browser 311, Biz/Desginer 400, abcde");
var s ="";
while(m.Find()){
    s += m.AppendReplacement("$1.$2.$3");
}
s += m.AppendTail();
print(s,"\n");

Related item

AppendTail method


RegexMatcher.AppendTail method

Explanation

Do an end addition replacement.

Returns from the input string after the addition position to the end.

Call format

var s = rm.AppendTail()

Return value

Character string from the input string after the addition position to the end

argument

None

exception

None

Example of use

var p = RegexPattern.Compile("([0-9])([0-9])([0-9])");
var m = p.Matcher("Biz/Browser 311, Biz/Desginer 400, abcde");
var s ="";
while(m.Find()){
    s += m.AppendReplacement("$1.$2.$3");
}
s += m.AppendTail();
print(s,"\n");

Related item

AppendReplacement method


RegexMatcher.End method

Explanation

Gets the tail index of the matched result.

You can specify group to get the trailing index of the substring that is forward referenced by the group in the regular expression pattern.

The groups are numbered from left to right starting with 1, with group 0 representing the entire pattern.

Regular expression patterns such as "(a)*" may match the empty string. In this case -1 is returned.

However, if you specify 0 for the group number, 0 is returned.

Call format

var e = rm.End( [ group ] )

Return value

Ending index of matched part or forward reference group

(Tail index points to the next position after the end of the string)

argument

integer group

The number of the forward reference group to get

If omitted, it will be 0 (entire pattern).

exception

Func 4

Invalid argument value

Func 14

Value cannot be referenced

Example of use

var m = RegexPattern.Compile("Biz/([a-zA-Z]+)"). Matcher("Biz/Browser");
if(m.Matches()){
    print(m.Start(1), m.End(1), m.Group(1), "\n");
}

Related item

Start , Group method


RegexMatcher.Find method

Explanation

Searches the input string for the next substring that matches the regular expression pattern.

Immediately after generating the regular expression engine or if it is reset by the Reset method, the search starts from the beginning of the input string.

If no argument is specified, the search will start after the previous match.

If you specify the argument start , the regular expression engine is reset and the search starts from the position specified by start in the input string .

If the match is successful, you can use the Start , End , and Group methods to get more information.

Call format

var b = rm.Find( [ start ] )

Return value

$TRUE if there is a partial match with the regular expression pattern after the current position in the input string, $FALSE otherwise

argument

integer start

Search start position

exception

Func 4

Invalid argument value

Example of use

var m = RegexPattern.Compile("Biz"). Matcher("Biz/Browser, Biz/Desginer, Biz-Collections");
while(m.Find()){
    print(m.Start(0), m.End(0), "\n");
}

Related item

Start , End , Group , Reset methods


RegexMatcher.GetInputString method

Explanation

Get the input string that is set in the regular expression engine.

Call format

var s = rm.GetInputString()

Return value

Input string set in the regular expression engine

argument

None

exception

None

Example of use

var p = RegexPattern.Compile("Biz/([a-zA-Z]+)", 0);
var m = p.Matcher("Biz/Browser, Biz/Designer");
print(m.GetInputString() , "\n");

Related item

InputString property


RegexMatcher.Group method

Explanation

Get the substring of the matching result.

If you specify group , you can get substrings that are forward referenced by a group of regular expression patterns.

The groups are numbered from left to right starting with 1, with group 0 representing the entire pattern.

Regular expression patterns such as "(a)*" may match the empty string. In this case an empty string is returned.

Call format

var s = rm.Group( [ group ] )

Return value

Substring of matched part or forward reference group

argument

integer group

The number of the forward reference group to get

If omitted, it will be 0 (entire pattern).

exception

Func 4

Invalid argument value

Func 14

Value cannot be referenced

Example of use

var m = RegexPattern.Compile("Biz/([a-zA-Z]+)"). Matcher("Biz/Browser");
if(m.Matches()){
    print(m.Start(1), m.End(1), m.Group(1), "\n");
}

Related item

Start and End methods


RegexMatcher.LookingAt method

Explanation

Matches the regular expression pattern from the beginning of the input string.

It does not have to match the entire input string.

If the match is successful, you can use the Start , End , and Group methods to get more information.

Call format

var b = rm.LookingAt()

Return value

$TRUE if it matches the regular expression pattern from the beginning of the input string, $FALSE otherwise

argument

None

exception

None

Example of use

var m = RegexPattern.Compile("Biz/([a-zA-Z])+"). Matcher("Biz/Browser, Biz/Designer");
if(m.LookingAt()){
    print(m.Start(1), m.End(1), m.Group(1), "\n");
}

Related item

Start , End , Group methods


RegexMatcher.Matches method

Explanation

Matches the entire input string with the regular expression pattern.

If the match is successful, you can use the Start , End , and Group methods to get more information.

Call format

var b = rm.Matches()

Return value

$TRUE if the entire input string exactly matches the regular expression pattern, $FALSE otherwise

argument

None

exception

None

Example of use

var m = RegexPattern.Compile("Biz/([a-zA-Z] +)"). Matcher("Biz/Browser");
if(m.Matches()){
    print(m.Start(1), m.End(1), m.Group(1), "\n");
}

Related item

Start , End , Group methods


RegexMatcher.ReplaceAll method

Explanation

Replaces all occurrences of the regular expression pattern with the specified string.

Call format

var s = rm.ReplaceAll( replacement )

Return value

Resulting string replaced

argument

String replacement

Replacement string

You can use a reference to the forward reference group by "$n" .

exception

Func 14

Value cannot be referenced

Example of use

var p = RegexPattern.Compile("Biz/([a-zA-Z]+)");
var m = p.Matcher("Biz/Browser, Biz/Designer");
print(m.ReplaceAll("ABC Biz/$1"),"\n");

Related item

ReplaceFirst method


RegexMatcher.ReplaceFirst method

Explanation

Replaces the first occurrence of the regular expression pattern with the specified string.

Call format

var s = rm.ReplaceFirst( replacement )

Return value

Resulting string replaced

argument

String replacement

Replacement string

You can use a reference to the forward reference group by "$n" .

exception

Func 14

Value cannot be referenced

Example of use

var p = RegexPattern.Compile("Biz/([a-zA-Z]+)");
var m = p.Matcher("Biz/Browser, Biz/Designer");
print(m.ReplaceFirst("ABC Biz/$1"),"\n");

Related item

ReplaceAll method


RegexMatcher.Reset method

Explanation

Reset the regular expression engine.

Resetting the regular expression engine initializes the current position of the Find method, the additional position of the AppendReplacement method, match information that can be obtained using the Start , End , and Group methods.

You can also set a new input string by specifying input .

Call format

var ret = rm.Reset( [ input ] )

Return value

Its own RegexMatcher object

argument

String input

New input string

If omitted, the input string is unchanged.

exception

None

Example of use

var m = RegexPattern.Compile("(Biz)/([a-zA-Z]+)"). Matcher("Biz/Browser, PrintStream");
while(m.Find()){
    print(m.Group(1), m.Group(2), "\n");
}
m.Reset("Biz/Browser, Biz/Designer");
print("---- Reset ---- \n");
while(m.Find()){
    print(m.Group(1), m.Group(2), "\n");
}

Related item


RegexMatcher.Start method

Explanation

Gets the start index of the matched result.

You can specify group to get the starting index of the substring that is forward referenced by the group of regular expression patterns.

The groups are numbered from left to right starting with 1, with group 0 representing the entire pattern.

Regular expression patterns such as "(a)*" may match the empty string. In this case -1 is returned.

However, if you specify 0 for the group number, 0 is returned.

Call format

var s = rm.Start( [ group ] )

Return value

The starting index of the matched part or forward reference group

argument

integer group

The number of the forward reference group to get

If omitted, it will be 0 (entire pattern).

exception

Func 4

Invalid argument value

Func 14

Value cannot be referenced

Example of use

var m = RegexPattern.Compile("Biz/([a-zA-Z]+)"). Matcher("Biz/Browser");
if(m.Matches()){
    print(m.Start(1), m.End(1), m.Group(1), "\n");
}

Related item

End , Group methods


RegexMatcher event

API version 6

Event

There are no events defined in the RegexMatcher class.

Class overview

Base class events


RegexPattern class

Object
 | RegexPattern

It is a class that holds the regular expression pattern.

Compile the specified regular expression by Compile static method and generate RegexPattern object.
The created RegexPattern object is used to create an object of the RegexMatcher class, which is a regular expression engine for matching any input string .

Multiple RegexMathcer objects can be created from one RegexPattern object. Each RegexMatcher object shares the same regular expression pattern.

Default property and ValueType

The default property is Pattern . The ValueType specification is invalid.

Typical usage

1. The Compile static method compiles the regular expression and creates a RegexPattern object.

2. The Matcher method of the RegexPattern object generated in 1 creates a RegexMatcher object that matches the regular expression pattern with the input string.

3. Match with the Matches method, Find method, etc. of the RegexMatcher object generated in 2.

/* Compile the regular expression */
var p = RegexPattern.Compile("Biz/([a-zA-Z]+)");
/* Set the input string and generate a regular expression engine */
var m = p.Matcher("Biz/Browser, Biz/Designer");

/* Perform a partial match search */
while(m.Find()){
/* Show the whole matching part */

print(m.Group());
/* Show the first forward reference group */
print("[", m.Group(1), "] ","\n");
}

/* Exact match */
print("Matches:", m.Matches(), "\n");

/* Match from the beginning */
print("LookingAt:", m.LookingAt(), "\n");

----- Execution result -----
Biz/Browser [ Browser ]
Biz/Designer [ Designer ]
Matches: 0
LookingAt: 1

Regular expression syntax summary

The regular expression class uses ECMAScript syntax.

Meta character
\ | Quote the metacharacter immediately after.
^ | Matches the beginning of a line. Start of line in multiline mode.
. | Matches any character (except line breaks).
$ | Matches the end of a line. End of line in multiline mode.
| | Choice
() | Grouping
[] | Character class

Metacharacters available in a character class
\ | Quote the metacharacter immediately after.
^ | Denies a class only when used as the first letter.
- | Range of characters

Binary character
\t | tab
\v | Vertical tab
\n | new line
\r | return
\f | New Page
\cletter | Control character
\0 | null
\int | Back reference
\nhhhh | Quaternary character
\xhh | Hexadecimal character

General character
\w | Matches the "word" character (alphabet, number, "_")
\W | Matches anything that is not a word character
\s | Matches white space characters
\S | Matches a non-blank character
\d | Matches a number
\D | Matches a non-digit

Position specifier
\b | Matches a word boundary
\B | Matches outside the word boundaries

Character class [:class:]
alnum | Alphanumeric
alpha | English letters
blank | Blank or tab
cntrl | Control character
digit | Decimal digit
d | Decimal digit
graph | Excludes representable character spaces
lower | Lowercase letters
print | Displayable characters
punct | Punctuation character
space | Space character
upper | Uppercase letters
xdigit | Hexadecimal digit
w | "Word" character (alphabet, number, "_")
s | White space character

Quantifier
* | Matches zero or more times
+ | Matches one or more repeats
? | Matches zero or one repetition
{n} | matches n times
{n,} | Matches at least n times
{n, m} | matches between n and m times


RegexPattern property

API version 6

Property

The following properties are defined in the RegexPattern class.

API | name | access | Type | Explanation
6 | Flags | R | integer | Match flag specified at compile time
6 | Pattern | R | String | Source regex string

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


RegexPattern.Flags property

Match flag specified at compile time.

This property is read only.

For details , refer to the flags argument of the Compile method .


RegexPattern.Pattern property

The regular expression string to compile from.

This property is read only.


RegexPattern method

API version 6

Method

The following methods are defined in the RegexPattern class.

API | name | Explanation
6 | GetPattern | Gets the regular expression string to compile
6 | Matcher | Creates a RegexMatcher object that matches the regular expression pattern with the input string
6 | Split | Gets a String array that is split based on a match between the regular expression pattern and the input string

Static method

API | name | Explanation
6 | Compile | Compiles a regular expression to produce a RegexPattern object
6 | Matches | Matches the specified regular expression and string

Class overview

Base class methods


RegexPattern.GetPattern method

Explanation

Gets the regular expression string to compile.

Call format

var pattern = rp.GetPattern()

Return value

Source regex string

argument

None

exception

None

Example of use

var p = RegexPattern.Compile("Biz/([a-zA-Z]+)", 0);
print(p.GetPattern(), "\n");

Related item

Pattern property

Compile method


RegexPattern.Matcher method

Explanation

Creates a RegexMatcher object that matches the regular expression pattern with the input string.

Call format

var rm = rp.Matcher( input )

Return value

RegexMatcher object

argument

String input

The input string to match

exception

None

Example of use

var p = RegexPattern.Compile("Biz/([a-zA-Z]+)");
var m = p.Matcher("Biz/Browser");
if(m.Matches()){
    print(m.Group(1), "\n");
}

Related item

RegexMatcher class


RegexPattern.Split method

Explanation

Gets a String array that is split based on a match between the regular expression pattern and the input string.

An example of dividing "a-/cde/f--" is shown below.

Regular expressions | limit | result
/ | 2 | "a--", "cde/f--"
/ | 10 | "a--", "cde", "f--"
/ | -1 | "a--", "cde", "f--"
- | 5 | "a", "", "/cde/f", "", ""
- | -2 | "a", "", "/cde/f", "", ""
- | 0 | "a", "", "/cde/f"

Call format

var arr = rp.Split( input [, limit ])

Return value

An array of String objects that split the input based on the match

The last element of the array contains the string after the last matched position.

argument

String input

The input string to match

integer limit

Maximum number of divisions

If greater than 0, the length of the returned array will be less than or equal to limit .

For negative values, the array length is unlimited.

If 0, the length of the array is unlimited, but trailing empty strings are discarded. If omitted, it will be 0.

exception

None

Example of use

var p = RegexPattern.Compile("/");
var arr = p.Split("Biz/Browser");
for (var i = 0; i <arr.length; i++){
    print(arr[i], " \ n");
}

Related item


RegexPattern.Compile method

Explanation

Compile the regular expression to produce a RegexPattern object.

This method is a static method. Can be called without creating an object.

Call format

var rp = RegexPattern.Compile( regex [, flags ])

Return value

RegexPattern object

argument

String regex

Regular expressions

integer flags

Match flag

Specify a combination of the following values.

constant | value | Explanation
RegexPattern.CASELESS RegexPattern.CASE_INSENSITIVE | 1 | Performs case-insensitive matching

If omitted, it is 0 (no specification).

exception

Func 4

Invalid argument value

Example of use

var p = RegexPattern.Compile("Biz/([a-zA-Z]+)", RegexPattern.CASELESS);
var m = p.Matcher("Biz/Browser");
if(m.Matches()){
    print(m.Group(1), "\n");
}

Related item

Matches method


RegexPattern.Matches method

Explanation

Matches the specified regular expression and input string.

This method is a static method. Can be called without creating an object.

You can use this method to match without going through the steps of creating an object.

The next two sentences give similar results.

RegexPattern.Matches("[0-9]+/[0-9]+/[0-9]+", "2011/11/28");
RegexPattern.Compile("[0-9]+/[0 -9]+/[0-9]+").Matcher("2011/11/28").Matches();

If you use the same regular expression repeatedly, it is more efficient to create an object with the Compile method than to call this method every time.

Call format

var b = RegexPattern.Matches( regex , input [, flags ])

Return value

$TRUE if matched, $FALSE otherwise

argument

String regex

Regular expressions

String input

The input string to match

integer flags

Match flag

See the Compile method for details.

If omitted, it is 0 (no specification).

exception

Func 4

Invalid argument value

Example of use

If(RegexPattern.Matches("[0-9]+/[0-9]+/[0-9]+", "2011/11/28")){
    //.MessageBox("matched");
}

Related item

Compile and Matcher methods


RegexPattern event

API version 6

Event

There are no events defined in the RegexPattern class.

Class overview

Base class events


String class

Object
 | NetObject
 |  | String

A class that holds a string. There is no limit to the length of the character string that can be stored.

Unicode is used for the character code.

Mobile compatible mode
Character code is handled as multi-byte character (Shift-Jis).
When displaying a character string on the screen such as Label class and TextBox class, convert it to Unicode and display it on the screen.

"UString" * 1 as an alias for the String class

For compatibility with other Biz / Browsers, if "UString" is used as the class name, it is considered that the String class has been specified.

This specification can be made in the same way where a normal class name can be specified, such as an object definition expression, new expression, ValueType specification, and static method call of a class.

/* --- code example --- */
var s = new UString("abc"); /* Create a String object. */
print(s.ClassName); /* "String" is displayed */
TextBox:UString textBox1{/* It is assumed that String class is specified for ValueType */
    ...
}

Default property and ValueType

The default property is Value . The ValueType specification is invalid.

Change history
* 1 Added from API version 9.


String property

API version 4

Property

The following properties are defined in the String class.

API | name | access | Type | Explanation
4 | Length | R | integer | Length of string
4 | Value | CRW | String | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


String.Length property

Indicates the number of characters in the stored character string.

Mobile compatible mode
It is calculated as byte units (1 half-width character, 2 full-width characters) instead of character units.


String.Value property

The value of the String object.


String method

API version 4

Method

The following methods are defined in the String class.

API | name | Explanation
4 | ( Constructor ) | Initialize the String object
4 | CharAt | Returns the character at the specified position
4 | CharCodeAt | Returns the character code of the character at the specified position
4 | Concat | Concatenate strings
4 | EqualsIgnoreCase | Compare strings case insensitive
4 | IndexOf | Search for a string from the beginning
4 | LastIndexOf | Search for strings from the back
4 | LocaleCompare | Compare strings based on locale
4 | Replace | Replace string
4 | Slice | Cut out a part of the character string
4 | Split | Split the string
4 | Substring | Cut out a part of the character string
4 | ToLocaleLowerCase | Converts uppercase to lowercase based on locale
4 | ToLocaleUpperCase | Converts lowercase letters to uppercase letters based on locale
4 | ToLowerCase | Converts uppercase letters to lowercase letters
4 | ToString | String Returns the string of the object as is
4 | ToUpperCase | Converts lowercase letters to uppercase
4 | Trim | Removes white space from strings
4 | ValueOf | Returns the value of a String object

Static method

API | name | Explanation
4 | FromCharCode | Create a string from the character code

Class overview

Base class methods


String constructor

Explanation

Initializes the String object.

Call format

var str = new String([ text_1 [, text_2 [,…]]])

Return value

String object

argument

String text_n

Value to initialize

If you specify more than one, it will be initialized with the concatenated character string.

exception

None

Example of use

var str = new String("ABC", "DEF");
print(str, "\n");

Related item


String.CharAt method

Explanation

Returns the character at the specified position.

Mobile compatibility mode
It is calculated as byte units (1 half-width character, 2 full-width characters) instead of character units.

Call format

var c = str.CharAt( indx )

Return value

Returns the character at the specified position as a String.

argument

integer indx

Position of character to retrieve

Specify a number starting from 0.

exception

Func-4

Illegal argument

Example of use

var str = new String("ABCDEF");
print(str.CharAt(3), "\n");

Related item

CharCodeAt method


String.CharCodeAt method

Explanation

Returns the character code of the character at the specified position.

Mobile compatibility mode
It is calculated as byte units (1 half-width character, 2 full-width characters) instead of character units.

Call format

var n = str.CharCodeAt( indx )

Return value

Returns the Unicode character code as an integer value.

argument

integer indx

Position of the character to be extracted

Specify a number starting from 0.

exception

Func-4

Illegal argument

Example of use

var str = new String("ABCDEF");
print(str.CharCodeAt(3), "\n");

Related item

CharAt method


String.Concat method

Explanation

Concatenates the string specified in the argument to the original string.

This method updates the value of the String object.

Call format

var s = str.Concat ( text_1 [, text_2 [,…]])

Return value

Concatenated string

argument

String text_n

String to concatenate

If you specify more than one, all will be concatenated.

exception

Func-4

Illegal argument

Example of use

var str = new String("ABC");
print(str.Concat ("DEF", "GHI"), "\n");
print(str, "\n");

Related item


String.EqualsIgnoreCase method

Explanation

Compares strings without regard to case.

Call format

var ret = str.EqualsIgnoreCase( s )

Return value

Returns $TRUE if matched, $FALSE if not matched.

argument

String s

The string to compare

exception

None

Example of use

var str = new String("ABC");
var arr = new Array("ABC", "abc", "xyz");
for(var n in arr){
    if(str.EqualsIgnoreCase(arr[n])){
        print(arr[n], "\n");
    }
}

Related item

LocaleCompare method


String.IndexOf method

Explanation

Searches the specified string after pos and returns the first found position.

Mobile compatibility mode
It is calculated as byte units (1 half-width character, 2 full-width characters) instead of character units.

In this method, the search is performed without being aware of the character type of the target character string. Use the find function to search for double-byte characters in the target string .

Call format

var n = str.IndexOf ( find [, pos ])

Return value

Returns a 0-based number that indicates the location found. Returns -1 if not found.

argument

String find

Character string to search

integer pos

Start position of search range

Specify a number starting from 0. If omitted, the search starts from the beginning.

exception

Func-4

Illegal argument

Example of use

var str1 = new String("abcdefg abcdefg");
print(str1.IndexOf("cd"), "\n");

/* When the target character string contains double-byte characters */
var str2 = new String("1-1 Chiyoda, Chiyoda-ku, Tokyo");
print(find(str2, "1", 0), "\n");

Related item

LastIndexOf method

find function


String.LastIndexOf method

Explanation

Searches the specified string up to pos and returns the last found position.

Mobile compatibility mode
It is calculated as byte units (1 half-width character, 2 full-width characters) instead of character units.

Call format

var n = str.LastIndexOf ( find [, pos ])

Return value

Returns a 0-based number that indicates the location found. Returns -1 if not found.

argument

String find

Character string to search

integer pos

End position of search range

Specify a number starting from 0. If omitted, the search will be performed to the end.

exception

Func-4

Illegal argument

Example of use

var str1 = new String("abcdefg abcdefg");
print(str1.LastIndexOf("cd"), "\n");

/* When the target character string contains double-byte characters */
var str2 = new String("1-1 Chiyoda, Chiyoda-ku, Tokyo");
var last = -1;
while (true) {
    var idx = find(str2, "1", last + 1);
    if(idx < 0) {
        break;
    }
    last = idx;
}
print(last, "\n");

Related item

IndexOf method

find function


String.LocaleCompare method

Explanation

Compares strings based on locale.

The current implementation is byte-by-byte comparison regardless of locale.

Call format

var ret = str.LocaleCompare ( comp )

Return value

Returns 1 if greater than comp .

Returns -1 if less than comp .

Returns 0 if equal to comp .

argument

String comp

Character string to be compared

exception

Func-4

Illegal argument

Example of use

var str = new String("abcdefg");
print(str.LocaleCompare("abcdefg"), "\n"); /* Returns 0 */
print(str.LocaleCompare("ABC"), "\n"); /* Returns 1 */
print(str.LocaleCompare("bcd"), "\n"); /* Returns -1 */

Related item

EqualsIgnoreCase method


String.Replace method

Explanation

Searches for the specified string and replaces everything found with another string.

This method updates the value of the String object.

Call format

var s = str.Replace ( search , replace )

Return value

Character string as a result of replacement

argument

String search

Character string to search

String replace

String to replace

exception

Func-4

Illegal argument

Example of use

var str = new String("abcdefg");
print(str.Replace ("cde", "CDE"), "\n");
print(str, "\n");

Related item


String.Slice method

Explanation

Cut out a part of the character string.

Difference from Substring method

length when the string length, Start If you specify a negative value to the length Tasu Start will be treated as. If you specify a negative value for end , it is processed as length + end .

Mobile compatibility mode
It is calculated as byte units (1 half-width character, 2 full-width characters) instead of character units.

Call format

var s = str.Slice ( start [, end ] )

Return value

Cut out character string

argument

integer start

Start position to cut out

Specify a number starting from 0.

integer end

End position to cut out (cut out to the character before the specified position)

Specify a number starting from 0. If omitted, it will be cut out to the end of the character string.

exception

Func-4

Illegal argument

Example of use

var str1 = new String("abcdefg");
print(str1.Slice(2, 4), "\n");

/* When the target character string contains double-byte characters */
var str2 = new String("1-1 Chiyoda, Chiyoda-ku, Tokyo");
print(mid(str2, 3, 4), "\n");

Related item

Substring method

mid function


String.Split method

Explanation

Divides the string by the specified characters and returns it as an array.

Call format

var arr = str.Split ( separator [, limit ])

Return value

String array containing each element of the divided string (does not include the delimiter)

argument

String separator

Delimiter to split a string

integer limit

Maximum number of splits

If omitted, it will be split to the end of the string.

exception

Func-4

Illegal argument

Example of use

var str = new String("abc-def-ghi");
var arr = str.Split("-");
for (var n = 0; n < arr.Length; n++) {
    print(arr[n], "\n");
}

Related item


String.Substring method

Explanation

Cut out a part of the character string.

Difference from Slice method

The smaller value of start and end is the start position of the character string to be acquired. (Substring (0, 3) and Substring (3, 0) have the same result)

If a negative value is specified for the argument, it is replaced with 0.

Mobile compatibility mode
It is calculated as byte units (1 half-width character, 2 full-width characters) instead of character units.

Call format

var s = str.Substring ( start , end )

Return value

Cut out character string

argument

integer start

Start position to cut out

Specify a number starting from 0.

integer end

End position to cut out (cut out to the character before the specified position)

Specify a number starting from 0.

exception

Func-4

Illegal argument

Example of use

var str = new String("abcdefghi");
print(str.Substring(1, 2), "\n");

/* When the target character string contains double-byte characters */
var str2 = new String("1-1 Chiyoda, Chiyoda-ku, Tokyo");
print(mid(str2, 3, 4), "\n");

Related item

Slice method

mid function


String.ToLocaleLowerCase method

Explanation

Converts uppercase letters in strings to lowercase letters based on the locale.

In the current implementation, it is synonymous with the ToLowerCase method.

This method updates the value of the String object.

Call format

var s = str.ToLocaleLowerCase()

Return value

Converted string

argument

None

exception

None

Example of use

var str = new String("abcdEFGH");
print(str.ToLocaleLowerCase(), "\n");
print(str, "\n");

Related item

ToLowerCase method


String.ToLocaleUpperCase method

Explanation

Converts lowercase letters in strings to uppercase based on the locale.

In the current implementation, it is synonymous with the ToUpperCase method.

This method updates the value of the String object.

Call format

var s = str.ToLocaleUpperCase()

Return value

Converted string

argument

None

exception

None

Example of use

var str = new String("abcdEFGH");
print(str.ToLocaleUpperCase(), "\n");
print(str, "\n");

Related item

ToUpperCase method


String.ToLowerCase method

Explanation

Converts uppercase letters in the string to lowercase letters.

This method updates the value of the String object.

Call format

var s = str.ToLowerCase()

Return value

Converted string

argument

None

exception

None

Example of use

var str = new String("abcdEFGH");
print(str.ToLowerCase(), "\n");
print(str, "\n");

Related item

ToUpperCase method


String.ToString method

Explanation

String Returns the string of the object as is.

Call format

var s = str.ToString()

Return value

String Object string

argument

None

exception

None

Example of use

var str = new String("ABCDEF");
print(str.ToString(), "\n");

Related item


String.ToUpperCase method

Explanation

Converts lowercase letters in the string to uppercase.

This method updates the value of the String object.

Call format

var s = str.ToUpperCase()

Return value

Converted string

argument

None

exception

None

Example of use

var str = new String("abcdEFGH");
print(str.ToUpperCase(), "\n");
print(str, "\n");

Related item

ToLowerCase method


String.Trim method

Explanation

Remove spaces, tabs, line breaks, etc. from the beginning and end of the character string.

You can specify the character to be removed by specifying the argument. If the argument is omitted, tabs, half-width spaces, and line breaks are targeted. (Double-byte spaces are not applicable)

Unlike the trim function, it does not change anything other than before and after the character string.

This method updates the value of the String object.

Call format

var s = str.Trim([ chars ])

Return value

Character string with blanks removed

argument

String chars

The character to remove

Specify a character string that contains the characters you want to remove. If omitted, tabs, half-width spaces, and line breaks are targeted.

exception

None

Example of use

var str = new String(" ABC\tDEF\n ");
print(str.Trim(" \t\n  "), "\n");
print(str, "\n");

Related item

trim function


String.ValueOf method

Explanation

Returns the value stored in the String object.

Call format

var s = str.ValueOf()

Return value

String object value

argument

None

exception

None

Example of use

var str = new String("ABCDEF");
print(str.ValueOf(), "\n");

Related item


String.FromCharCode method

Explanation

Create a character string from the character code.

This method is a static method. You can call it without creating an object.

Mobile compatibility mode
code specified in the Mobile compatibility mode argument is assumed to be a multibyte character, and the character is calculated for each byte.

Call format

var str = String.FromCharCode ( code_1 [, code_2 [,… [, code_n ]]])

Return value

Created string

argument

integer code_n

Character code

Android version
Specify the UTF-32 character code for Android .

exception

None

Example of use

var str = String.FromCharCode(0x41, 0x42, 0x43);
print(str, "\n");

Related item


String event

API version 4

Event

There are no events defined in the String class.

Class overview

Base class event


Standard package

This is a standard GUI package.

class

API | name | Explanation
4 | Button | Show button
4 | CheckBox | Show checkbox
4 | CheckItem | Defines the choices for the CheckBox class
4 | ContainerObject | The base class of a class with container functionality
4 | Dialog | Display a dialog
4 | DisplayObject | The base class of the screen display class
4 | EditBox | Displays a multi-line input edit box
4 | EditObject | The base class of the character input class
4 | FocusObject | The base class of the class that receives focus
4 | Form | Show form
4 | Label | Display character label
4 | ListBox | Show list box
4 | ListItem | Defines the choices for the ListBox class
4 | OptionButton | Show options button
4 | OptionItem | Defines the options for the OptionButton class
4 | PulldownItem | Defines the choices for the PulldownList class
4 | PulldownList | Show pull-down list
4 | Root | It is a class corresponding to the window of Biz/Browser itself
4 | TextBox | Show text box


Button class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | Button

A class that displays buttons. The value of the Title property is displayed on the surface.

If the characters do not fit within the right edge of the display range, a line break will occur and the characters will be displayed on the next line. Word wrap is taken into consideration for the line break position, and if no word break is found in alphabetic characters, no line break is performed.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
SPACE | Press the button

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

Nothing in particular


Button property

API version 4

Property

iOS Android Windows

The following properties are defined in the Button class.

API | name | access | Type | initial value | Explanation
4 | AltKey | CR | integer | $STD | Alternate key to raise Touch event
16 | CornerRadius | CRW | integer | 0 | Radius of rounded corners
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | 10 | font size
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
HT (10) | NoPrefix | CRW | boolean | $FALSE | Mode that does not interpret &
23 | TapEventMode | CRW | integer |  | How events fired on tap are added to the event queue
4 | Title | CRW | String |  | Characters to be displayed on the button
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Button.AltKey property

Specifies an alternate key that raises a Touch event on the keyboard without tapping a button.

For the values ​​that can be specified for the AltKey property, refer to Key specification .

For the priority when multiple meanings are assigned to one key operation, refer to Priority in key operation .


Button.CornerRadius property

iOSAndroidWindows

Specifies the radius of rounded corners.

If a value greater than 0 is specified, the shape of the button will be a rectangle with rounded corners. The value of the property will be the radius of the rounded corners.

Android version
If the value of the CornerRadius property is large, the text specified in the Title property may protrude from the button.

If the value of the property is greater than half the width or height of the button, it will be rounded to half the value of the short side.

If the HorizontalScale or VerticalScale property is specified in the parent Form, the value of the property will be applied after scaling up or down.

If the value of the property is less than or equal to 0, the design will be normal.


FontFace property

Specifies the font decoration attributes.

Specify a combination of the following values.

Bold, italic, and combinations are only applicable if the device has the appropriate font.

Android version
-If a monospaced (fixed pitch) font is specified, the FontKind property value is ignored.
・ Underline is not supported.

constant | value | Explanation
$STD | 0 | standard
$BOLD | 1 | Bold
$ITALIC | 2 | Italic
$UNDER | 4 | Underline
$FIXED | 8 | Monospaced (fixed pitch) font

$BOLD + $ITALIC is displayed in bold and italics.

If $FIXED is not specified, it is a proportional font.


FontKind property

Specify the font type.

You can specify $STD or $FONT1 as the font type.

$STD is a Gothic font and $FONT1 is a Mincho font.

The font type setting is applied only when the corresponding font exists in the terminal.

constant | value | Explanation
$STD | 0 | Gothic
$FONT1 | 1 | Tomorrow morning


FontSize property

Specifies the font size with a number of points in the range 0-100. If 0 is specified, it will be displayed with the initial value of 10 points.

Negative values ​​cannot be set.


Button.HorizontalAlign property

Performs horizontal alignment. $STD is centered.

constant | value | Explanation
$STD | 0 | Same as $CENTER
$LEFT | 1 | Left alignment
$CENTER | 2 | Centered
$RIGHT | 3 | Right alignment


NoPrefix property

Specifies whether to display the "&" symbol of the character to be displayed on the screen as it is on the screen.

If you specify $TRUE, the "&" symbol is displayed as it is.

Specifying $FALSE removes the "&" symbol.

See the display string and "&" symbol for the behavior of the "&" symbol.


Button.TapEventMode property

iOSAndroidWindows

Specifies how events fired on tap are added to the event queue.

Touch event is applicable.

It does not affect events fired by the Object.PostEvent method.

Specify a combination of the following values. If omitted, the value will be Object.POST_DEFAULT.

constants | value | Explanation
Object.POST_DEFAULT | 0 | Add the event to the back of the event queue (works as before).
Object.POST_FRONT | 1 | Add the event to the head of the event queue. Specify if you want the event to occur immediately.
Object.POST_UNIQUE | 2 | If the same type of event exists in the event queue with the same originating object, the event is not added to the queue.


Button.Title property

The character to be displayed on the button.


Button.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.

The characters displayed on the button are set with the Title property.


Button method

API version 4

Method

iOS Android Windows

There are no methods defined in the Button class.

Class overview

Base class methods


Button event

API version 4

Event

iOS Android Windows

The following events are defined in the Button class.

API | name | Explanation
4 | RClicked | Occurs when long tapped
4 | Touch | Occurs when a button is selected

Class overview

Base class event


RClicked event

It occurs when a long tap operation is performed.

The following child objects are added to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.
Number | xPos | X coordinate of mouse pointer
Number | yPos | Y coordinate of mouse pointer

Android version
xPos and yPos are not included in RClicked event object of Button class.

Example of use

Function OnRClicked (e) {
    MessageBox (strf ("Long tapped on (%1,%2)", e.xPos, e.yPos));
}


Button.Touch event

This is an event that occurs when the button is pressed.


CheckBox class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | CheckBox

This class displays a check box that allows you to select any number from multiple choices.

The CheckBox class works in tandem with the CheckItem class.

To set the data to be displayed as a choice, you need to place the CheckItem class or its derived class objects in the structure defined below the CheckBox object.

Object structure

Screen display example

Default properties and ValueType

The default property is Value . The value type specification is invalid.

Precautions when scaling

Nothing in particular


CheckBox Property

API version 4

Property

iOS Android Windows

The following properties are defined in the CheckBox class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | FgColor | CRW | integer | $STD | Text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | 10 | font size
24 | Scalable | CR | boolean | $FALSE | Whether the checkbox is scalable or not
4 | Scroll | CR | integer | $AUTO | Scroll bar display control
4 | Value | CRW | integer |  | Selected position

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


BgColor property

Specify the background color with a color constant .


Border property

When $TRUE is set, the frame of the display area of ​​the object is displayed.


BorderColor property

iOSAndroidWindows

Specify the border color with color constant.

If $STD is specified, the border will be displayed in the default color.

The default value is $STD.


FgColor property

Specify the text color with a color constant .


CheckBox.Scalable property

iOSAndroidWindows

If $TRUE, the checkbox size is scaled according to the Form.HorizontalScale and Form.VerticalScale properties. VerticalScale property.

If $FALSE, no scaling is performed.

Default value is $FALSE.

The checkboxes are scaled while maintaining the aspect ratio. If the values of the Form.HorizontalScale and Form.VerticalScale properties are different, the smaller value is used for the scaling factor.


Scroll property

Controls the display of the scroll bar and whether scrolling is possible.

Android version
scroll bar is not displayed.
This property can only control whether you can scroll beyond the visible range.

constant | value | Explanation
$AUTO | 0 | Automatic display The scroll bar is automatically displayed or hidden according to the size of the displayed content.
$NONE | 1 | None It is not always displayed regardless of the size of the displayed content. It is not possible to scroll to the contents beyond the display range.
$STATIC | 2 | Fixed display Always display regardless of the size of the displayed content.


CheckBox.Value property

The array number of the last selected item.

-1 indicates the unselected state.

Get the selected status of each option with the CheckItem.Selected property.


CheckBox method

API version 4

Method

iOS Android Windows

The following methods are defined in the CheckBox class.

API | name | Explanation
24 | ResetCheckedImage | Discard the image set by the SetCheckedImage method
24 | ResetUncheckedImage | Discards the image set by the SetUncheckedImage method
24 | SetCheckedImage | Set the image to be displayed on the checkbox in the checked state
24 | SetUncheckedImage | Set the image to be displayed on the checkbox in the unchecked state

Class overview

Base class methods


CheckBox.ResetCheckedImage method

Explanation

The image set by the SetCheckedImage method is discarded.

Call format

CheckBox1.ResetCheckedImage()

Return value

None

argument

None

exception

None

Example of use

CheckBox1.ResetCheckedImage();

Related item

SetCheckedImage method


CheckBox.ResetUncheckedImage method

Explanation

The image set by the SetUncheckedImage method is discarded.

Call format

CheckBox1.SetUncheckedImage()

Return value

None

argument

None

exception

None

Example of use

CheckBox1.SetUncheckedImage();

Related item

SetUncheckedImage method


CheckBox.SetCheckedImage method

Explanation

Set the image to be displayed on the checkbox in the checked state.

Call format

Checkbox1.SetCheckedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

CheckBox1.SetCheckedImage(ImageList1.GetImage(0));
CheckBox2.SetCheckedImage("img/sample.png");

Related item

ResetCheckedImage method

Image , ImageList class


CheckBox.SetCheckedImage method

API version 24

CheckBox.SetUncheckedImage method

Explanation

Set the image to be displayed on the checkbox in the unchecked state.

Call format

CheckBox.SetUncheckedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

CheckBox1.SetUncheckedImage(ImageList1.GetImage(0));
CheckBox2.SetUncheckedImage("img/sample.png");

Related item

ResetUncheckedImage method

Image , ImageList class


CheckBox event

API version 4

Event

iOS Android Windows

There are no events defined in the CheckBox class.

Class overview

Base class event


CheckItem class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | CheckItem

A class that defines the choices of the CheckBox class. Be sure to array and use it as a child object of CheckBox class.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
SPACE | Invert selection

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

◆ If you want to scale the select button, set the CheckBox.Scalable property to $TRUE.


CheckItem property

API version 4

Property

iOS Android Windows

The following properties are defined in the CheckItem class.

API | name | access | Type | initial value | Explanation
4 | Selected | CRW | boolean | $FALSE | Item selection status
4 | Title | CRW | String |  | The string displayed in the choices
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


CheckItem.Selected property

The item is selected.

It will be $TRUE if checked and $FALSE if unchecked.


CheckItem.Title property

The character to be displayed as a choice.


CheckItem.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.

The selected state of the choice can be specified by the Selected property, and the character to be displayed as the choice can be specified by the Title property.


CheckItem method

API version 4

Method

iOS Android Windows

There are no methods defined in the CheckItem class.

Class overview

Base class methods


CheckItem event

API version 4

Event

iOS Android Windows

The following events are defined in the CheckItem class.

API | name | Explanation
4 | Touch | Occurs when the checkbox selection status is changed

Class overview

Base class event


CheckItem.Touch event

This event occurs when the selected state of the check box is changed.

It occurs regardless of the operation from the screen or the operation from the script.

Note

In the handler of the event that occurred in CheckItem class, do not use the Value property of CheckBox class, which is the parent object, to refer to the selected item number . (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (CheckItem object) of the Event object passed as an argument of the event handler . For the selected state of the item, refer to the Selected property from the From property .


ContainerObject class

Object
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject

It is a base class of a class that has a container function for placing objects such as buttons and text boxes.

The ContainerObject class is a virtual class and cannot instantiate itself.


ContainerObject property

API version 4

Property

iOS Android Windows

The following properties are defined in the ContainerObject class.

API | name | access | Type | initial value | Explanation
HT (10) | NextTabKey | CRW | integer | $STD | Keys to move keyboard focus to the next object
HT (10) | PrevTabKey | CRW | integer | $STD | A key to move keyboard focus to the previous object

Class overview

Base class properties


ContainerObject.NextTabKey property

If the object managed as a child has keyboard focus, pressing the key specified in the NextTabKey property moves the keyboard focus to the next object.

If the child object has its own focus move key, the child object specification takes precedence.

Also, if the key specified in the NextTabKey property is used as a unique function of the child object, the processing of the child object is prioritized and the focus is not moved.

For the values ​​that can be specified for the NextTabKey property, refer to Key specification .

For the priority when multiple meanings are assigned to one key operation, refer to Priority in key operation .


ContainerObject.PrevTabKey property

If the object managed as a child has keyboard focus, pressing the key specified in the PrevTabKey property moves the keyboard focus to the previous object.

If the child object has its own focus move key, the child object specification takes precedence.

Also, if the key specified in the PrevTabKey property is used as a unique function of the child object, the processing of the child object is prioritized and the focus is not moved.

For the values ​​that can be specified for the PrevTabKey property, refer to Key specification .

For the priority when multiple meanings are assigned to one key operation, refer to Priority in key operation .


ContainerObject method

API version 4

Method

iOS Android Windows

There are no methods defined in the ContainerObject class.

Class overview

Base class methods


ContainerObject event

API version 4

Event

iOS Android Windows

There are no events defined in the ContainerObject class.

Class overview

Base class event


Dialog class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | Dialog

A class that displays a dialog.

Dialogs are application modal and you cannot interact with other windows until you close them.

The Dialog object Form you can create an object as one Dakeko object. Create other display objects as child objects of the Form object rather than directly under the Dialog object.

Dialog objects belong to the hierarchy as child objects of other display objects, but they appear as visually separate windows.

Specification of X and Y properties is not supported. The dialog is always centered on the screen.

If an area outside the dialog is tapped, the dialog will be closed. If you want to control the closing behavior, please do so in the Close event.

Screen display example

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

Nothing in particular


Dialog property

API version 4

Property

iOS Android Windows

The following properties are defined in the Dialog class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CR | boolean | $FALSE | Display of frame
8 | Opacity | CRW | Number | 1.0 | Dialog transparency
4 | Title | CRW | String |  | Characters to be displayed in the title bar
6 | TitleBar | CR | boolean | $TRUE | Show / hide title bar
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Dialog.Opacity property

Specify the transparency of the dialog.
Specify in the range of 0.0 (transparent) to 1.0 (opaque).

The initial value is 1.0 (opaque).

Android version
a value less than 1.0 is specified, the grayed out part at the back of the dialog will be disabled.
Also, the grayed-out part is reflected only in the dialog displayed in the foreground.


Dialog.Title property

The character to display in the title bar of the dialog.


Dialog.TitleBar Property

Specifies whether to display the dialog title bar.

The initial value is $TRUE.


Dialog.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


Dialog method

API version 4

Method

iOS Android Windows

There are no methods defined in the Dialog class.

Class overview

Base class methods


Dialog event

API version 4

Event

iOS Android Windows

The following events are defined in the Dialog class.

API | name | Explanation
4 | Close | Occurs when closing a dialog

Class overview

Base class event


Dialog.Close event

Occurs when you press the close button at the top right of the dialog.

If this event is caught by the event handler, the operation to close the dialog will be cancelled. If you want to close the dialog, delete the Dialog object in the event handler.

Example

Function OnClose(e){
    if(...){
        Dialog1.Delete();
    }
}

The following objects are added as child objects of the Event object.

Type | name | Explanation
Number | CauseClose | A value that describes how the Dialog is about to be closed.

CauseClose stores a constant value that indicates how it is being closed.

Android version The
following constant values ​​are stored.

Constant name | value | meaning
Dialog.CLOSE_ON_BACK_KEY | 1 | When trying to close by pressing the Android Back key
Dialog.CLOSE_ON_TOUCH_OUTSIDE | 2 | When trying to close by tapping outside the dialog (Only occurs on Android 3.x and above)

An example

Function OnClose(e){
    if(e.CauseClose == Dialog.CLOSE_ON_BACK_KEY){
        /* Close the dialog only when the "Back" button on the terminal is pressed */
        Dialog1.Delete();
    }
}


DisplayObject class

Object
 | NetObject
 |  | DisplayObject

This is the base class of the screen display class. It has the basic functions of screen display, and all screen display classes are derived from the DisplayObject class.

The DisplayObject-derived class must place the object as part of an object tree that starts with "//" ( Root object).

You cannot create an instance without being connected to the object tree with the new operator, or place it in the global namespace with import.

Also, only objects derived from the ContainerObject class are allowed as parent objects in the object tree . You cannot create an object with an object that is not derived from the ContainerObject class, such as String or Date, as a parent.

The DisplayObject class is a virtual class and cannot instantiate itself.


DisplayObject property

API version 4

Property

iOS Android Windows

The following properties are defined in the DisplayObject class.

API | name | access | Type | initial value | Explanation
4 | Active | CRW | boolean | $TRUE | Control of activity
4 | Height | CRW | integer | 100 | Vertical display size
4 | TabIndex | CR | integer | 32767 | Display and input priority
4 | Visible | CRW | boolean | $TRUE | Display control
4 | Width | CRW | integer | 100 | Horizontal display size
4 | X | CRW | integer | 0 | Horizontal display position
4 | Y | CRW | integer | 0 | Vertical display position

Properties that are added only to array objects

API | name | access | Type | initial value | Explanation
4 | Layout | CR | integer | $VERTICAL | Layout when arrayed
4 | LayoutMargin | CR | integer | 0 | Interval when arranging
4 | LayoutSpacing | CR | integer | 0 | Margins when arranging

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


DisplayObject.Active property

Setting $TRUE activates the object and reacts to user interaction.

Setting $FALSE deactivates the object and prevents it from accepting user interaction.

Objects located below the object for which $FALSE is set will not accept operations at the same time, but the display status will not change.

If you change it to $FALSE while it is in focus, the focus will move to the first focusable object in the window.


DisplayObject.Height property

Indicates the vertical display size. You can specify a value in the range 0-32767.

In some classes, the display size is automatically controlled and it may not be possible to initialize or update.


DisplayObject.TabIndex property

Indicates the display and input priority of objects.

The smaller the value, the earlier the keyboard focus will be received. Also, the smaller the value, the closer it is displayed, that is, it is placed in the foreground in the depth direction.

The order in which the keyboard focus is moved by the TabIndex property works only between objects in the same hierarchical position. You cannot specify the order of keyboard focus between objects in different hierarchies.

For arrayed objects, you cannot specify the TabIndex property for individual objects that are array elements. Focus movements within an array are always from front to back of the array elements.

Note

The TabIndex specification is invalid for DisplayObjects that are dynamically generated (Get method, Append method, etc.) other than when Form is initialized, and the movement order by tabs is set to the lowest level among DisplayObjects in the same hierarchy.


DisplayObject.Visible property

If you set $TRUE, the object will be displayed.

If you set $FALSE, the object will not be displayed.

Objects located below the object for which $FALSE is set will also be hidden at the same time.

If you change it to $FALSE while it is in focus, the focus will move to the first focusable object in the window.


DisplayObject.Width property

Indicates the horizontal display size. You can specify a value in the range 0-32767.

In some classes, the display size is automatically controlled and it may not be possible to initialize or update.


DisplayObject.X property

Indicates the horizontal display position. You can specify a value in the range -32768 to 32767.

In some classes, the display position is automatically controlled and it may not be possible to initialize or update.


DisplayObject.Y property

Indicates the vertical display position. You can specify a value in the range -32768 to 32767.

In some classes, the display position is automatically controlled and it may not be possible to initialize or update.


DisplayObject.Layout property

Specifies how to arrange each element when the object is created as an array.

constant | value | Explanation
$VERTICAL | 0 | Arrange the objects vertically. The Y property of each element of the array is invalid.
$HORIZONTAL | 1 | Arrange the objects horizontally. The X property of each element of the array is invalid.
$BLANK | 3 | I will not line up. The individual elements of the array must be explicitly coordinated by the script.
$OPTIMAL | 4 | Adjust the position according to $HORIZONTAL and the string length of the label for the optimum placement. Only CheckItem class and OptionItem class can be used.

Some classes automatically control the display position, and the Layout property setting may be invalid.


DisplayObject.LayoutMargin property

Specifies the placement interval of each element when the object is created as an array.

Some classes automatically control the display position, and the LayoutMargin property setting may be invalid.


DisplayObject.LayoutSpacing property

Specify the margin of the first element when the object is generated as an array.

Some classes automatically control the display position, and the LayoutSpasing property setting may be invalid.


DisplayObject method

API version 4

Method

iOS Android Windows

The following methods are defined in the DisplayObject class.

API | name | Explanation
4 | MessageBox | Display a message box
4 | PopupMenu | Show pop-up menu
4 | RemoveTimer | Cancel the timer
4 | ResetCursor | Returns the mouse cursor to standard
4 | SetCursor | Set the mouse cursor
4 | SetTimer | Set the timer

Class overview

Base class methods


DisplayObject.MessageBox method

Explanation

Display a message box.

An event occurs in response to pressing the button displayed in the message box, and the same value as the event is returned.

Call format

obj.MessageBox( message [, title [, flag ]])

Return value

If you select the OK button, Ok Selected will be returned.

If you select the Cancel button, Cancel Selected will be returned.

If you select the Yes button, Yes Selected is returned.

If you select the No button, No Selected is returned.

If you select the Retry button, Retry Selected is returned.

argument

String message

The character string to be displayed in the message box

String title

Message box title

integer flag

Select the type of button and icon to be displayed in the message box from the following, and specify by adding.

For example, display the OK button and the cancel button ,? To display the icon, specify as follows.

$OKCANCEL + $ICONQUESTION

If you omit the button specification, it will be the same as $OK. If the icon is omitted, it will be the same as $ICONINFOMATION.

Select one button type from the following.

constant | Buttons displayed | Events that occur
$OK | OK | OkSelected
$OKCANCEL | OK, cancel | OkSelected, CancelSelected
$YESNO | Yes, No | YesSelected, NoSelected
$RETRYCANCEL | Retry, cancel | RetrySelected, CancelSelected
$YESNOCANCEL | Yes, no, cancel | YesSelected, NoSelected, CancelSelected

Select one of the displayed icons from the following.

constant | Icon displayed
$IconInformation |
$IconQuestion |
$IconExclamation |
$IconStop |

Select one of the default buttons below

constant | Explanation
$DefButton1 | The first button from the left is the default button
$DefButton2 | The second from the left is the default button
$DefButton3 | The third button from the left is the default button

exception

None

Example of use

if(MessageBox("Confirm", "Confirm", $OKCANCEL) == OkSelected) {
    ::
}

Related item

OkSelected , CancelSelected , YesSelected , NoSelected , RetrySelected events


DisplayObject.PopupMenu method

Explanation

Display a pop-up menu.

Call format

var id = obj.PopupMenu ( menu1 [, menu2 [, menu3 …]])

Return value

The ID number automatically assigned to the menu choices is returned.

The first element of the menu is 1 for the ID. In the layered menu, "value of upper element * 100 + n" is the ID number of the submenu.

If no menu is selected, 0 is returned.

argument

String menu

Specify the menu choices as a character string.

If "-" is specified, the separator will be displayed.

A check mark is displayed by adding "*" to the first character.

If "~" is added to the first character, it will be invalid and cannot be selected.

If you specify an object that has child objects at the bottom, a hierarchical submenu is displayed. Submenus can be specified up to 4 levels.

If you specify an array, the array elements are expanded as menu items.

exception

None

Example of use

Example 1) Specification by character string

var m1 = new String("menu1"); /* id = 1 */
var m2 = new String("menu2"); /* id = 2 */
var m3 = new String("-");
var m4 = new String("menu3"); /* id = 4 */

var s1 = new String("* sub-menu1"); /* id = 201 */
var s2 = new String("sub-menu2"); /* id = 202 */
var s3 = new String("~ sub-menu3"); /* id = 203 */
m2.Append (s1);
m2.Append (s2);
m2.Append (s3);

var id = PopupMenu(m1, m2, m3, m4);

Related item

Append method

XmlDocument class


DisplayObject.RemoveTimer method

Explanation

Cancels the timer set by the SetTimer method.

Call format

obj.RemoveTimer()

Return value

None

argument

None

exception

None

Example of use

SetTimer(2.5);
var count = 0;
Function OnTimer(e){
    count++;
    if(count >= 5){
        RemoveTimer();
    }
    print(sysdate(), "\n");
}

Related item

SetTimer method

Timer event


DisplayObject.ResetCursor method

Explanation

Stops the wait cursor display by the SetCursor method.

Unlike the PC version, no distinction is made for each object

Call format

obj.ResetCursor()

Return value

None

argument

None

exception

PKG-57

You cannot do SetCursor or ResetCursor on an array definition

Example of use

function OnTouch(e){
    //.SetCursor("wait.cur");
    :
    //.ResetCursor();
}

Related item

SetCursor method


DisplayObject.SetCursor method

Explanation

Displays the weight dialog.
The wait dialog is always displayed in the center of the screen, and other operations cannot be performed while it is displayed.

Also, it does not distinguish each object. Calling this method from any object will produce similar results.

To cancel the display of the wait dialog, call the ResetCursor method.

Call format

obj.SetCursor([ message [, title ]])

Return value

None

argument

String message

Specifies the character string of the message part of the wait dialog.

If omitted, "Please wait" is displayed.

If you specify an empty string, no message is displayed.

String title

It is a character string of the title part of the weight dialog.

If omitted, "Processing" is displayed.

If you specify an empty string, the title is not displayed.

exception

PKG-57

Cannot do SetCursor or ResetCursor on array definition

Example of use

Function OnTouch(e){
    //.SetCursor("wait.cur");
    :
    //.ResetCursor();
}

Related item

ResetCursor method


DisplayObject.SetTimer method

Explanation

Raises a Timer event at sec intervals. One timer can be set for one object. The resolution of the timer is 0.01 seconds.

If you set a timer, the event will occur repeatedly at specified intervals. Call the RemoveTimer method to remove the set timer .

If the sec interval is shorter than the time required to process the OnTimer event handler, Timer events may accumulate in the event queue and become inoperable. Pay close attention to the specified interval of sec .

Further, the Timer event expecting run only once RemoveTimer the write methods, very short sec If you specify a distance, in the Timer event RemoveTimer before the method is executed, the next Timer event occurs Be sure to specify oneshot as $TRUE for one-time execution.

Call format

obj.SetTimer( sec [, oneshot ])

Return value

None

argument

Number sec

Specify the timer event issuance interval in seconds.

boolean oneshot

If you specify $TRUE, the Timer event will fire only once. In this case it is not necessary to call the RemoveTimer method.

The default is $FALSE.

exception

None

Example of use

SetTimer(2.5);
var count = 0;
Function OnTimer(e){
    count++;
    if(count >= 5){
        RemoveTimer();
    }
    print(sysdate(), "\n");
}

Related item

RemoveTimer method

Timer event


DisplayObject event

API version 4

Event

iOS Android Windows

The following events are defined in the DisplayObject class.

API | name | Explanation
4 | OkSelected | Occurs when selecting the OK button in the message box
4 | CancelSelected | Occurs when selecting the Cancel button in the message box
4 | YesSelected | Occurs when selecting the Yes button in the message box
4 | NoSelected | Occurs when selecting the No button in the message box
4 | RetrySelected | Occurs when selecting the Retry button in the message box
4 | Timer | Occurs with the passage of timer time

Class overview

Base class event


DisplayObject.OkSelected event

Occurs when the OK button is selected in the message box.

The MessageBox method returns the same return value as the event that occurs. The selected state of the message box can be obtained by either the return value or the event handler.


DisplayObject.CancelSelected event

Occurs when the Cancel button is selected in the message box.

The MessageBox method returns the same return value as the event that occurs. The selected state of the message box can be obtained by either the return value or the event handler.


DisplayObject.YesSelected event

Occurs when the Yes button is selected in the message box.

The MessageBox method returns the same return value as the event that occurs. The selected state of the message box can be obtained by either the return value or the event handler.


DisplayObject.NoSelected event

Occurs when the No button is selected in the message box.

The MessageBox method returns the same return value as the event that occurs. The selected state of the message box can be obtained by either the return value or the event handler.


DisplayObject.RetrySelected event

Occurs when you select the Retry button in the message box.

The MessageBox method returns the same return value as the event that occurs. The selected state of the message box can be obtained by either the return value or the event handler.


DisplayObject.Timer event

Occurs when the time set by the SetTimer method has elapsed.

Be careful when performing time-consuming processing in the event handler of the Timer event. Timer events occur repeatedly at specified intervals, so if you perform processing that takes longer than the Timer event occurrence interval, the Timer events may accumulate in the event queue and become inoperable.

To stop the Timer event, call the RemoveTimer method.


EditBox class

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | EditObject
 |  |  |  |  | EditBox

A class that displays a multi-line input edit box.

The character to be displayed is the value of the Value property. You can specify String, Number, and Date for ValueType , but the String type is useful for the purpose of using the edit box.

In the String type specification, the internal character code is a platform-dependent multi-byte character code (Shift-JIS in the Japanese environment).

Screen display example

newline character (either or both of CR and LF depending on system)

Depending on the operating system, whether or not the line feed code actually breaks the line differs.

OS | \r (¥r) | \n (¥n) | \r\n (¥r¥n)
Android | No line breaks. | Start a new line. | Start a new line.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

Nothing in particular


EditBox property

API version 4

Property

iOS Android Windows

The following properties are defined in the EditBox class.

API | name | access | Type | initial value | Explanation
4 | Border | CR | boolean | $TRUE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
4 | InputMode | CR | integer |  | Specifying the character types that can be entered
4 | MaxLength | CR | integer |  | Number of characters that can be entered
4 | ScrollBarPosition | CR | integer | $STD | Display position of scroll bar
4 | Value | CRW | String Number Date |  | Value to display

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


EditBox.HorizontalAlign property

Performs horizontal alignment. $STD is right-justified if the data type is Number, otherwise it is left-justified.

constant | value | Explanation
$STD | 0 | Determined by data type
$LEFT | 1 | Left alignment
$CENTER | 2 | Centered
$RIGHT | 3 | Right alignment

If you specify $CENTER or $RIGHT, the horizontal scrollbar is not displayed regardless of the ScrollBarPosition property.


InputMode property

Specify the character types that can be entered.

constant

value

Explanation

Character code in Unicode

$STD

0

All character types

-

$NUMERIC

1

Half-width numbers, half-width spaces

0-9

U + 0030 ~ U + 0039

$ALPHA

2

Half-width alphabet, half-width space

a-z, A-Z

U + 0041 ~ U + 005A, U + 0061 ~ U + 007A

$SYMBOL

4

Half-width symbols (half-width numbers, half-width characters other than half-width alphabets), half-width spaces

!"#$%&'()=~|\^-@[]:;,./\_?><+*{}`

U + 0021 to U + 002F, U + 003A to U + 0040,

U + 005B to U + 0060, U + 007B to U + 00FE,

U + F8F0, U + FF61 to U + FF65

$KANA

8

Half-width katakana, half-width space

ｱ-ﾝ

U + FF66 to U + FF9F

$DNUMERIC

16

Full-width numbers, full-width / half-width spaces

０-９

U + FF10 ~ U + FF19

$DALPHA

32

Full-width alphabet, full-width space

ａ-ｚ, Ａ-Ｚ

U + FF21 to U + FF3A, U + FF41 to U + FF5A

$DSYMBOL

64

Full-width symbols (full-width katakana, full-width hiragana, full-width kanji, full-width numbers, full-width characters other than full-width alphabetic characters), full-width / half-width spaces

！“＃＄％＆‘（）＝〜｜｀｛｝
＊＋＜＞？＿\・。、「」：；＠

Others not applicable

$DKANA

128

Full-width katakana, full-width / half-width space

U + 30A1 to U + 30FA, U + 30FC to U + 30FF,

U + 31F0 ~ U + 31FF

$DHIRA

256

Full-width hiragana, full-width and half-width spaces

U + 3041 ~ U + 3096, U + 3099 ~ U + 309F

$DKANJI

512

Full-width kanji, full-width / half-width space

U + 4E00 to U + ABFF, U + F900 to U + FAFF

$HANKAKU

15

Half size

$NUMERIC, $ALPHA, $SYMBOL, $KANA

Applicable to

$ZENKAKU

1008

Full-width, full-width / half-width space

$DNUMERIC, $DALPHA, $DSYMBOL, $DKANA,

Applicable to $DHIRA and $DKANJI

$KANJI

944

Full-width characters other than full-width symbols, full-width / half-width spaces

$DNUMERIC, $DALPHA, $DKANA, $DHIRA,

Applicable to $DKANJI

$EXSPACE

0x40000000

This option is added to the above specifications. Specify half-width space exclusion.

There is no effect even if it is specified in combination with $STD or alone.

Example) $DKANA + $EXSPACE

Only enter full-width katakana and full-width space

The judgment of the character type uses the function of the OS.

Different judgments may be made depending on the OS.

Please be sure to confirm that the character of “” is correctly determined by the OS actually used, because it may be judged as a symbol or as a kanji by the OS.


EditBox.MaxLength property

Set the maximum number of characters to enter.

The maximum value is 3000.


EditBox.ScrollBarPosition property

Controls the display position of the scroll bar and whether or not scrolling is possible.

Android version
scroll bar is not displayed.
This property can only control whether you can scroll beyond the visible range.
Also, horizontal scrolling is not possible.

constant | value | Explanation
$STD | 0 | Display vertical and horizontal scroll bars
$VSCROLL | 2 | Display vertical scroll bar
$HSCROLL | 3 | Show horizontal scroll bar
$NONE | 1 | Don't show scrollbar

If you specify $NONE, the number of characters displayed on the screen is limited to the number of characters displayed.

When HorizontalAlign property is $CENTER or $RIGHT, horizontal scroll bar is not displayed regardless of the specification of this property.


EditBox.Value property

The value to display. Holds the value of the data type specified in ValueType .

Setting the value by script is not affected by the InputMode property.

The input value on the screen is not reflected immediately. For details, refer to When the Value property is updated .


EditBox method

API version 4

Method

iOS Android Windows

The following methods are defined in the EditBox class.

API | name | Explanation
4 | AppendCR | Converts the line feed code
HT (12) | GetSelection | Gets the cursor position and selection position
HT (12) | SetSelection | Set the cursor position and selection position
4 | SetMargins | Set the left and right margins.

Class overview

Base class methods


EditBox.AppendCR method

Explanation

Format the line feed code and unify it to CR + LF.

Call format

var s = EditBox1.AppendCR()

Return value

Character string with formatted line feed code

argument

None

exception

None

Example of use

EditBox1.Value = data;
EditBox1.AppendCR();

Related item


EditBox.GetSelection method

Explanation

Gets the current cursor position and selection range.

Call format

var n = EditBox1.GetSelection([ lengthMode ])

Return value

Cursor position or number of selected bytes

argument

boolean lengthMode

& The value to get

$FALSE: Get the cursor position

$TRUE: Get the selected number of bytes (the number of characters when UString or Mobile compatibility mode is OFF)

The default is $FALSE.

exception

None

Example of use

var pos = EditBox1.GetSelection();

Related item

SetSelection method


EditBox.SetSelection method

Explanation

Sets the current cursor position and selection range.

Call format

EditBox1.SetSelection( pos [, length ])

Return value

None

argument

integer pos

Specifies the cursor position starting from 0.

If specified outside the range, it will be corrected within the range.

integer length

Specify the selection character length. The default is 0 (no selection).

Special designation

SetSelection(0, -1) Select all

SetSelection(-1) Deselect

exception

None

Example of use

EditBox1.SetSelection(1, 4);

Related item

GetSelection method


EditBox.SetMargins method

Explanation

Set the left and right margins.

In the initial state, the left and right margins are in the OS standard position.

When setting the margin, specify so that the total value of the left and right margins fits within the character display area of ​​the EditBox.

Call format

EditBox1.SetMargins( leftMargin , rightMargin ).

Return value

None

argument

integer leftMargin

Specify the left margin between 0 and 32767.

integer rightMargin

Specify the right margin between 0 and 32767.

exception

FUNC-4

Invalid argument

Example of use

EditBox1.SetMargins(2, 2);

Related item


EditBox event

API version 4

Event

iOS Android Windows

The following events are defined in the EditBox class.

API | name | Explanation
4 | Touch | Occurs when the value entered in the edit box is confirmed

Class overview

Base class event


EditBox.Touch event

This event occurs when the value of the edit box is confirmed by input operation from the screen.

The Touch event occurs when a value change is confirmed by pressing the Enter key or function key, or when it loses focus and is confirmed. It does not occur for each key input character.


EditObject class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | EditObject

This is the base class of the character input class. It has the basic functions of character editing processing using the keyboard.

The EditObject class is a virtual class and cannot instantiate itself.

If you assign binary data that is not considered as a character string to the derived class of EditObject, the display will be undefined.

When the Value property is updated

In the EditObject derived class, the input value on the screen is stored in the Value property, but the Value property actually changes at the following triggers.

1. When an object loses keyboard focus

2. When you press the Enter key

Therefore, please note that even if you refer to the Value property of an object in an event handler that does not involve focus movement, such as the Timer event or the Clicked event of the Label class, you cannot get the data in progress. If you need to get the data being input in such a situation, call the DecideValue method of the Root class before referring to the Value property, and reflect the value on the screen in the Value property.


EditObject property

API version 4

Property

iOS Android Windows

The following properties are defined in the EditObject class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Editable | CRW | boolean | $TRUE | Editability
4 | FgColor | CRW | integer | $STD | Text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | Ten | font size
4 | IMEMode | CR | integer | $STD | Specifying IME mode
5 | SIPMode | CR | String API version 5 or earlier integer | API version 5 and earlier $STD | Specifying the appearance and operation of SIP (Software Input Panel)
6 | Title | CRW | String |  | Specifying the placeholder display character string
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


EditObject.Editable property

Specifies whether to allow or prohibit editing.

Specify $TRUE to allow editing.

Editing is prohibited when $FALSE is specified.


EditObject.IMEMode property

If specified, it will switch to the specified mode when the keyboard focus is received. It also reverts to its previous state when it loses keyboard focus.

Restrictions on Biz/Browser HT

In Biz/Browser HT, it is not possible to control the IME conversion mode (half-width kana input, non-converted input, etc.) due to OS restrictions.

Only the display / non-display of SIP (Software Input Panel) can be controlled with the IMEMode property.

However, depending on the IME on Android, SIP (Software Input Panel) may not be displayed / hidden correctly.

In Biz/Browser HT, SIPMode property can be used to control the input mode of SIP (Software Input Panel) .

Show / hide control of SIP (Software Input Panel) when the value is set to IMEMode property is as follows.

If you specify the SIP display value and the SIP non-display value at the same time, the SIP is not displayed.

constant | value | motion
$STD | 0 | Performs the default behavior (SIP display). The display state of SIP before API verion 5 is controlled as follows according to the source of focus, its own type and the previous state. ・ When you are NumberEdit or DateEdit → Display SIP -When the source is a non-DisplayObject → Display SIP ・ Otherwise → Follow the previous display status
$CLOSE | 4096 | Do not display SIP when moving focus for the first time
$OPEN | 8192 | Show SIP when moving focus for the first time

For compatibility with other Biz/Browser products, the following constants can also be specified.

constant | value | motion
$SIP_CLOSE | 0x10000000 | Do not display SIP when moving focus for the first time
$ALPHA | 2 | Show SIP when moving focus for the first time
$KANA | 8
$DALPHA | 32
$DKANA | 128
$DHIRA | 256
$SIP_OPEN | 0x20000000


EditObject.SIPMode property

Specify the appearance and operation of the displayed SIP (Software Input Panel).

Use the IMEMode property for SIP (Software Input Panel) display control when the object receives the keyboard focus .

Android version

Use the following constants in combination

Keyboard type

You can specify 0 to 1.

constant | value | Explanation
(unspecified) |  | Default mode
$SIP_TYPE_DATETIME | [TYPE_DATETIME] | Date / time input mode * 1
$SIP_TYPE_DATE | [TYPE_DATE] | Date input mode * 1
$SIP_TYPE_TIME | [TYPE_TIME] | Time input mode * 1
$SIP_TYPE_NUMBER | [TYPE_NUMBER] | Numerical value input mode * 1
$SIP_TYPE_PHONE | [TYPE_PHONE] | Phone number input mode * 1
$SIP_TYPE_NAME | [TYPE_NAME] | Name (person name) input mode
$SIP_TYPE_EMAIL | [TYPE_EMAIL] | Email address input mode
$SIP_TYPE_URL | [TYPE_URL] | URL input mode

* 1: If you specify this keyboard type, you cannot enter multiple lines in EditBox (due to OS and SIP restrictions).

If the TextBox.Password property is $TRUE, the keyboard type specified by the SIPMode property is ignored (due to OS and SIP restrictions).

Return key type

You can specify 0 to 1. * 2

constant | value | Explanation
(Unspecified) EditBox |  | "Line feed" button
(Not specified) For TextBox |  | "Done" button
$SIP_RETURNKEY_DONE | [RETURNKEY_DONE] | "Done" button
$SIP_RETURNKEY_GO | [RETURNKEY_GO] | "Open" button
$SIP_RETURNKEY_NONE | [RETURNKEY_NONE] | "Line feed" button
$SIP_RETURNKEY_PREVIOUS | [RETURNKEY_PREVIOUS] | "back button
$SIP_RETURNKEY_SEARCH | [RETURNKEY_SEARCH] | "Search" button
$SIP_RETURNKEY_SEND | [RETURNKEY_SEND] | "Send" button

* 2: In case of EditBox and * 1, the return key type is ignored (due to OS and SIP restrictions).

Change history
* 1 Added from API version 9.


EditObject.Title property

If the display string is empty, a placeholder (hint string for input) is displayed.

The placeholder text color is displayed in gray regardless of the FgColor property.


UseTapAndHold property

Setting $TRUE enables tap and hold operation.

However, the setting value is valid only in Mobile compatible mode.
Otherwise, regardless of the setting value, if you tap and hold the object on the screen as it is, the RClicked event will be generated.

Mobile compatibility mode
If you tap and hold an object on the screen, the RClicked event will be fired.


EditObject method

API version 4

Method

iOS Android Windows

There are no methods defined in the EditObject class.

Class overview

Base class methods


EditObject event

API version 4

Event

iOS Android Windows

The following events are defined in the EditObject class.

API | name | Explanation
HT (10) | RClicked | Occurs with a long tap

Class overview

Base class event


EditObject.RClicked event

It occurs when a long tap operation is performed.

Mobile compatibility mode
Occurs only when the UseTapAndHold property is set to $TRUE. Otherwise it does not occur.

The following child objects are added to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.
Number | xPos | X coordinate of mouse pointer
Number | yPos | Y coordinate of mouse pointer


FocusObject class

Object
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject

The base class of the class that receives focus. It has basic functions related to focus, and all screen display classes that receive focus are derived from the FocusObject class.

The FocusObject class is a virtual class and cannot instantiate itself.


FocusObject Property

API version 4

Property

iOS Android Windows

The following properties are defined in the FocusObject class.

API | name | access | Type | initial value | Explanation
HT (10) | AutoTabFocus | CRW | boolean | $TRUE | Control of focus movement by key operation
HT (10) | NextTabKey | CRW | integer | $STD | Keys to move keyboard focus to the next object
HT (10) | PrevTabKey | CRW | integer | $STD | A key to move keyboard focus to the previous object
4 | SkipTabFocus | CRW | boolean | $FALSE | Suppression of focus acceptance by key operation

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


FocusObject.AutoTabFocus property

Setting $TRUE will move the focus to the next tabbed object during the following operations:

-Press the Tab key, NextTabKey , or key set in the PrevTabKey property.

-For classes with the AutoTab property, the operation performed by the AutoTab property is executed.

If you set $FALSE, the focus will not move automatically , only the SetFocus and MoveFocus methods from the user's mouse operation or script will move the focus.

However, the LostFocus event is fired by switching windows (including pop-up displays from Biz/Browser itself, such as dialogs and message boxes) . Also, if the focus cannot be maintained, such as by deleting the object that is in focus, the focus will move to another object.

If you press the Tab key or NextTabKey , press the key set in the PrevTabKey property, or operate the AutoTab property with $FALSE set , the FocusOperation event will be generated.

The initial value is $TRUE.


FocusObject.NextTabKey property

If you are receiving keyboard focus, press the key specified in the NextTabKey property to move the keyboard focus to the next object.

If each class derived from FocusObject has its own key to be processed, keyboard focus movement will not be performed even if the specification is duplicated with that key.

For the values ​​that can be specified for the NextTabKey property, refer to Key specification .

For the priority when multiple meanings are assigned to one key operation, refer to Priority in key operation .


FocusObject.PrevTabKey property

If you are receiving keyboard focus, pressing the key specified in the PrevTabKey property will move the keyboard focus to the previous object.

If each class derived from FocusObject has its own key to be processed, keyboard focus movement will not be performed even if the specification is duplicated with that key.

For the values ​​that can be specified for the PrevTabKey property, refer to Key specification .

For the priority when multiple meanings are assigned to one key operation, refer to Priority in key operation .


FocusObject.SkipTabFocus property

If $TRUE is set, the focus will not be moved by the keyboard.

If $FALSE is set, the focus will be moved by the keyboard.

By setting $TRUE in the SkipTabFocus property with a button that has an auxiliary function, you can limit the focus movement by the keyboard only to the object that is the center of input, and improve the efficiency of input operation. ..


FocusObject method

API version 4

Method

iOS Android Windows

The following methods are defined in the FocusObject class.

API | name | Explanation
4 | MoveFocus | Move focus Moves focus according to order
4 | SetFocus | Set the focus on the object

Class overview

Base class methods


FocusObject.MoveFocus method

Explanation

Move focus Moves the focus according to the order.

The focus may not move correctly in the following cases.

-When keyboard focus is set other than the object that called the MoveFocus method

-For objects that are not originally in focus, such as unselected option buttons

-For objects in inactive windows hidden in dialogs

Call format

obj.MoveFocus([ direction ])

Return value

None

argument

integer direction

Direction to move

Specify the following values. If omitted, it will be $NEXTFOCUS.

constant | value | Explanation
$NEXTFOCUS | 1 | Next object The focus moves in the same order as the Tab key.
$PREVFOCUS | 2 | Previous object The focus moves in the same order as the Shift + Tab keys.

exception

None

Example of use

if(MessageBox("Confirm", "Confirm", $OkCancel) == OkSelected) {
    TextBox1.MoveFocus($PREVFOCUS);
}

Related item


FocusObject.SetFocus method

Explanation

Sets keyboard focus on the object.

The focus does not move immediately when the SetFocus method is executed.

The object is changed to preferentially receive focus and is set to focus after the ongoing processing is complete.

If you execute the SetFocus method on multiple objects at once in the same screen, the last executed SetFocus method will take effect.

Not valid if the object is in a state where it cannot receive focus.

Call format

obj.SetFocus()

Return value

None

argument

None

exception

None

Example of use

if(MessageBox("Confirm", "Confirm", $OkCancel) == OkSelected) {
    TextBox1.SetFocus();
}

Related item


FocusObject event

API version 4

Event

iOS Android Windows

The following events are defined in the FocusObject class.

API | name | Explanation
HT (10) | FocusOperation | It is caused by the operation that causes the focus to move.
4 | GetFocus | Occurs when receiving keyboard focus
4 | LostFocus | Occurs when you lose keyboard focus

Class overview

Base class event


FocusObject.FocusOperation event

This event occurs when you perform a key input operation that causes the focus to move while the object is receiving keyboard focus.

The following variables are added to the Event object.

name

Type

Explanation

Direction

integer

The following values ​​indicating the direction in which the focus was moved are stored.
The value of the Direction property can be moved in the same way as the original focus movement by passing it to the MoveFocus method of the FocusObject class. I will.

constant | value | Explanation
$NEXTFOCUS | 1 | Next object
$PREVFOCUS | 2 | Previous object

Key

String

A character string indicating the key that caused the FocusOperation event is set.
The string set is the same as the string set for Key in the KeyDown event.

The operation causing movement of the focus, Tab key, or NextTabKey , PrevTabKey depression of key set in the property, for classes that AutoTab property refers to the operation by focus movement due AutoTab property is executed.

The FocusOperation event does not occur for operations other than these.

The FocusOperation event occurs exclusively with focus movement, as specified by the AutoTabFocus property, which directs automatic focus movement.

If the AutoTabFocus property is $TRUE, the operation that causes the focus move will move the focus and the FocusOperation event will not be fired.

If the AutoTabFocus property is $FALSE, the focus will not move and the FocusOperation event will be fired.


FocusObject.GetFocus event

Occurs when keyboard focus is received.


FocusObject.LostFocus event

Occurs when you lose keyboard focus.


Form class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | Form

A class that displays a form.

Place and manage another object at the bottom of the form. Subordinate objects are not displayed beyond the area of ​​the parent Form object to which they belong, and are clipped by the size of the parent Form object.

Screen display example

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

◆ It is scaled by the scaling value of the upper Form object.

◆ The lower object is scaled by multiplying the scaling value of the upper Form object by its own scaling value.

Precautions for gesture operation

You can use the UseGesture property and Gesture event to get the gesture by touch operation as an event.

For details, refer to About gesture operation.


Form property

API version 4

Property

iOS Android Windows

The following properties are defined in the Form class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | FontScale | CRW | Number | 1.0 | Font scaling ratio
4 | HorizontalScale | CRW | Number | 1.0 | Horizontal scaling rate
4 | Scroll | CR | integer | $AUTO | Scroll bar display control
4 | UseGesture | CRW | integer | $STD | Specifying gesture events to capture
HT (10) | UseMouseMove | CRW | integer | $STD | Conditions for generating MouseMove events
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation
4 | Value | CRW | String Number Date |  | Object value
4 | VerticalScale | CRW | Number | 1.0 | Vertical scaling ratio

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Form.FontScale property

Specifies the scaling factor of the font of the object belonging to the form.

The range is from 0.1 to 1 (1x) to 10.

The FontSize property of each object is multiplied by the specified magnification.

This specification does not change the properties of the object on the form.


Form.HorizontalScale property

Specifies the horizontal scaling of the objects that belong to the form.

The range is from 0.1 to 1 (1x) to 10.

This specification does not change the properties of the object on the form.

Objects that are scaled do not simply scale, but each class has its own display.


Form.UseGesture property

Specifies the type of gesture to capture in the Gesture event.

Specify the occurrence condition by combining the following values:

Constant | Value | Explanation
$STD | 0 | No Gesture event is fired.
$FLICK | 1 | Captures flick operations and raises Gesture events.
$SWIPE | 2 | Captures swipe gestures and fires Gesture events.
$PINCH | 4 | Captures pinch gestures and fires Gesture events.

If either $FLICK or $SWIPE is specified, panning operations (scrolling, flicking, swiping, etc.) for its own area are captured.
If not specified, flick and swipe operations will be transferred to the parent form.
Also, scrolling operations are captured by themselves if they scroll, otherwise they are transferred to the parent form.

To capture flick and swipe operations, specify as follows:

UseGesture = $FLICK + $SWIPE;

To capture pinch operations, specify as follows:

UseGesture = $PINCH;

Gesture events by swipe operation and pinch operation generate a large number of events in conjunction with the operation. If it takes time to process the event handler, the responsiveness of the terminal may be greatly reduced, so please try to minimize the occurrence of events when necessary and under the necessary conditions.


Form.UseMouseMove property

This property is retained for compatibility. Nothing happens when I operate it.


Form.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


Form.VerticalScale property

Specifies the vertical scaling factor of the objects that belong to the form.

The range is from 0.1 to 1 (1x) to 10.

This specification does not change the properties of the object on the form.

Objects that are scaled do not simply scale, but each class has its own display.


Form method

API version 4

Method

iOS Android Windows

There are no methods defined in the Form class.

Class overview

Base class methods


Form event

API version 4

Event

iOS Android Windows

The following events are defined in the Form class.

API | name | Explanation
4 | Clicked | Occurs when tapped
4 | DoubleClicked | Occurs when double tapped
4 | Gesture | Occurs during gesture operation
HT (10) | KeyDown | Occurs when a key is pressed
HT (15) | KeyUp | Occurs when the key is released
4 | LButtonUp | Occurs when your finger is released when tapped
HT (10) | MouseMove | It is retained for compatibility. Does not occur.
4 | RButtonUp | Occurs when your finger is released during a long tap
4 | RClicked | Occurs when long tapped

Class overview

Base class event


Clicked event

Occurs when tapped.

The following child objects are added to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.
Number | xPos | X coordinate of mouse pointer
Number | yPos | Y coordinate of mouse pointer

Example of use

Function OnClicked (e) {
    MessageBox (strf ("Tap on (%1,%2)", e.xPos, e.yPos));
}


DoubleClicked event

Occurs when a double tap operation is performed.

The following child objects are added to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.
Number | xPos | X coordinate of mouse pointer
Number | yPos | Y coordinate of mouse pointer

Example of use

Function OnDoubleClicked (e) {
    MessageBox (strf ("Double tapped on (% 1,% 2)", e.xPos, e.yPos));
}


Form.Gesture event

Occurs in gesture operations that match the conditions specified in the UseGesture property. You can detect the gesture operation by processing it in the OnGesture event handler.

The following child objects are added to the Event object.

Type

name

Explanation

Number

action

Indicates the type of event that occurred.

The value is set to one of the following constants.

constant | value | Explanation
$FLICK | 1 | Indicates that an event has occurred due to a flick operation.
$SWIPE | 2 | Indicates that an event has occurred due to a swipe operation.
$PINCH | 4 | Indicates that an event has occurred due to a pinch operation.

Number

xPos

X coordinate where the event occurred

Number

yPos

Y coordinate where the event occurred

Number

direction

* Added only when Action = $FLICK

Indicates the flick direction.

The value is set to one of the following.

value | Explanation
0 | Indicates a flick operation in the upward direction.
1 | Indicates a downward flick operation.
2 | Indicates a flick operation to the left.
3 | Indicates a flick operation to the right.

Number

xDelta

* Added only when Action = $FLICK

Indicates the flick speed in the horizontal direction.

The unit of the value depends on the platform.

Number

yDelta

* Added only when Action = $FLICK

Indicates the flick speed in the vertical direction.

The unit of the value depends on the platform.

Number

delta

* Added only when Action = $PINCH

Indicates the amount of pinch movement.

A positive value is displayed during pinch-out (enlargement) operation, and a negative value is displayed during pinch-in (reduction) operation.

The unit of the value depends on the platform.

Number

scaleDelta

* Added only when Action = $PINCH

Indicates the amount of change in the scale (current finger width / finger width at the start of pinch operation).

Stores the ratio of the previous scale value to the current scale value.

A value greater than 1.0 is displayed when the pinch-out (enlargement) operation is performed, and a value smaller than 1.0 is displayed when the pinch-in (reduction) operation is performed.


Form.KeyDown event

The KeyDown event is fired by pressing the keyboard. By processing the KeyDown event with the OnKeyDown event handler, it can be expressed like a shortcut key.

The following child objects are attached to the Event object.

Type | name | Explanation
Number | ShiftKey | 1 if the Shift key is pressed, 0 otherwise
Number | CtrlKey | 1 if the Ctrl key is pressed, 0 otherwise
Number | AltKey | 1 if the Alt key is pressed, 0 otherwise
String | Key | Pressed key

See the table below for special keys.

Example of use

Function OnKeyDown (e) {
    if(e.Key == "G") {
        /* Switch screen to Form2 when G is pressed */
        //.Form1.Delete();
        //.Get("Form2.crs");
    }
}

Value stored in the Key object (special key)

Key type | Value to be stored
Esc | "ESCAPE"
BackSpace | "BACK"
ENTER | "RETURN"
Space | "SPACE"
Insert | "INSERT"
Home | "HOME"
PageUp | "PRIOR"
Delete | "DELETE"
End | "END"
PageDown | "NEXT"
Left arrow key | "LEFT"
Up arrow key | "UP"
Right arrow key | "RIGHT"
Down arrow key | "DOWN"
Numeric keypad 0 to 9 | "NUMPAD0" to "NUMPAD9"
Numeric keypad . | "DECIMAL"
Numeric keypad * | "MULTIPLY"
Numeric keypad + | "ADD"
Numeric keypad / | "DIVIDE"
Numeric keypad - | "SUBTRACT"
NumLock | "NUMLOCK"
F1 to F12 | "F1" to "F12"
ScrollLock | "SCROLL"

For the KeyDown event, the type of key operation that occurs and the object that is the source of the event are determined by which object the keyboard focus is on on the Biz/Browser screen.

The object from which the KeyDown event originates, if the object has keyboard focus, originates from the Form object in which it is located. If the keyboard focus is not on any object, it originates from the top Form object.

Priority order in key operation

When multiple meanings are assigned to one key operation and the key operation is actually performed, the priority order of execution is as follows.

1. The focus movement is given priority to the key operations set in the Tab key, Shift + Tab key, NextTabKey property, and PrevTabKey property.

2. Object-specific keystrokes are performed.

3. The key operation assigned to the AltKey property of the Button object is executed.

4. The KeyDown event is raised.

* The operation that occurs with one key operation is one of focus movement, object-specific operation, AltKey property operation, and KeyDown event issuance.

Precautions when using the KeyDown event

- It is recommended not to use special keys (BackSpace, etc.) used for character input in the KeyDown event because they are strongly affected by the type of IME and the state of the object.

- It is recommended not to use keys assigned as system keys or shortcut keys by the OS, as this will cause confusion in operability.

- The KeyDown event may not fire if it is assigned as a system key or shortcut key (or reserved for the future).

- It is recommended that you do not use keys that have unique meanings, such as CapsLock and NumLock, as they can confuse operations.

- The KeyDown event occurs for key operations recognized by the terminal or OS. These are affected by the keyboard hardware. Depending on the hardware, the KeyDown event may not occur in Biz/Browser depending on the key combination.

- Depending on the model, depending on the model, when the Ctrl, Shift, and Alt keys are pressed at the same time, they may be recognized as different keys. If you use these special keys, make sure that the KeyDown event is fired correctly on your keyboard.

- Depending on the combination of hardware and key, CtrlKey, ShiftKey, and AltKey may not be 1 ($TRUE) even though you press Ctrl, Shift, and Alt keys at the same time.

- The KeyDown event may not occur depending on the type of object that is focused on the key press.

- When using an external HID device such as a Bluetooth keyboard, it may be recognized as an US keyboard regardless of the OS settings.


Form.KeyUp event

iOSAndroidWindows

The KeyUp event is fired when the keyboard is released.

By setting the KeyDown event as the start of the process and the KeyUp event as the end of the process, it can be expressed as a hardware triggered operation.

The following child objects are attached to the Event object.

type | name | explanation
Number | ShiftKey | 1 if the Shift key is pressed, 0 otherwise
Number | CtrlKey | 1 if the Ctrl key is pressed, 0 otherwise
Number | AltKey | 1 if the Alt key is pressed, 0 otherwise
String | Key | Pressed key

See the table below for special keys.

Usage examples

Function OnKeyDown(e) {
    if (e.Key == "G") {
        /* Count up while pressing G */
        count = 0;
        SetTimer(1.0);
    }
}
Function OnKeyUp(e) {
    if (e.Key == "G") {
        RemoveTimer();
    }
}
Function OnTimer(e) {
    count++;
    print(count);
}

Value stored in the Key object (special key)

Key type | Stored value
Esc | "ESCAPE"
BackSpace | "BACK"
ENTER | "RETURN"
Space | "SPACE"
Insert | "INSERT"
Home | "HOME"
PageUp | "PRIOR"
Delete | "DELETE"
End | "END"
PageDown | "NEXT"
Left arrow key | "LEFT"
Up arrow key | "UP"
Right arrow key | "RIGHT"
Down arrow key | "DOWN"
Numeric keypad 0 to 9 | "NUMPAD0" to "NUMPAD9"
Numeric keypad . | "DECIMAL"
Numeric keypad * | "MULTIPLY"
Numeric keypad + | "ADD"
Numeric keypad / | "DIVIDE"
Numeric keypad - | "SUBTRACT"
NumLock | "NUMLOCK"
F1 to F12 | "F1" to "F12"
ScrollLock | "SCROLL"

KeyUp event depends on which object the keyboard focus is on in the Biz/Browser screen, and determines the type of key operation that occurs and the object from which the event is sent.

The object from which the KeyUp event is generated will be the Form object in which the object is located, if the object has the keyboard focus.

If the keyboard focus is not on any object, it will be fired from the highest level Form object.

Points to note when using KeyUp events

- It is recommended not to use special keys (BackSpace, etc.) used for character input in the KeyUp event because they are strongly affected by the type of IME and the state of the object.

- It is recommended not to use keys assigned as system keys or shortcut keys by the OS, as this will cause confusion in operability.

- The KeyUp event may not fire if it is assigned as a system key or shortcut key (or reserved for the future).

- It is recommended that you do not use keys that have unique meanings, such as CapsLock and NumLock, as they can confuse operations.

- KeyUp events are fired for keystrokes that are recognized by the terminal or OS. They are affected by the hardware of the keyboard. Depending on the hardware, some key combinations may not cause KeyUp events in Biz/Browser.

- Some keys, depending on the model, may be recognized as different keys when pressed at the same time as the Ctrl, Shift, or Alt keys. When using these special keys, be sure to check that the KeyUp event is fired correctly on the keyboard you are actually using.

- Depending on the hardware and key combination, CtrlKey, ShiftKey, and AltKey may not be set to 1 ($TRUE) even though they are pressed at the same time as Ctrl, Shift, and AltKey.

- Depending on the type of object that has the focus on the key press, the KeyUp event may not be fired.

- When using an external HID device such as a Bluetooth keyboard, it may be recognized as an US keyboard regardless of the OS settings.


FocusObject method

API version 4

LButtonUp event

iOSAndroidWindows

This occurs when the finger is released during tapping.

This event is left in place for compatibility and actually fires at the same time as the Clicked event.

The following child objects are attached to the Event object.

constant | value | Explanation
Number | xPos | X coordinate of the tapped location
Number | yPos | Y coordinate of the tapped location

Usage examples

Function OnLButtonUp(e) {
    MessageBox(strf("(%1,%2) LButtonUp has occurred.", e.xPos, e.yPos));
}


Form.MouseMove event

This event is retained for compatibility. Nothing happens when I operate it.


RButtonUp event

Occurs when the finger is released during a long tap.

This is an event that has been left for compatibility reasons and actually happens at the same time as the RClicked event.

The following child objects are added to the Event object.

Type | name | Explanation
Number | xPos | X coordinate of the place where you long tapped
Number | yPos | Y coordinate of the place where you long tapped

Example of use

Function OnRButtonUp (e) {
    MessageBox (strf ("RButtonUp occurred in (% 1,% 2).", E.xPos, e.yPos));
}


Label class

Object
 | NetObject
 |  | DisplayObject
 |  |  | Label

A class that displays character labels.

Formats the value of the Value property according to the specification of the Format property and displays it on the screen.

If the characters do not fit within the right edge of the display range, a line break will occur and the characters will be displayed on the next line. Word wrap is taken into consideration for the line break position, and if no word break is found in alphabetic characters, no line break is performed.

If the line does not fit within the bottom of the display range, it will be clipped and the following lines will not be displayed.

Screen display example

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

Nothing in particular


Label Property

API version 4

Property

iOS Android Windows

The following properties are defined in the Label class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CRW | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | BorderStyle | CRW | integer | $SUNKEN | Border type
28 | BorderWidth | CRW | Number | 0 | Border width
16 | CornerRadius | CRW | integer | 0 | Radius of rounded corners
4 | FgColor | CRW | integer | $STD | Text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | 10 | font size
4 | Format | CR | String |  | Format string
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
HT (10) | NoPrefix | CRW | boolean | $FALSE | Mode that does not interpret &
23 | TapEventMode | CRW | integer |  | How events fired on tap are added to the event queue
4 | Transparent | CRW | boolean | $FALSE | Background transparency
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation
4 | Value | CRW | String Number Date |  | Value to display on the label
4 | VerticalAlign | CR | integer | $STD | Vertical alignment

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Label.Border property

If $TRUE is specified, the frame of the type specified by the BorderStyle property will be displayed. In the case of $FALSE, the frame is not displayed.


Label.BorderStyle property

Specify the border type. Only valid if the Border property is $TRUE.

constant | value | Explanation
$SUNKEN | 0 | The whole is displayed in a concave shape
$RISED | 1 | The whole is displayed in a convex shape
$ETCHED | 2 | The line of the frame is displayed in a concave shape
$BUMP | 3 | Display the frame line in a convex shape
$GRAYFRAME | 4 | Shows a border in two colors of gray
$SOFT | 5 | Display the frame in black and white
$SOFTETCHED | 6 | The border is displayed in a soft concave shape.
$SOFTBUMP | 7 | The border is displayed in a soft convex shape.
$PLANE | 8 | Display with a single black line
$DASH | 9 | Display with a long dotted line
$DOT | 10 | Display with a fine dotted line
$FLATSUNKEN | 11 | The whole is displayed in a low concave shape
$FLATRISED | 12 | Display the whole with a low convex shape

Display example


BorderWidth property

iOSAndroidWindows

Specifies the width of the border.

Specify in the range of 0.0-5.0. If 0 is specified, the border will be displayed with the default width.

The default value is 0


Label.CornerRadius property

iOSAndroidWindows

Specifies the radius of rounded corners.

If a value greater than 0 is specified, the shape of the label will be a rectangle with rounded corners. The value of the property will be the radius of the rounded corners.

If the value of the ropati is greater than half the width or height of the button, it will be rounded to half the value of the short side.

If the HorizontalScale or VerticalScale property is specified in the parent Form, the value of the property will be applied after scaling up or down.

If the value of the property is less than or equal to 0, the design will be normal.


Format property

Specify the format of the edit string for each data type.

Specified characters that can be used in common in all formats
Specified character | Example | Explanation
@ | "\"maximum\"@" | Displays in the specified position in the default format. When the data type is Date, @d displays only the date, @t displays the time without the date and seconds, and @s displays the time with the date and seconds.
"TEXT" | "9990\"Yen\"" | The characters enclosed in "" are displayed at the specified position. When specified for Number type data, it cannot be specified at the position that separates the sequence of numbers.

If the data type is String
Specified character | Example | Explanation
Sn.m | "S2.3" | The left end of the character string is counted as 0, and m characters are displayed from the nth character.

If the data type is Number
Specified character | Example | Explanation
9 | "999" | The number that describes 9 indicates the number of digits, and the leading 0 is deleted. If specified after the decimal point, it means only the number of digits and zero suppression is not performed.
0 | "0999" "9990" | Leading 0 becomes 0.
$ | "$9990" | Add a $ mark at the beginning.
MI | "999MI" "MI999" | If it is a negative number, a minus sign (-) is displayed at the specified position (right or left).
S | "S9990" "9990S" | The sign is displayed at the specified position (right or left).
D or .(period) | "99D99" "99.99" | Displays the decimal point at the specified position. If you do not specify the number of digits after the decimal point, up to the last number within the effective precision range is displayed.
L | "L9990" "9990L" | Displays the local currency symbol at the specified position (right or left).
,(comma) | "999,990" | A comma is displayed every 3 digits.
" " (Space) | "99" | The number of spaces described indicates the number of digits, and leading 0s are replaced with whitespace characters (spaces). If it is specified after the decimal point, it is invalid and has no meaning.
! | "999!" | If a digit overflow occurs within the specified number of digits, a! Is added to the formatted result and displayed, but if you specify !, the display of! Is suppressed even if the digit overflows.

When the data type is Date
Specified character | Example | Explanation
Y | "YYYY,MM,DD" | Displays the year of the Christian era. The number with Y indicates the number of digits displayed in the Christian era.
WS | "WSWYY.MM.DD" | The Japanese calendar year is displayed in abbreviated form (M, T, S, H ...).
WR | "WRWYY\"year\"MM\"month\"DD\"day\"" | The year of the Japanese calendar is displayed (Meiji, Taisho, Showa, Heisei ..).
WYY | "WRWYY\"year\"MM\"month\"DD\"day\"" | Displays the year of the Japanese calendar.
MM | "YYYY/MM" | Displays the month (1-12).
MONTH | "MONTH DD YYYY" | Displays the name of the month (JANUARY ...). It is displayed in 9 digits.
month | "month DD YYYY" | Displays the name of the capitalized month (January ...). It is displayed in 9 digits.
MON | "dy, DD MON YYYY" | Displays the month name abbreviation (JAN ...).
mon | "dy, DD mon YYYY" | Displays the abbreviation (Jan ...) for the capitalized month name.
DD | "YY/MM/DD" | Displays the day (1-31).
DAY | "YY/MM/DD DAY" | Displays the day of the week (SUNDAY ...).
day | "YY/MM/DD day" | Shows the capitalized day of the week (Sunday ...).
DY | "YY/MM/DD DY" | Displays the abbreviation for the day of the week (SUN ...).
dy | "dy, DD mon YYYY" | Displays the abbreviation (Sun ...) for the capitalized day of the week.
DJ | "YY/MM/DD DJ" | Displays the local form of the day of the week (Monday, Tuesday ...).
HH | "HH:MI:SS" | Displays the 12-hour system (0 to 11).
HH24 | "HH24:MI:SS" | 24. Displays the time system (0 to 23).
MI | "HH:MI:SS" | Displays minutes (0 to 59).
SS | "HH:MI:SS" | Displays seconds (0 to 59).
TZ | "HH24:MI:SS TZ" | Displays the time zone in the format +0900.
u | "YY/MM/DD uHH24:MI:SS" | The values ​​after the specified location are displayed in UTC format.
-/,.;: | "HH:MI:SS" | The specified character is displayed at the specified position.

* WS, WR, and WYY can only be used in areas where the Japanese calendar is valid.

* If you want to use the Japanese calendar year and year with WS, WR, and WYY, you need to set the year information in advance with the Root.SetWareki method. From the Meiji era to the Heisei era, it is set automatically.

* It is not possible to specify a day of the week such as DAY or-/,.;:, Etc. alone. Be sure to use these in combination with an input format.


Label.HorizontalAlign property

Performs horizontal alignment. $STD is right-justified if the data type is Number, otherwise it is left-justified.

constant | value | Explanation
$STD | 0 | Determined by data type
$LEFT | 1 | Left alignment
$CENTER | 2 | Centered
$RIGHT | 3 | Right alignment


Label.TapEventMode property

iOSAndroidWindows

Specifies how events fired on tap are added to the event queue.

Clicked, DoubleClicked, and RClicked events are applicable.

It does not affect events fired by the Object.PostEvent method.

Specify a combination of the following values. If omitted, the value will be Object.POST_DEFAULT.

constants | value | Explanation
Object.POST_DEFAULT | 0 | Add the event to the back of the event queue (works as before).
Object.POST_FRONT | 1 | Add the event to the head of the event queue. Specify if you want the event to occur immediately.
Object.POST_UNIQUE | 2 | If the same type of event exists in the event queue with the same originating object, the event is not added to the queue.


Label.Transparent property

$TRUE disables the BgColor property and makes the background transparent.


Label.Value property

The value to display on the label. Holds the value of the data type specified in ValueType .


Label.VerticalAlign property

Performs vertical alignment. $STD will be aligned.

constant | value | Explanation
$STD | 0 | Same as $TOP
$TOP | 1 | Top alignment
$CENTER | 2 | Centered
$BOTTOM | 3 | Bottom alignment

When the VerticalAlign property is specified, the characters in the Label cannot be wrapped except when printing. If you do not specify the VerticalAlign property, the characters in the Label are wrapped.


Label method

API version 4

Method

iOS Android Windows

There are no methods defined in the Label class.

Class overview

Base class methods


Label event

API version 4

Event

iOS Android Windows

The following events are defined in the Label class.

API | name | Explanation
4 | Clicked | Occurs when tapped
4 | DoubleClicked | Occurs when double tapped
4 | RClicked | Occurs when long tapped

Class overview

Base class event


ListBox class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | ListBox

A class that displays a list box.

The ListBox class works in tandem with the ListItem class.

To set the data to be displayed as a choice, you need to place an object of ListItem or its derived class in the structure defined under the ListBox object.

Object structure

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
UP | Move to the previous option
LEFT | Move to the previous option
BOTTOM | Move to the next option
RIGHT | Move to the next option

Default properties and ValueType

The default property is Value . The value type specification is invalid.

Precautions when scaling

Nothing in particular


ListBox Property

API version 4

Property

iOS Android Windows

The following properties are defined in the ListBox class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | FgColor | CRW | integer | $STD | Text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | 10 | font size
5 | ItemHeight | CR | integer | 0 | Item height
4 | Scroll | CR | integer | $AUTO | Scroll bar display control
4 | SelectionMode | CR | integer | $STD | Selection mode
4 | Value | CRW | integer |  | Selected position

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


ListBox.BgColor Property

Specify the background color with a color constant .


ListBox.FgColor Property

Specify the character color with a color constant .


ListBox.ItemHeight property

Specifies the height of the ListItem item.
The default value is 0, which means the default height if 0 is specified.

The height specified by this property is not scaled by the font size and the ListItem will always be displayed at the set height.


ListBox.SelectionMode property

Selection mode. Set single selection or multiple selection.

constant | value | Explanation
$STD | 0 | Single selection
$MULTI | 4 | Multiple selection


ListBox.Value property

The array number of the currently selected list item.

-1 indicates the unselected state.

If the SelectionMode property is $MULTI, you can select multiple items, but the value of the Value property will be the array number of the last selected item.


ListBox method

API version 4

Method

iOS Android Windows

There are no methods defined in the ListBox class.

Class overview

Base class methods


ListBox event

API version 4

Event

iOS Android Windows

There are no events defined in the ListBox class.

Class overview

Base class event


ListItem class

Object
 | NetObject
 |  | ListItem

A class that defines the choices of the ListBox class. Be sure to array and use it as a child object of ListBox class.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


ListItem property

API version 4

Property

iOS Android Windows

The following properties are defined in the ListItem class.

API | name | access | Type | initial value | Explanation
4 | Selected | CRW | boolean | $FALSE | Item selection status
4 | Title | CRW | String |  | The string displayed in the choices
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


ListItem.Selected property

The item is selected.

$TRUE if selected, $FALSE if not selected.


ListItem.Title property

The characters to display in the list.


ListItem.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.

The selected state of the choice can be specified by the Selected property, and the character to be displayed as the choice can be specified by the Title property.


ListItem method

API version 4

Method

iOS Android Windows

There are no methods defined in the ListItem class.

Class overview

Base class methods


ListItem event

API version 4

Event

iOS Android Windows

The following events are defined in the ListItem class.

API | name | Explanation
4 | Touch | Occurs when selecting an item in a list box
4 | DoubleClicked | Occurs when double tapped

Class overview

Base class event


ListItem.Touch event

This event occurs when you select an item in the list box.

It occurs regardless of the operation from the screen or the operation from the script.

Occurs when the SelectionMode property of the ListBox class changes from OFF to ON if it is $STD.

If the SelectionMode property of the ListBox class is $MULTI, it will occur for both OFF to ON and ON to OFF changes.

Note

In the handler of the event that occurred in the ListItem class, do not use the Value property of the parent object ListBox class to refer to the selected item number . (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (ListItem object) of the Event object passed as an argument of the event handler . For the selected state of the item, refer to the Selected property from the From property .


ListItem.DoubleClicked event

Occurs when double tapped.

The following child objects are attached to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.
Number | xPos | X coordinate of mouse pointer
Number | yPos | Y coordinate of mouse pointer

Note

In the handler of the event that occurred in the ListItem class, do not use the Value property of the parent object ListBox class to refer to the selected item number . (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (ListItem object) of the Event object passed as an argument of the event handler . For the selected state of the item, refer to the Selected property from the From property .


OptionButton class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | OptionButton

A class that displays an option button to select one from multiple choices.

The OptionButton class works in tandem with the OptionItem class.

To set the data to be displayed as a choice, you need to place the OptionItem class or its derived class objects in the structure defined below the OptionButton object.

Object structure

Screen display example

Default properties and ValueType

The default property is Value . The value type specification is invalid.

Precautions when scaling

Nothing in particular


OptionButton Property

API version 4

Property

iOS Android Windows

The following properties are defined in the OptionButton class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | FgColor | CRW | integer | $STD | Text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | 10 | font size
24 | Scalable | CR | boolean | $FALSE | Whether the option button is scalable or not
4 | Scroll | CR | integer | $AUTO | Scroll bar display control
4 | Value | CRW | integer |  | Selected position

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


OptionButton.Scalable property

iOSAndroidWindows

If $TRUE, the option button size is scaled according to the Form.HorizontalScale and Form.VerticalScale properties. VerticalScale property.

If $FALSE, no scaling is performed.

Default value is $FALSE.

The option buttons are scaled while maintaining the aspect ratio. If the values of the Form.HorizontalScale and Form.VerticalScale properties are different, the smaller value is used for the scaling factor.


OptionButton.Value property

The array number of the currently selected list item.

-1 indicates the unselected state.


OptionButton method

API version 4

Method

iOS Android Windows

The following methods are defined in the OptionButton class.

API | name | Explanation
24 | ResetCheckedImage | Discard the image set by the SetCheckedImage method
24 | ResetUncheckedImage | Discards the image set by the SetUncheckedImage method
24 | SetCheckedImage | Set the image to be displayed on the checkbox in the checked state
24 | SetUncheckedImage | Set the image to be displayed on the checkbox in the unchecked state

Class overview

Base class methods


OptionButton.ResetCheckedImage method

Explanation

The image set by the SetCheckedImage method is discarded.

Call format

OptionButton1.ResetCheckedImage()

Return value

None

argument

None

exception

None

Example of use

OptionButton1.ResetCheckedImage();

Related item

SetCheckedImage method


OptionButton.ResetUncheckedImage method

Explanation

The image set by the SetUncheckedImage method is discarded.

Call format

OptionButton1.SetUncheckedImage()

Return value

None

argument

None

exception

None

Example of use

OptionButton1.SetUncheckedImage();

Related item

SetUncheckedImage method


OptionButton.SetCheckedImage method

Explanation

Set the image to be displayed on the option button in the checked state.

Call format

OptionButton1.SetCheckedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

OptionButton1.SetCheckedImage(ImageList1.GetImage(0));
OptionButton2.SetCheckedImage("img/sample.png");

Related item

ResetCheckedImage method

Image , ImageList class


OptionButton.SetCheckedImage method

API version 24

OptionButton.SetUncheckedImage method

Explanation

Set the image to be displayed on the option button in the unchecked state.

Call format

OptionButton1.SetUncheckedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

OptionButton1.SetUncheckedImage(ImageList1.GetImage(0));
OptionButton2.SetUncheckedImage("img/sample.png");

Related item

ResetUncheckedImage method

Image , ImageList class


OptionButton event

API version 4

Event

iOS Android Windows

There are no events defined in the OptionButton class.

Class overview

Base class event


OptionItem class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | OptionItem

A class that defines the options of the OptionButton class. Be sure to array and use it as a child object of OptionButton class.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
SPACE | Make it selected
UP | Move to the previous option
LEFT | Move to the previous option
BOTTOM | Move to the next option
RIGHT | Move to the next option

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

◆ If you want to scale the select button, set the OptionButton.Scalable property to $TRUE.


OptionItem property

API version 4

Property

iOS Android Windows

The following properties are defined in the OptionItem class.

API | name | access | Type | initial value | Explanation
4 | Selected | CRW | boolean | $FALSE | Item selection status
4 | Title | CRW | String |  | The string displayed in the choices
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


OptionItem.Selected property

The item is selected.

$TRUE if selected, $FALSE if not selected.

Only one option remains selected at any given time.


OptionItem.Title property

The character to be displayed as a choice.


OptionItem.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.

The selected state of the choice can be specified by the Selected property, and the character to be displayed as the choice can be specified by the Title property.


OptionItem method

API version 4

Method

iOS Android Windows

There are no methods defined in the OptionItem class.

Class overview

Base class methods


OptionItem event

API version 4

Event

iOS Android Windows

The following events are defined in the OptionItem class.

API | name | Explanation
4 | Touch | Occurs when changing the option button choices

Class overview

Base class event


OptionItem.Touch event

This event occurs when you change the options of the option button.

It occurs regardless of the operation from the screen or the operation from the script.

Note

In the handler of the event that occurred in OptionItem class, do not use the Value property of OptionButton class, which is the parent object, to refer to the selected item number . (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (OptionItem object) of the Event object passed as an argument of the event handler .


PulldownItem class

Object
 | NetObject
 |  | PulldownItem

A class that defines the choices of the PulldownList class. Be sure to array and use it as a child object of PuldownList class.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


PulldownItem property

API version 4

Property

iOS Android Windows

The following properties are defined in the PulldownItem class.

API | name | access | Type | initial value | Explanation
4 | Selected | CRW | boolean | $FALSE | Item selection status
4 | Title | CRW | String |  | The string displayed in the choices
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


PulldownItem.Selected property

The item is selected.

$TRUE if selected, $FALSE if not selected.


PulldownItem.Title property

The characters to display in the list.


PulldownItem.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.

The selected state of the choice can be specified by the Selected property, and the character to be displayed as the choice can be specified by the Title property.


PulldownItem method

API version 4

Method

iOS Android Windows

There are no methods defined in the PulldownItem class.

Class overview

Base class methods


PulldownItem event

API version 4

Event

iOS Android Windows

The following events are defined in the PulldownItem class.

API | name | Explanation
4 | Touch | Occurs when selecting an item in the pull-down list

Class overview

Base class event


PulldownItem.Touch event

This event occurs when you select an item in the pull-down list.

It occurs regardless of the operation from the screen or the operation from the script.

Note

In the handler of the event that occurred in the PulldownItem class, do not use the Value property of the parent object PulldownList class to refer to the selected item number . (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (PulldownItem object) of the Event object passed as an argument of the event handler .


PulldownList class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | PulldownList

A class that displays a pull-down list.

The PulldownList class works in concert with the PulldownItem class.

To set the data to display as a choice, you need to place an object of the PulldownItem class or one of its derived classes in a structure defined below the PulldownList object.

The apparent height of the pull-down list (height of the button part) differs from other DisplayObjects and varies depending on the font size.

It should be noted, TitleHeight by specifying the property, it is possible to directly set the height.

In Biz/Browser HT, color specification by BgColor property is invalid.

Object structure

Screen display example

The height property value is ignored in Biz/Browser HT.

The height of the list portion is adjusted according to the number of elements in the PulldownItem array.

When the DropdownStyle property is $STD, the maximum height is about 1/3 of the screen height, and when $FLOATING, it is about 80% of the screen height.

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
F4 | Display list (only when DropdownKey = 0)
UP | Move to the previous option
BOTTOM | Move to the next option

Default properties and ValueType

The default property is Value . The value type specification is invalid.

Precautions when scaling

◆ If TitleHeight property is not set, the apparent height (height not pulled down) is not affected by VerticalScale, but is affected by font size changes by FontScale.

◆ The width of the pull-down button is specified by the OS and is not subject to scaling.


PulldownList property

API version 4

Property

iOS Android Windows

The following properties are defined in the PulldownList class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color (This property is left for compatibility with the previous version and is not valid to specify)
HT (10) | DropdownKey | CR | integer |  | Key to drop down
HT (10) | DropdownStyle | CR | integer | $STD | How to display the selection list
5 | DropdownWidth | CR | integer | 0 | Drop-down width
20 | FloatingHeight | CR | integer | $STD | Pop-up height
20 | FloatingWidth | CR | integer | $STD | Pop-up width
4 | FgColor | CRW | integer | $STD | Text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | Ten | font size
5 | TitleHeight | CR | integer | 0 | Button height
4 | Value | CRW | integer |  | Selected position

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


PulldownList.DropdownKey property

Set the key to drop down.

If not set, the F4 key will be the drop-down key.

For the values ​​that can be specified for the DropdownKey property, refer to Key specification .


PulldownList.DropdownStyle property

Specifies the display style of the select list section.

Specify the following constants.

constant | value | Explanation
$STD | 0 | standard. List display at the bottom of the object
$FLOATING | 1 | Expand the list to the center of the screen and display it in a pop-up

The display position of the list when $FLOATING is specified is automatically adjusted according to the screen size.

In addition, the font is used by automatically adjusting the size of the currently specified font.


PulldownList.DropdownWidth property

Specifies the width of the dropdown (popup) in the pulldown list.
The default value is 0, which means the dropdown will be displayed with the default width.


PulldownList.FloatingHeight property

iOSAndroidWindows

Specify the height of pop-up list when DropdownStyle property is $FLOATING.

The default value is 0, which means the default height if 0 is specified.

Also, the maximum height is limited to approximately 80% of the screen height and no higher.

The height specified by this property is not scaled by the font size and the PulldownList will always be displayed at the set height.


PulldownList.FloatingWidth property

iOSAndroidWindows

Specify the width of pop-up list when DropdownStyle property is $FLOATING.
The default value is 0, which means the default width if 0 is specified.

The width specified by this property is not scaled by the font size and the PulldownList will always be displayed at the set width.


PulldownList.TitleHeight property

Specifies the height of the button part of PulldownList.
The default value is 0, which means the default height if 0 is specified.

The height specified by this property is not scaled by the font size and the PulldownList will always be displayed at the set height.


PulldownList.Value property

The array number of the currently selected list item.

-1 indicates the unselected state.


PulldownList method

API version 4

Method

iOS Android Windows

The following methods are defined in the PulldownList class.

API | name | Explanation
24 | ResetImage | Discard the image set by the SetImage method
24 | ResetPushedImage | Discards the image set by the SetPushedImage method
24 | SetButtonArea | Specify the area in PulldownList where text is not displayed
24 | SetImage | Set the image to be displayed on the PulldownList
24 | SetPushedImage | Set the image to be displayed on the PulldownList in the pushed state
20 | ShowDropdown | Show the pull-down list

Class overview

Base class methods


PulldownList.ResetImage method

Explanation

The image set by the SetImage method is discarded.

Call format

PulldownList1.ResetImage()

Return value

None

argument

None

exception

None

Example of use

PulldownList1.ResetImage();

Related item

SetImage method


PulldownList.ResetPushedImage method

Explanation

The image set by the SetPushedImage method is discarded.

Call format

PulldownList1.ResetPushedImage()

Return value

None

argument

None

exception

None

Example of use

PulldownList1.ResetPushedImage();

Related item

SetPushedImage method


PulldownList.SetButtonArea method

iOSAndroidWindows

Explanation

Specifies the area within the image set by the SetImage or SetPushedImageSetPushedImage method where text is not displayed.

This is only valid if the image is set using both the SetImage and SetPushedImage methods.

Call format

PulldownList1.SetButtonArea( width )

Return value

None

argument

integer width

Size of area not displaying text

exception

None

Example of use

PulldownList1.SetButtonArea(25);

Related item

SetImage、SetPushedImage method


PulldownList.SetImage method

Explanation

Set the image to be displayed on the PulldownList.

Call format

PulldownList1.SetImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

PulldownList1.SetImage(ImageList1.GetImage(0));
PulldownList1.SetImage("img/sample.png");

Related item

ResetImage method

Image , ImageList class


PulldownList.SetPushedImage method

Explanation

Set the image to be displayed on the PulldownList in the pushed state.

Call format

PulldownList1.SetPushedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

PulldownList1.SetPushedImage(ImageList1.GetImage(0));
PulldownList1.SetPushedImage("img/sample.png");

Related item

ResetPushedImage method

Image , ImageList class


PulldownList.ShowDropdown method

iOSAndroidWindows

Explanation

Show the pull-down list.

Call format

PulldownList.ShowDropdown( )

Return value

None

argument

None

exception

None

Example of us

PulldownList1.ShowDropdown( );

Related item


PulldownList event

API version 4

Event

iOS Android Windows

There are no events defined in the PulldownList class.

Class overview

Base class event


Root class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | Root

The Root class is a class corresponding to the window of Biz/Browser itself, and has a function to determine the operation of Biz/Browser.

The Root object is at the top of all objects and is the base point for the object tree.

Only one Root object is created in the application and can be accessed from anywhere by "//" on the CRS script.

For example, the value in the window title bar is

//.Title

You can get it at.

The Root object has a special child object called the SYS object that allows you to get system-specific information.

There is also a special function called OnException that handles global exceptions.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


Root property

API version 4

Property

The following properties are defined in the Root class.

API | name | access | Type | initial value | Explanation
9 | AllowUntrustCertificate | CRW | boolean | $FALSE | Specifies whether untrusted SSL / TLS server certificate can be used for communication
HT (10) | AutoDial | CRW | integer | Root.Up + Root.Down | It is retained for compatibility. It does not work.
4 | BackKeyMode | CRW | integer | Root.ConfirmClose | Specify the behavior when the "Back" button is pressed
4 | BgColor | CRW | integer | $STD | Background color
4 | CacheMode | CRW | integer | Root.CacheNetwork | Select communication method to be cached
HT (10) | DialEntry | CRW | String |  | It is retained for compatibility. It does not work.
4 | DisplayOrient | CRW | integer | Root.UNSPECIFIED | Screen rotation direction
4 | Height | CRW | integer |  | Vertical size of the display area inside the root window
28 | HighlightBgColor | CRW | integer | $STD | Background color of the object with focus
28 | HighlightBorderColor | CRW | integer | $STD | Border color of the object with focus
28 | HighlightOnFocus | CRW | boolean | $FALSE | Whether to change the border color or background color when focused
HT (10) | HttpRetryTime | CRW | integer | 0 | It is retained for compatibility. It does not work.
4 | HttpTimeout | CRW | integer | 0 | Communication timeout value
4 | Indicator | CRW | integer | Root.indAll | Display of status indicators at the bottom of the screen
HT (10) | MinimizeBox | CR | boolean | $TRUE | It is retained for compatibility. It does not work.
4 | ReloggedIn | R | boolean | $FALSE | Whether the Biz/Browser HT process has been killed by external factors
HT (12) | SelectAllOnFocus | CR | integer | $NONE | Specifies whether to select all existing text when the focus is received by an operation other than tap
20 | ShowCoredumpProgress | CRW | Integer | 0 | Specify whether to show the progress of core dump when an exception occurs
HT(15) | ShowSIPOnFocus | CR | integer | $STD | Specifies whether SIP is displayed when keyboard focus is received.
4 | Title | CRW | String |  | Root window title text
HT (10) | UseHttpPreconfig | CRW | boolean | $TRUE | It is retained for compatibility. It does not work.
16 | UserLanguage | CRW | Integer | $STD | Specify the locale ID to be used in the app
4 | Value | CRW | String |  | The value of the object
4 | Width | CRW | integer |  | Horizontal size of the display area inside the root window
4 | X | CRW | integer |  | Horizontal display position of root window
4 | Y | CRW | integer |  | Vertical display position of root window

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Root.AllowUntrustCertificate property

Specifies whether an untrusted SSL/TLS server certificate can be used for communication.

Specify $TRUE if you want to communicate with a self-certified certificate or an expired certificate during development.

Note that communication using untrusted SSL/TLS server certificates is not secure, so it is not recommended to use it in the operation phase such as the production environment.

The default value is $FALSE.


Root.BackKeyMode property

Specify the behavior when the "Back" button is pressed.

Specify in combination with the following constants or specify 0.

constant | Explanation
Root.ConfirmClose | A confirmation message will be displayed when the button is pressed.

If you specify 0, the operation does not display the end confirmation message.

When Root.ConfirmClose is specified, the completion confirmation message is displayed when the button is pressed the first time, and the Close event is issued when the button is pressed the second time.

If not specified, the Close event will be issued immediately.

The initial value is Root.ConfirmClose.


Root.CacheMode property

Select the communication method to be cached.

Specify by combining the following constants.

constant | value | Explanation
Root.CacheOff | 0 | Do not allow cache
Root.CacheNetwork | 1 | Allows caching when communicating with http and https protocols
Root.CacheLocalFile | 2 | Allow cache when communicating with file protocol

If the "Use local cache" option is not enabled on the setting screen displayed by selecting "View" → "Settings" from the Biz / Browser menu, caching will not be performed regardless of the value of this property. Hmm.

The initial value is Root.CacheNetwork.

Related item

CacheSetup method

NetObject.Cache method


Root.DisplayOrient property

API version 4

Root.DisplayOrient property Change History

Android

Property to get or set the rotation direction of the screen. The specified value is an absolute value, not a relative value.

Whether the setting is valid and the orientation of the 0 degree state depends on the model.

Specify one of the following values

constant | Explanation
Root.UNSPECIFIED | Not controlled (standard condition)
Root.LANDSCAPE | Fixed in horizontal direction. (Rotation of 180 degrees is not controlled.)
Root.PORTRAIT | Fixed in vertical direction. (Rotation of 180 degrees is not controlled.)
Root.LANDSCAPE_FIX *1 | Fixes in horizontal direction. (It also controls 180 degree rotation.)
Root.LANDSCAPE_REVERSE_FIX *1 | Fixes the orientation to the horizontal direction, which is 180 degrees rotated from Root.LANDSCAPE_FIX. (It also controls 180 degree rotation.)
Root.PORTRAIT_FIX *1 | Fixes the vertical direction. (It also controls 180 degree rotation.)
Root.PORTRAIT_REVERSE_FIX *1 | PORTRAIT_FIX to the orientation rotated 180 degrees. (It also controls 180 degree rotation.)
Root.deg0 | This is left for compatibility. The behavior is the same as when Root.PORTRAIT is set.
Root.deg90 | This is left in for compatibility. The behavior is the same as when Root.LANDSCAPE is set.
Root.deg180 | This is left for compatibility. The behavior is the same as when Root.PORTRAIT is set.
Root.deg270 | This is left in for compatibility. The behavior is the same as when Root.LANDSCAPE is set.

The default value is Root.UNSPECIFIED.

Restrictions
If Root.LANDSCAPE or Root.PORTRAIT is specified, the rotation direction will be fixed in the vertical/horizontal direction respectively, but the rotation of 180 degrees cannot be controlled.
For example, if the device is turned upside down, it will be rotated 180 degrees.
If you want to fix the screen orientation, you can either set the orientation to portrait/landscape using the OS settings without setting the Orient property,
or use the LANDSCAPE_FIX, Root.LANDSCAPE_REVERSE_FIX, Root.PORTRAIT_FIX, and Root.PORTRAIT_REVERSE_FIX.
Also, to enable Root.PORTRAIT_REVERSE_FIX, you need to enable auto-rotation of the screen in the OS settings.

Change History
*1　The specification has been changed since API version 19.


Root.Height property

Indicates the vertical size of the display area inside the root window.

This property is read-only and cannot be updated.

Change history
*1 The specifications have been changed from API version 9.


Root.HighlightBgColor property

iOSAndroidWindows

If the HighlightOnFocus property is $TRUE, a color constant specifies the background color when the object placed below the root is focused.

Applies to classes derived from the FocusObject class.

If $STD is specified, it will be drawn with the specified value of the BgColor property.

The default value is $STD.


Root.HighlightBorderColor property

iOSAndroidWindows

If the HighlightOnFocus property is $TRUE, a color constant specifies the border color when the object placed below the root is focused.

Applies to classes derived from the FocusObject class.

However, it does not apply to the following classes:

  • CanvasView class
  • CheckItem class
  • MediaPlayer class
  • MediaRecorder class
  • OptionItem class
  • SwitchItem class

If $STD is specified, it will be drawn with the specified value of the BorderColor property.

The default value is $STD.


Root.HighlightOnFocus property

iOSAndroidWindows

Specifies whether to change the border color and background color when an object placed below the root is focused.

Applies to classes derived from the FocusObject class.

The border color and background color are specified by the HighlightBgColor and HighlightBorderColor properties respectively.

The default value is $FALSE.


Root.HttpTimeout property

Specifies the default timeout value for Biz/Browser communication in seconds.

If you specify 0, the setting is canceled and the standard timeout time of the OS is used.

The default setting is 0.

The specified timeout value is not canceled even if Biz/Browser is initialized by the Login method. It is valid regardless of the connection destination until the Biz/Browser process ends.

Since it is initialized (not saved) after restarting Biz/Browser, normally set the HttpTimeout property in the first CRS to be executed after starting.

* The standard timeout value of the OS conforms to the OS specifications.


Root.Indicator property

Controls the display of the status indicator at the bottom of the screen.

Specify display / non-display with the following values

constant | Explanation
Root.indOff | Do not show
Root.indAll | Show all
Root.indEngine | Show CRS compiling and running
Root.indFile | Show file being accessed
Root.indNet | Show communication

The initial value is indAll.


Root.ReLoggedIn property

True if the Biz/Browser HT process was killed by an external factor and then automatically restarted.

The initial value is $FALSE.

The value will be reset when the Biz/Browser is initialized by the Login method.

The initial value is $FALSE.


Root.SelectAllOnFocus property

Specifies whether or not to select all existing text when the focus is received by an operation other than tapping for all EditObjects (excluding NumberEdit and DateEdit) on the screen.

The values ​​that can be set are as follows.

constant | value | Explanation
$STD | 0 | Select all
$NONE | 1 | Do not select all (default value)


Root.ShowCoredumpProgress property

iOSAndroidWindows

Specify whether to show the progress of core dump when an exception occurs.

constant | value | explanation
$HIDE | 0 | Always hidden
$EXCEPT_UNCAUGHT | 1 | Display when the OnException is not implemented and no exception is caught
$SHOW | 2 | Always display

The default value is $HIDE.


Root.ShowSIPOnFocus property

iOSAndroidWindows

Specifies whether SIP should be displayed for all TextBox, EditBox, NumberEdit, DateEdit, MaskEdit, and FlexTextBox on the screen when they receive keyboard focus.

The values that can be set are as follows

constant | value | explanation
$STD | 0 | Follow the default behavior of IMEMode (default value)
$CLOSE | 4096 | When $OPEN,$SIP_OPEN is not set in EditObject.IMEMode property, SIP is not displayed.
$OPEN | 8192 | Reserved for future use. Will not work.


Root.MinimizeBox property

This property is retained for compatibility. Nothing happens when I operate it.


Root.Title property

The characters that appear in the title bar of the root window.


Root.UserLanguage property

iOSAndroidWindows

Specify the locale ID and switch the language to be used in the app.

constant | value | explanation
$STD | 0 | System Locale
$EN | 1033 | English
$JA | 1041 | Japanese
$ZH | 2052 | Chinese (Simplified)

It is enabled from the CRS loaded by the NetObject.Get method after the resource ID is specified.

If an unrecognized resource ID is specified, it will be treated as English.

However, some wording, such as the dialogs displayed by the FileSystem.OpenDialog and FileSystem.SaveDialog methods, are not affected by the UserLanguage property.

Calling the Logout method will return you to the system locale.

The default value is $STD.


Root.Value property

The value of the object.

The value of this property does not affect the behavior of the object.


Root.Width property

Indicates the horizontal size of the display area inside the root window.

This property is read-only and cannot be updated.

Change history
*1 The specifications have been changed from API version 9.


Root.X property

This property is retained for consistency with other versions.

The X property value is always 0.

Change history
*1 The specifications have been changed from API version 9.


Root.Y property

This property is retained for consistency with other versions.

The value of the Y property is always 0.

Change history
*1 The specifications have been changed from API version 9.


Root.AutoDial property

This property is retained for compatibility. Nothing happens when I operate it.


Root.DialEntry property

This property is retained for compatibility. Nothing happens when I operate it.


Root.HttpRetryTime property

This property is retained for compatibility. Nothing happens when I operate it.


Root.UseHttpPreconfig property

This property is retained for compatibility. Nothing happens when I operate it.


Root method

API version 4

Method

The following methods are defined in the Root class.

API | name | Explanation
4 | CacheSetup | Display the cache setting dialog
HT (10) | CopyString | Copy the string to the clipboard
4 | DecideValue | Forces the value of an object whose input is unconfirmed
4 | DeleteCache | Delete cache
HT (10) | Dial | It is retained for compatibility. It does not work.
4 | GetBookmark | Get a list of bookmarks
9 | GetClientCertificateList | Get a list of client certificates that have been imported
4 | GetDesktopHeight | Gets the vertical size of the desktop This feature has been removed from API version 6.
4 | GetDesktopWidth | Gets the horizontal size of the desktop This feature has been removed from API version 6.
6 | GetFocus | Returns the object that currently has focus
9 | GetUsingClientCertificate | Get the client certificate used for communication
9 | ImportClientCertificate | Import the client certificate (PKCS # 12 format)
9 | IsClientCertificateAutoSelect | Acquires whether the client certificate used during communication is automatically selected
9 | IsNetworkAccessible | Returns whether the network is valid
4 | Login | Log in to the specified server
4 | Logout | Log out
HT (10) | PasteString | Get a string from the clipboard
HT (16) | RemapKeyName | Allows arbitrary keystrokes from the keyboard to be treated as separate keystrokes.
4 | RemBookmark | Delete bookmark entry
19 | ScreenShot | Take a screenshot of the screen
4 | SetBookmark | Add or change bookmark entries
9 | SetClientCertificate | Specify the client certificate to use during communication
HT (10) | SetCompatibleMode | Specify whether to enable Mobile compatibility mode
19 | SetFullScreenMode | Controls the display of the navigation bar and status bar
HT (10) | SetUserSIP | It is retained for compatibility. It does not work.
4 | SetWareki | Specifies the Japanese calendar year and period
4 | ShowMenu | Specify whether to show or hide the menu bar
4 | SLogin | Log in to the specified server in single session mode
4 | SetRelogInURL | Specify the re-login destination for automatic restart.
4 | SetMemoryLimitThreshold | Set the threshold for issuing a memory usage warning event. This feature has been removed from API version 6.
4 | GetPowerState | Get power and battery status
4 | ShowSIP | Controls the display of SIP (Software Input Panel)

Class overview

Base class methods


Root.CacheSetup method

Explanation

Displays the cache setting dialog.

Call format

//.CacheSetup()

Return value

None

argument

None

exception

None

Example of use

Function OnTouch(e){
    //.CacheSetup();
}

Related item

CacheMode property

NetObject.Cache method


Root.CopyString method

Explanation

Copy the string to the clipboard.

Call format

//.CopyString( text )

Return value

None

argument

String text

Specify the character string to copy

exception

None

Example of use

//.CopyString("text data");

Related item

PasteString method


Root.DecideValue method

Explanation

Forces the value of an object whose input is unconfirmed.

Derived classes of the EditObject class determine the value you are typing when keyboard focus is lost or when you press Enter. Prior to that, the value entered on the screen is not set in the Value property and is in an undetermined state.

The DecideValue method forces the Value property to set the value of such an undetermined object.

It is used when handling the input value in the event handler that does not involve the input confirmation operation such as the Clicked event and Timer event of the Label object.

By calling the DecideValue method, events related to value changes such as Touch event and Change event may occur.

Call format

//.DecideValue()

Return value

None

argument

None

exception

None

Example of use

Form frm1 {
   ::
   TextBox tb {
      :
   }
   Function OnClicked(e) {
      //.DecideValue();
      MessageBox("The input value is" + tb.Value + "");
   }
}

Related item


Root.DeleteCache method

Explanation

Deletes the cache indicated by the URI .

You cannot delete the cache generated from a server other than the server that downloaded the CRS file that called the DeleteCache method.

The protocol (http://) and host name cannot be specified in the URI , and even if they are included, they will be ignored. This is a constraint provided to prevent unintentional deletion of the cache used by another application.

One thing to note about this constraint is the cache control of the image file. Image files that are loaded by URL into ImageLabel objects etc. are also cached, but if the image file is downloaded from a server different from the application, there is no way to delete the cache of that image file from the script.

Call format

//.DeleteCache([ URI ])

Return value

None

argument

String URI

Specify the URI to delete.

If omitted, all caches from the server that downloaded the CRS file that called the DeleteCache method will be deleted.

If * (asterisk) is specified at the end of the URI , all prefix-matching URLs will be deleted. The cache to be deleted is determined by the prefix match in the URL string comparison, so no distinction is made between directory names and file names.

exception

None

Example of use

//.DeleteCache("/app1/form1.crs");

Related item

cachedate function


Root.GetBookmark method

Explanation

Get a list of bookmarks.

Bookmarks are a list of connection destination URLs saved by Biz/Browser and are automatically registered when you log in. Bookmarks are retained even when you exit Biz/Browser, and you can use them the next time you start them.

The bookmark list is displayed on the standard login screen of Biz/Browser, and you can select the URL to log in to.

You can add a title string to your bookmarks. Bookmarks can be edited with the SetBookmark and RemBookmark methods.

Call format

var list = //.GetBookmark()

Return value

Returns an array of Record objects with the following child objects:

Type | name | Explanation
String | url | Bookmark URL
String | title | Bookmark title

argument

None

exception

None

Example of use

var list = //.GetBookmark();
for(var n = 0; n < list.length; n++){
    print(list[n] .url, list[n] .title, "\n");
}

Related item

SetBookmark , RemBookmark method


Root.GetClientCertificateList method

Explanation

Gets a list of client certificates that have been imported.

Call format

var certList = //.GetClientCertificateList()

Return value

Returns an array of Record objects containing the certificate information.

If the certificate information could not be obtained, an empty array of Record objects is returned.

The format of the certificate information is as follows.

Record certificateInfoList[]{
    /* SHA-256 hash of the certificate. The certificate can be uniquely identified. Used by setClientCertificate */
    ByteArray Digest;
    /* Certificate serial value */
    ByteArray SerialNumber;
    /* Certificate validity period (start date) */
    Date EffectiveDate;
    /* Certificate validity period (end date) */
    Date ExpiryDate;
    /* Subject information: Common name, country name, organization name, email address */
    String SubjectCommonName;
    String SubjectCountryName;
    String Subject Organization;
    String SubjectEmailAddress;
    /* Issuer (issuer) information: Common name, country name, organization name, email address */
    String IssuerCommonName;
    String IssuerCountryName;
    String Issuer Organization;
    String IssuerEmailAddress;
}

argument

None

exception

None

Example of use

var digest = null;
var certList = //.GetClientCertificateList();
for(var idx in certList){
    var cert = certList [idx];
    /* Find an issuer with a matching common name */
    if(cert.IssuerCommonName == "ExampleCommonName"){
        digest = cert.Digest;
        break;
    }
}
/* Use discovered client certificate */
if(digest! = null) //.SetClientCertificate(digest);

Related item

SetClientCertificate method


Root.GetDesktopHeight method

iOS Android

This feature has been removed from API version 6.


Root.GetDesktopWidth method

iOS Android

This feature has been removed from API version 6.


Root.GetFocus method

Explanation

Gets the focused object in the currently displayed form.

Call format

var obj = //.GetFocus()

Return value

Returns the object that currently has focus.

argument

None

exception

None

Example of use

var obj = //.GetFocus();
obj.Title = "Focus Now.";

Related item

FocusObject.SetFocus method


Root.GetUsingClientCertificate method

Explanation

Get the client certificate used for communication.

Calls to this method will always return null if the IsClientCertificateAutoSelect method returns $TRUE.

Call format

var cert = //.GetUsingClientCertificate()

Return value

If the client certificate to be used for communication is acquired, information of the certificate will be returned, otherwise null will be returned.

The format of the certificate information is as follows.

Record certificateInfo{
    /* SHA-256 hash of the certificate. The certificate can be uniquely identified. Used by setClientCertificate * /
    ByteArray Digest;
    /* Certificate serial value */
    ByteArray SerialNumber;
    /* Certificate validity period (start date) */
    Date EffectiveDate;
    /* Certificate validity period (end date) */
    Date ExpiryDate;
    /* Subject information: Common name, country name, organization name, email address */
    String SubjectCommonName;
    String SubjectCountryName;
    String Subject Organization;
    String SubjectEmailAddress;
    /* Issuer (issuer) information: Common name, country name, organization name, email address */
    String IssuerCommonName;
    String IssuerCountryName;
    String Issuer Organization;
    String IssuerEmailAddress;
}

argument

None

exception

None

Example of use

var cert = //.GetUsingClientCertificate();
if(cer! = null){
    MessageBox("The currently used certificate has an expiration date of" + cert.ExpiryDate.toString() + "until");
}

Related item

GetClientCertificateList method

IsClientCertificateAutoSelect method


Root.ImportClientCertificate method

Explanation

Import the client certificate (PKCS#12 format).

The imported certificate is stored in the certificate management mechanism of each platform.

Android version

It is saved in the Key Store.

When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later,

it is necessary to obtain permission from the OS by user operation.

For more information, see File access for Android 11 and later.

Call format

//.ImportClientCertificate( URL or Reader [, password ])

Return value

None

argument

String URL or reader

Certificate URL or Reader object.

String password

Specify the certificate password.

If omitted, it is regarded as an empty string.

exception

FUNC-4

Invalid argument

PKG-65

Failed to import client certificate

Example of use

//.ImportClientCertificate("http://test.example.com/cert/certificate.p12");

Related item

GetClientCertificateList method


Root.IsClientCertificateAutoSelect method

Explanation

Acquires whether the client certificate used during communication is automatically selected.

If this method returns $FALSE, you must specify the client certificate to use in the SetClientCertificate method to communicate using the client certificate .

If this method returns $TRUE, the call to the SetClientCertificate method will be ignored and the appropriate client certificate will be automatically selected.

Call format

var autoSelect = //.IsClientCertificateAutoSelect()

Return value

Returns $TRUE if automatically selected, $FALSE otherwise.

argument

None

exception

None

Example of use

if(!//.IsClientCertificateAutoSelect()){
    //.SetClientCertificate(...);
}

Related item

GetUsingClientCertificate method

SetClientCertificate method


Root.IsNetworkAccessible method

Explanation

Returns whether the network is valid.

This method returns whether the terminal is connected to any network.

In an environment where communication is likely to be interrupted or when offline is assumed, smooth processing can be realized by using this method to determine whether communication is possible beforehand.

Even if this method returns $TRUE, it cannot be determined if all servers can be contacted in all situations.

Therefore, even if you use this method, it is recommended to continue to properly handle exception handling and HTTP status code check during communication.

Call format

var accessible = //.IsNetworkAccessible()

Return value

Returns $TRUE if the network is valid, $FALSE otherwise.

argument

None

exception

None

Example of use

if(//.IsNetworkAccessible ()){
    /* Network connection status */
    try{
        csvdoc.get("data.csv");
    }catch (e){
        ...
    }
    ...
}else{
    //.MessageBox("Not connected to the network. Processing will be stopped. ");
}

Related item


Root.Login method

Explanation

Log in to the specified server.

For login , refer to the operation when logging in to Biz/Browser .

If all parameters are omitted, the login screen will be displayed.

All current sessions will be disconnected and all existing objects will be deleted.

Since Biz/Browser is initialized by calling the Login method, the CRS program described after the Login method will not be executed.

Describe the operation after login in the CRS program specified in the URI .

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later,
it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

//.Login([ server [, URI ]])

Return value

None

argument

String server

Server URL to connect to

String URI

Path of resource to connect

exception

None

Example of use

Login("http://server1:81", "/app1/mainmenu.crs");

Related item

Logout , SLogin methods


Root.Logout method

Explanation

Log out and display the login screen.

All current sessions will be disconnected and all existing objects will be deleted.

Since Biz/Browser is initialized by calling the Logout method, the CRS program described after the Logout method will not be executed.

Call format

//.Logout()

Return value

None

argument

None

exception

None

Example of use

Function OnTouch(e){
    //.Logout();
}

Related item

Login , SLogin methods


Root.PasteString method

Explanation

Gets the string from the clipboard.

If the clipboard does not contain a string, an empty string is returned.

Call format

var t = //.PasteString()

Return value

String retrieved from the clipboard

argument

None

exception

None

Example of use

vat t = //.PasteString();
print(t, "\n");

Related item

CopyString method


Root.RemapKeyName method

iOSAndroidWindows

Explanation

Allows arbitrary keystrokes from the keyboard to be treated as separate keystrokes.

For example, the Form.KeyDown event is not fired, but when the hardware key "KEYCODE_BUTTON_1" recognized by the OS is pressed, the KeyDown event can be fired as if the "F1" key is pressed.

KeyDown event can also be set by overriding the setting, but the program may not work as expected, so please check the operation thoroughly before using it.

The settings made by this function are effective until you log out or quit Biz/Browser.

As of Biz/Browser HT(Android) 1.2.2, only Form.KeyDown event and Form.KeyUp event are valid.

Call format

//.RemapKeyName( keyCode, keyName )

Return value

None

argument

Integer keyCode

Specify the key code of the key recognized by the Android OS.

You can specify the key code value listed on the "KeyEvent Class" page of the Android Developers site.

String keyName

Specifies the key to be assigned to the input of the key specified by keyCode by the name of the key indicated by the e.key variable of the Form.KeyDown event.

In addition to the key name, any string other than an empty string can be specified.

exception

FUNC-4

Invalid argument.

Example of use

/* When BUTTON1 is pressed, it is treated as a TEST key. */
//.RemapKeyName(188, "TEST");

/* When A is pressed, it is treated as the F1 key. */
//.RemapKeyName(29, "F1");

Function OnKeyDown(e){
 //.MessageBox("KeyDown: " + e.key);
}

Related item


Root.RemBookmark method

Explanation

Delete the bookmark entry.

Specify the URL that is already registered in the bookmark and delete the bookmark.

When running a test from Biz/Designer, the edited bookmarks are not saved and will be restored at the end of the test run.

Call format

//.RemBookmark([ URL ])

Return value

None

argument

String URL

URL of the bookmark to delete

If omitted, or if an empty string is specified, all bookmarks will be deleted.

exception

None

Example of use

//.RemBookmark("http://server/app/menu.crs");

Related item

SetBookmark , GetBookmark methods


Root.ScreenShot method

iOSAndroidWindows

Explanation

Get a screenshot of the screen.

Android version
When you use this feature, a screen will appear asking if you want to capture your screen.
For Android 14 or later, depending on the OS build version, a screen will appear where you can select the capture target from "A single app" or "Entire screen."
If this screen appears, select "Entire screen".

Call format

var img = //.ScreenShot()

Return value

Image object containing the screenshot image.

argument

None

exception

PKG-68

Failed to get a screenshot.

Example of use

Function OnTouch(e){
    var img = //.ScreenShot();
    ^.imageLabel.SetImage(img);
}

Related item


Root.SetBookmark method

Explanation

Add or change bookmark entries.

If you specify a new URL , it will be added to the end of the bookmark list.

If you specify the same URL as the one already registered , the title of the bookmark will be replaced.

When running a test from Biz/Designer, the edited bookmarks are not saved and will be restored at the end of the test run.

Call format

//.SetBookmark ( URL [, title ])

Return value

None

argument

String URL

Bookmark URL to add or change

Only character strings that can be recognized as URLs can be registered correctly.

String title

Bookmark title

If omitted, the title will be blank.

exception

None

Example of use

//.SetBookmark ("http://server/app/menu.crs", "business menu");

Related item

RemBookmark , GetBookmark method


Root.SetClientCertificate method

Explanation

Specify the client certificate to use during communication.

Calls to this method are ignored if the IsClientCertificateAutoSelect method returns $TRUE.

If the IsClientCertificateAutoSelect method returns $FALSE, the first client certificate found is specified immediately after login.

Call format

//.SetClientCertificate(digest)

Return value

None

argument

ByteArray digest

Specify the digest value (SHA-256 hash) of the client certificate to use.

The digest value can be obtained from the "digest" child object of the Record object returned by the GetClientCertificateList method.

If you pass null or an empty ByteArray, it is specified not to select the client certificate during communication.

exception

FUNC-4

Invalid argument

Example of use

var digest = null;
var certList = //.GetClientCertificateList();
for(var idx in certList){
    var cert = certList[idx];
    /* Find an issuer with a matching common name */
    if(cert.IssuerCommonName == "ExampleCommonName"){
        digest = cert.Digest;
        break;
    }
}
/* Use discovered client certificate */
if(digest! = null) //.SetClientCertificate(digest);

Related item

GetClientCertificateList method

GetUsingClientCertificate method


Root.SetCompatibleMode method

Explanation

Specifies whether to enable Mobile compatibility mode.

From the time you call this method until the Biz/Browser app finishes executing , CRS will be started with the compatibility mode turned ON / OFF from the next login .

This setting will be reset when you exit the Biz/Browser app. Immediately after starting the application, the compatibility mode is OFF.

When you enable this setting, the following behaviors change mainly.

  (1) The character code specified by the character string and String class will behave as Shift-JIS. * Note that the GUI control display remains Unicode.

  (2) Some GUI control-type objects change the behavior according to Biz/Browser Mobile products.

Call format

//.SetCompatibleMode(mode)

Return value

None

argument

boolean mode

Specify whether to turn on the compatibility mode.

If you set $TRUE, it will start in compatibility mode for subsequent logins. When it is $FALSE, it is invalid.

exception

None

Example of use

//.SetCompatibleMode(true);
//.Login("http://path/to/Login.crs");

Related item


Root.SetFullScreenMode method

iOSAndroidWindows

Explanation

Controls the display of the status bar and navigation bar displayed by the system.

Call format

//.SetFullScreenMode( mode )

Return value

None

argument

Integer mode

Specifies how to control the status bar and navigation bar.
The values that can be specified are as follows

constant | value | explanation
Root.FullScreenMode_NotFullScreen | 0 | Leaves the navigation bar and status bar uncontrolled and visible.
Root.FullScreenMode_ImmersiveSticky | 4 | Hides the navigation bar and status bar. Swiping at the top or bottom of the screen will cause the bar to become translucent and visible. After a certain amount of time has passed, the bar will be hidden.

exception

FUNC-4

Invalid argument value

Example of use

//.SetFullScreenMode(Root.FullScreenMode_ImmersiveSticky);

Related item


Root.SetWareki method

Explanation | Specify the year and period of the Japanese calendar. The year specified using this method will be applied until the Biz/Browser is restarted or the Login method is called. Please note that the year cannot be deleted or changed during execution.
Call format | //.SetWareki ( sym , sym2 , from )
Return value | None
argument | String sym | Year string
 | String sym2 | Year abbreviation
 | Date from | Specify the start date of the year specified by sym in Date type. The specified date isincluded in the year specified by sym .
exception | None |
Example of use | //.SetWareki("year", "N", "2080/1/1");
Related item |


Root.ShowMenu method

Explanation

Specifies the display of the command bar or status bar.

The menu is displayed in the initial state immediately after startup. When the Login and Logout methods are executed, it will return to the initial state.

Specify a value for mode to change the display / non-display status. It is displayed in the initial state immediately after startup.

Call format

//.ShowMenu( mode )

Return value

None

argument

integer mode

Specify with the combination of the following values.

constant | value | Explanation
Root.Hide | 0 | Hidden
Root.CommandBar | 1 | Show Main Menu Button
Root.StatusBar | 2 | Show status bar
Root.TaskBar | 4 | It is retained for compatibility. It does not work
Root.SIPBar | 8 | It is retained for compatibility. It does not work
Root.TitleBar | 16 | Show title bar

exception

None

Example of use

//.ShowMenu(Root.CommandBar + Root.StatusBar);

Related item


Root.SLogin method

Explanation

Logs in to the specified server in single session mode.

All current sessions are disconnected and all existing objects are deleted.

The Biz/Browser is initialized by calling the SLogin method, so the CRS programs described after the SLogin method will not be executed.

Please describe the operation after login in the CRS program specified in the URL .

Single session mode

While the session started by the SLogin method is valid, Biz / Browser is in single session mode and cannot communicate with the server other than the connection destination specified in the URL .

In addition, debug information (core dump) will not be output even if an exception that is not trapped occurs during single session mode.

These restrictions are provided for applications that require a high level of security, and when used in combination with the HttpSession.IsLoginSession method, it is possible to prevent CRS programs that are not intended by the application from being loaded at the same time. I can do it.

Note, however, that the effect of the SLogin method does not work on the individual URLs that make up your application.

HTTPS communication is indispensable in order to achieve a high level of security correctly, and it is necessary to build a mechanism on the server side to prevent connections to URLs that the application does not intend.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

//.SLogin( URL )

Return value

None

argument

String URL

URL to connect to

Unlike the Login method, the connection destination is specified collectively by URL instead of specifying Server and URI individually.

exception

None

Example of use

var session = getHttpSession();
if(session.IsLoginSession($TRUE)){
    //.Get("main.crs");
}else{
    //.SLogin("https://server/login.crs");
}

Related item

Login , Logout methods

HttpSession.IsLoginSession method


Root.Dial method

This method is retained for compatibility. Nothing happens when I operate it.


Root.GetPowerState method

Explanation

Get the power and battery status.

The items that can be acquired depend on the model.

Call format

var state = //.GetPowerState()

Return value

Returns a Record object with the following child objects:

Type | name | Explanation
Number | ACPower | -1: Unknown, 0: No power connection, 1: Power connection
Number | BatteryLifeLevel | -1: Unknown, 0 (minimum) to 100 (maximum)
Number | BatteryLifeTime | -1: Unknown, 0 or more: Remaining time (seconds) Android version cannot get the remaining time.

argument

None

exception

None

Example of use

var state = //.GetPowerState();
if(state.BatteryLifeLevel >= 0){
    print("Battery level", state.BatteryLifeLevel, "%\n");
}

Related item


Root.SetUserSip method

This method is retained for compatibility. Nothing happens when I operate it.


Root.ShowSIP method

Explanation

Controls the display of the SIP (Software Input Panel).

Call format

//.ShowSIP( mode )

Return value

None

argument

integer mode

Set display / non-display of SIP.

It is not possible to control the SIP input mode due to OS restrictions.

Android version
SIP may not be controlled correctly depending on the Android version IME application.

The SIP display control when a value is set in the ShowSIP method is as follows.

If you specify the SIP display value and the SIP non-display value at the same time, the SIP is not displayed.

constant | value | motion
$CLOSE | 4096 | Do not show SIP
$OPEN | 8192 | Show SIP

The following constants can also be specified for compatibility with other Biz/Browser products.

constant | value | motion
$SIP_CLOSE | 0x10000000 | Do not show SIP
$ALPHA | 2 | Show SIP
$KANA | 8
$DALPHA | 32
$DKANA | 128
$DHIRA | 256
$SIP_OPEN | 0x20000000

exception

None

Example of use

//.ShowSIP($OPEN);

Related item


Root.SetReLoginURL method

Explanation

Specify the URL to perform the login process when the Biz/Browser HT process is restarted automatically after it is killed by an external factor.

If the re-login destination is not specified, the standard login screen will be displayed the next time the application is started.

The re-login destination at the time of automatic restart set by this method will be automatically set to the same one after re-login, but it will be reset if the application is terminated normally or if you log in to a different CRS again. ..

If you want to save the data at a safe timing, save the data when you receive $ACTIVITY_ON_PAUSE or $BACK of the WindowStateChanged event.

For details , see Features and restrictions of Android version .

Call format

//.SetReLoginURL( URL )

Return value

None

argument

String URL

Specify the URL of the login destination CRS with an absolute path.

exception

None

Example of use

//.SetReLoginURL("http://test.example.com/crs/relogin.crs");

Related item

ReloggedIn Property


Root.SetMemoryLimitThreshold method

iOS Android

This feature has been removed from API version 6.

Explanation

Set the threshold for issuing a memory usage warning event.

The memory that Biz / Browser SmartDevice can use is very limited to about 16MB-48MB, which is the same as general Android apps, and the maximum memory size is different for each device, so it is necessary to pay attention to the memory usage. There is.

Therefore, if the memory usage exceeds the threshold while the threshold is set using this method, the MemoryLimitExceeded event is issued only once and the threshold is reset.

If you want to monitor the memory usage continuously, call this method again.

Even if the threshold is set, an OutOfMemory error will occur if the maximum memory usage is reached before the MemoryLimitExceeded event occurs , so the event does not occur reliably before stopping due to insufficient memory. Please be careful.

Call format

//.SetMemoryLimitThreshold( threshold )

Return value

None

argument

Number threshold

Set the threshold for issuing a memory usage warning event.

The unit is MB.

A zero or negative value resets the threshold settings.

exception

None

Example of use

//.SetMemoryLimitThreshold(24.0);

Related item

ReloggedIn property, MemoryLimitExceeded event


Root event

API version 4

Event

The following events are defined in the Root class.

API | name | Explanation
15 | BluetoothBondingFinished | Occurs when the bonding (pairing) process with the Bluetooth device is completed.
15 | BluetoothDeviceFound | Occurs when a device is detected by scanning for Bluetooth devices.
15 | BluetoothScanFinished | Occurs when a Bluetooth device scan is finished or cancelled.
15 | BluetoothScanStarted | Occurs when a scan for Bluetooth devices is started.
4 | Close | Occurs when closing the root window
HT (10) | ExternalCall | It is retained for compatibility. Does not occur.
HT (10) | PowerStateChanged | Occurs when the device wakes from sleep
4 | WindowStateChanged | Occurs when the root window state changes
4 | MemoryLimitExceeded | Occurs when the memory usage set in the MemoryLimitThreshold property is exceeded. This feature has been removed from API version 6.
4 | ExternalMessage | Obtained by ExternalObject.getMessageHandler Occurs when a message is received by the message handler
4 | ExternalIntent | Occurs when receiving an Intent from another app
23 | SmaPriPrinterConnectionChanged | Occurs when the SmaPriPrinter class connects to or disconnects from the printer
23 | SmaPriPrintFinished | Occurs when printing by SmaPri class succeeds
23 | SmaPriPrintFailed | Occurs when printing by the SmaPri class fails
23 | SmaPriPrintCommandFinished | Occurs when a print command is successfully sent by the SmaPri class
23 | SmaPriPrintCommandFailed | Occurs when sending a print command by the SmaPri class fails
23 | SmaPriPrintSendDataFinished | Occurs when data is successfully sent by the SmaPri class
23 | SmaPriPrintSendDataFailed | Occurs when data transmission by the SmaPri class fails

Class overview

Base class event


Root.BluetoothBondingFinished event

iOSAndroidWindows

Issued when the bonding (pairing) process with the Bluetooth device by the RequestBonding method is completed.

The following child objects are attached to the Event object.

type | name | explanation
String | DeviceId | The BD address of the target Bluetooth device is stored. (The format of BD address is the same as MAC address.)
String | Name | The name of the target Bluetooth device is stored.
Number | ConnectableAsBluetoothClassic | If the device can be connected as a Bluetooth Classic device, $TRUE is stored, and if not, $FALSE is stored.
Number | ConnectableAsBluetoothLE | If the device can be connected as a BLE (Bluetooth Low Energy) device, $TRUE is stored, and if it cannot be connected, $FALSE is stored.
Number | HasRssi | The RSSI value (Received Signal Strength Indication) is stored as $TRUE when it is available, and $FALSE when it is not. There are some BLE devices that do not have RSSI value.
Number | Rssi | If HasRssi is $TRUE, the RSSI value is stored. The unit is dBm. If HasRssi is $FALSE, this object is not added.
Number | HasTxPowerLevel | If it has a transmit output value, $TRUE is stored; if not, $FALSE is stored.
Number | TxPowerLevel | When HasTxPowerLevel is $TRUE, the transmit power value is stored. The unit is dBm. If HasTxPowerLevel is $FALSE, this object will not be added.
Array | ServiceUuidList | The list of advertised services is stored. Note that there may be some services that are not advertised but can be used.
Number | Bonded | If the bonding succeeds, $TRUE is stored, and if it fails, $FALSE is stored.


Root.BluetoothDeviceFound event

API version 15

Root.BluetoothDeviceFound eventChange History

iOSAndroidWindows

This event is generated when a Bluetooth device is detected by scanning for Bluetooth devices.

The following child objects are attached to the Event object.

type

name

explanation

String

DeviceId

The BD address of the target Bluetooth device is stored.

(The format of the BD address is the same as the MAC address.)

String

Name

The name of the target Bluetooth device is stored.

Number

ConnectableAsBluetoothClassic

If the device can be connected as a Bluetooth Classic device, $TRUE is stored, and if not, $FALSE is stored.

Number

ConnectableAsBluetoothLE

If the device can be connected as a BLE (Bluetooth Low Energy) device, $TRUE is stored, and if it cannot be connected, $FALSE is stored.

Number

HasRssi

If the RSSI value (Received Signal Strength Indication) is present, $TRUE is stored; if not, $FALSE is stored.

Some BLE devices rarely do not have RSSI values.

Number

Rssi

If HasRssi is $TRUE, the RSSI value is stored. The unit is dBm.

If HasRssi is $FALSE, this object will not be added.

Number

HasTxPowerLevel

If it has a transmit output value, $TRUE is stored; if not, $FALSE is stored.

Number

TxPowerLevel

When HasTxPowerLevel is $TRUE, the transmit power value is stored. The unit is dBm.

If HasTxPowerLevel is $FALSE, this object will not be added.

Array

ServiceUuidList

The list of advertised services is stored.

Note that there may be some services that are not advertised but can be used.

Array

ManufacturerSpecificDataList *1

Manufacturer Specific Data is stored as an Array object of the following Record:

Type | name | Explanation
Number | CompanyId | Manufacturer-specific ID
ByteArray | Data | The byte array of Manufacturer Specific Data

Array

ServiceDataList *1

Service Data is stored as an Array object of the following Record:

Type | name | Explanation
String | uuid | UUID of the service
ByteArray | Data | The byte array of Service Data

See StartBluetoothScanning method for scanning Bluetooth devices.

The same device may be detected many times; this can be used to see changes in RSSI values.

Change History
*1　The specification has been changed since API version 20.


Root.BluetoothScanFinished event

iOSAndroidWindows

This event is fired when the Bluetooth device scanning is finished or cancelled by the CancelBluetoothScanning method.

See StartBluetoothScanning method for scanning Bluetooth devices.


Root.BluetoothScanStarted event

iOSAndroidWindows

This event is fired when the StartBluetoothScanning method starts to scan for Bluetooth devices.


Root.Close event

Occurs when you press the close button at the top right of the root window.

If this event is caught by the event handler, the operation of closing the window will be cancelled. If you want to close the window, delete the Root object in the event handler.

Example

Function OnClose(e) {
    if(...) {
        //.Delete();
    }
}


Root.ExternalIntent event

API version 4

Root.ExternalIntent event change history

iOS Android Windows

Event that occurs when Biz/Browser HT receives an intent that meets the following conditions.

・ Action="jp.co.opst.bizsd.external.EXTERNAL_INTENT" *1 *2

・ Data=Not specified (If specified, please note that other applications may be displayed as being receivable depending on the value or the environment of the device)

・ Category="android.intent.category.DEFAULT"

If this intent is received while Biz/Browser is not running, Biz/Browser startup, CRS execution, loading, etc. will not be performed.

Also, this event does not occur at security levels other than 0 (lowest).

The following child objects are added to the Event object.

Type | name | Explanation
Intent | extIntent | The received intent. See the Intent class for details. Using the Intent.PutExtra method in the application that sent the intent If you have stored the data, you can get it by using the Intent.GetExtra method.
Change history
*1 For API Ver.6 or earlier, "jp.co.opst.bizai.external.EXTERNAL_INTENT" can be used.
*2 Even with API Ver.7 or later, "jp.co.opst.bizai.external.EXTERNAL_INTENT" can be used for compatibility.


Root.ExternalMessage event

API version 4

Root.ExternalMessage event change history

iOS Android Windows

Occurs when some message is sent from an external device or external application. *1

This event does not occur unless the security level is 0 (lowest).

Android version
It occurs when a message (android.os.Message instance) is sent to the handler acquired by the Android ExternalObject.getMessageHandler method.

In this case, the Event object has the following child objects attached:

Type

name

Explanation

Number

what

Indicates the type of message.

Equivalent to the what field of the Message instance you sent.

Number

arg1

This is an integer-valued parameter.

Equivalent to the arg1 field of the sent Message instance.

Number

arg2

This is an integer-valued parameter.

Equivalent to the arg2 field of the Message instance you sent.

ExternalObject

obj

It is equivalent to the obj field of the sent Message instance.

If the value of the obj field is a null value, an ExternalObject object indicating a null reference will be added.

Whether it is a null reference object or not can be confirmed by using the ExternalObject.IsNullRef property.
Change history
*1 It is an event for receiving broader messages, not limited to platform-specific messages.


Root.SmaPriPrinterConnectionChanged event

iOSAndroidWindows

SmaPriPrinter.Connect and SmaPriPrinter.Disconnect methods, and when the connection status with the Sato printer is changed by "Printer connection status / Control" in the menu.

See "SmaPro Package Overview" for information on the "Printer connection status / Control" menu.

The following child objects are attached to the Event object.

type

name

explanation

Number

State

The connection state of the printer is stored. It takes the following values

value | explanation
3 | Connected to printer.
4 | Disconnected from printer.
5 | Connection to printer failed.

String

Message

Contains error messages in case of connection failure.

Included when State is 5.


Root.SmaPriPrintFinished event

iOSAndroidWindows

Occurs when format printing by the SmaPri.PrintFormat method is successful.

The following child objects are attached to the Event object.

type | name | explanation
String | JobName | The print job name is stored. The value specified in the SmaPriInputItem.JobName property.


Root.SmaPriPrintFailed event

iOSAndroidWindows

Occurs when format printing by the SmaPri.PrintFormat method fails.

The following child objects are attached to the Event object.

型 | 名前 | 説明
String | JobName | The print job name is stored. The value specified in the SmaPriInputItem.JobName property.
String | Message | Error messages are stored.


Root.SmaPriPrintCommandFinished event

iOSAndroidWindows

Occurs when a print command is successfully sent by the SmaPri.SendCommand method.


Root.SmaPriPrintCommandFailed event

iOSAndroidWindows

Occurs when sending a print command by the SmaPri.SendCommand method fails.

The following child objects are attached to the Event object.

type | name | explanation
String | Message | Error messages are stored.


Root.SmaPriPrintSendDataFinished event

iOSAndroidWindows

Occurs when data is successfully sent by the SmaPri.SendRawData method.

The following child objects are attached to the Event object.

type | name | explanation
String | RawData | A byte sequence of received data expressed in Base64 is stored.


Root.SmaPriPrintSendDataFailed event

iOSAndroidWindows

Occurs when data transmission by the SmaPri.SendRawData method fails.

The following child objects are attached to the Event object.

type | name | explanation
String | Message | Error messages are stored.


Root.WindowStateChanged event

Occurs when state changes occur, such as maximizing or minimizing the root window.

Android version
following child objects are added to the Android version Event object.

Type

name

Explanation

Number

state

The following values ​​are set.

For more information about activities (android.app.Activity class) and their state transition, please refer to the reference manual of Android Developers (Android developer site).

constant | value | Explanation
$RESTORE | 3 | When the size of the Root window changes
$FRONT | 8 | Occurs at the same time as $ACTIVITY_ON_RESUME
$BACK | 16 | Occurs at the same time as $ACTIVITY_ON_PAUSE
$ACTIVITY_ON_START | 33 | Of the activity where Biz/Browser HT is running when the onStart method is called
$ACTIVITY_ON_RESUME | 34 | Of the activity where Biz/Browser HT is running when the onResume method is called
$ACTIVITY_ON_PAUSE | 35 | Of the activity where Biz/Browser HT is running when the onPause method is called
$ACTIVITY_ON_STOP | 36 | Of the activity where Biz/Browser HT is running when the onStop method is called
$ACTIVITY_ON_RESTART | 37 | Of the activity where Biz/Browser HT is running When the onRestart method is called


Root.ExternalCall event

This event is retained for compatibility. Nothing happens when I operate it.


Root.PowerStateChanged event

Occurs when the device wakes up from sleep.


Root.MemoryLimitExceeded event

iOS Android

This feature has been removed from API version 6.


SYS object

SYS object変更履歴

Upon startup, Biz / Browser builds a SYS object under the Root object. It is generated before the application's CRS is loaded, so you can always reference it in "//.SYS".

SYS objects are for reference only. The value cannot be changed, the Delete method cannot be used, and the descendant objects cannot be added using the Append method.

The properties of the SYS object are explained below.

name

Type

Explanation

OS

String

Character string that identifies the client OS

OS_VERSION

Number

Client OS version number

Android version
The API level of the OS will be retrieved.

CLIENT

String

Client browser name
Please refer to the link below for specific values.
Android version

CLIENT_VERSION

Number

Client browser version number

If the version number is 1.2.9, CLIENT_VERSION is 1.29.

However, CLIENT_VERSION cannot represent a two-digit minor version. If the version number is 1.2.10, CLIENT_VERSION would be 1.29.

Use CLIENT_LONG_VERSION if you want to correctly distinguish between two-digit minor versions.

CLIENT_LONG_VERSION *1

Number

Client browser version number

Unlike CLIENT_VERSION, CLIENT_LONG_VERSION can distinguish between two-digit minor versions. If the version number is 1.2.10, CLIENT_VERSION is 1.021.

PROXY

String

Proxy server host name

PROXY_PORT

Number

Proxy server connection port number

SERVER

String

Server host name

SERVER_PORT

Number

Server connection port number

USERNAME

String

(Always blank. Remaining for backward compatibility.)

APPROOT

String

(Remains for compatibility with the past)

HOSTNAME

String

Client computer name

Android version
The Android API Build.HOST string will be retrieved.

MODELNAME

String

Manufacturer name, model name, etc. (maker setting value)

PLATFORM

String

Platform type

DEVICEID

String

Aircraft unique ID

Please note that the acquisition method is different for each platform.

Also, please note that the uniqueness and immutability of the values ​​that can be obtained are not guaranteed.

Android version less than 10
You can get the serial number that is set on the terminal device under Android 10 .
This serial number does not change in principle.

Android version 10
A unique ID will be automatically generated and saved as a file in the device storage.
Please note that this is different from the serial number that can be obtained for devices under Android 10.
This ID will not change unless the saved file is changed, deleted, or the device is factory reset.

If you have upgraded your device to Android 10 or later from Android 10 or later on a device that has been running Biz/Browser HT (Android) 1.1.1 or later, you can continue to get the serial number of the device that you got and saved when you were running Android 10 or later.

Android version 11 or later
A unique ID will be automatically generated and saved as a file in the device storage.
Please note that this is different from the serial number that can be obtained for devices under Android 10.
Unlike Android 10, this ID will change when you uninstall the app.

LoginParam

String

You can get the login parameters passed by the custom URL scheme .

LANGUAGEID

Number

You can get the language ID (locale ID / LCID) of the running OS.
By using this value, it is possible to judge the operating language in CRS and branch the processing.

Example of use

var message = strf("OS is %1", //.SYS.OS);
var title = strf("%1 Ver.%2", //.SYS.CLIENT, //.SYS.CLIENT_VERSION);
//.MessageBox(message, title);

About APPROOT property

The APPROOT property is retained for backwards compatibility with Biz / Browser. Avoid using this property if possible.

Get and set the position treated as "/" in the resource on the server. This property can change its value exceptionally.

For example, if "/ APP1" is set and you use Get ("Proc1") with a relative path, the request will be sent at the URL http://server-name/APP1/Proc1. If you use Get("/Proc1") with an absolute path, the request will be sent at the URL http://server-name/Proc1.

In version 3.0 and later, the APPROOT property is only available if the running CRS is downloaded with the same protocol, server, port as the primary session (login protocol, server, port) and the APPROOT property is specified. Use to determine the URL. Other than that, the URL is determined based on the specifications of the Get method.

Note that the URL in the CAR file is also affected by the APPROOT property, so setting the APPROOT property will prevent the CAR file from loading as intended in most cases. Therefore, you cannot specify APPROOT and use CAR file at the same time.

Change History
*1　Added since API version 22.


Root.OnException function

A special function that is called directly from the CRS execution engine.

This function is called when a try ... catch raises an unhandled exception.

If true is returned as the return value, the CRS engine will not stop and continue processing.

If you return a value other than true, the CRS execution engine will stop.

For details , refer to the item of " Exception Handling "-"Global Exception Handler".


TextBox class

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | EditObject
 |  |  |  |  | TextBox

A class that displays a text box in which one line of characters can be entered.

The value of the Value property is formatted and displayed in the text box according to the specification of the Format property.

When inputting, the specification of the Format property is invalid and the format corresponding to the Value data type is input.

Screen display example

Input format according to data type

Since the TextBox class supports input according to ValueType , when keyboard focus is received, the specification of Format property is invalidated and input is prompted in the format corresponding to the data type.

The input format for each Value Type is shown below.

1. String

The value of the Value property is displayed as is and you can enter it.

2. Date

The input format varies depending on what the value of the Value property is at the start of input.

(1) When all the hours, minutes and seconds of the value of the Value property are 00

It will be in "YYYY / MM / DD" format

(2) When the second of the value of the Value property is 00

It will be in "YYYY / MM / DD HH24: MI" format

(3) In cases other than the above

It will be in "YYYY / MM / DD HH24: Mi: SS" format

3. Number

Enter the value of the Value property, which is displayed in all digits including the decimal point.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

Nothing in particular


TextBox property

API version 4

Property

iOS Android Windows

The following properties are defined in the TextBox class.

API | name | access | Type | initial value | Explanation
HT (10) | AutoTab | CRW | boolean | $FALSE | Focus is automatically moved by inputting all digits
4 | Border | CR | boolean | $TRUE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | Format | CR | String |  | Format string
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
4 | InputMode | CR | integer |  | Specifying the character types that can be entered
4 | MaxLength | CR | integer |  | Number of characters that can be entered
4 | Password | CR | boolean | $FALSE | * Mask of input characters
4 | Value | CRW | String Number Date |  | Value to display in the text box
5 | VerticalAlign | CR | integer | $STD | Vertical alignment

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


TextBox.AutoTab property

If you set $TRUE , the focus is automatically moved to the next tab-ordered object when the keyboard input reaches the number of digits specified by the Format property or the MaxLength property. ..


TextBox.HorizontalAlign property

Performs horizontal alignment. $STD is right-justified if the data type is Number, and left-justified otherwise.

constant | value | Explanation
$STD | 0 | Determined by data type
$LEFT | 1 | Left alignment
$CENTER | 2 | Centered
$RIGHT | 3 | Right alignment


TextBox.MaxLength property

Set the maximum number of characters to enter.

If ValueType is Number, the sign and decimal point are included.

The maximum value is 3000.


TextBox.Password property

The entered characters are displayed *.

constant | Explanation
$FALSE | *Do not show
$TRUE | *indicate

Android version
If the Password property is $TRUE, the keyboard type specified by the SIPMode property is ignored (due to OS and SIP restrictions).


TextBox.Value property

The value to display in the text box. Holds the value of the data type specified in ValueType .

Scripted value settings are not affected by the InputMode property.

The input value on the screen is not reflected immediately. For details, refer to When the Value property is updated .


VerticalAlign property

Performs vertical alignment. $STD will be aligned.

constant | value | Explanation
$STD | 0 | Same as $TOP
$TOP | 1 | Top-up
$CENTER | 2 | Centered
$BOTTOM | 3 | Bottom


TextBox method

API version 4

Method

iOS Android Windows

The following methods are defined in the TextBox class.

API | name | Explanation
HT (12) | GetSelection | Gets the cursor position and selection position
HT (12) | SetSelection | Set the cursor position and selection position
4 | SetMargins | Set the left and right margins.

Class overview

Base class methods


TextBox.GetSelection method

Explanation

Gets the current cursor position and selection range.

Call format

var n = TextBox1.GetSelection([ lengthMode ])

Return value

Cursor position or number of selected bytes

argument

boolean lengthMode

& The value to get

$FALSE: Get the cursor position

$TRUE: Get the selected number of bytes (the number of characters when UString or Mobile compatibility mode is OFF)

The default is $FALSE.

exception

None

Example of use

var pos = TextBox1.GetSelection();

Related item

SetSelection method


TextBox.SetSelection method

Explanation

Sets the current cursor position and selection range.

Call format

TextBox1.SetSelection( pos [, length ])

Return value

None

argument

integer pos

Specifies the cursor position starting from 0.

If specified outside the range, it will be corrected within the range.

integer length

Specify the selection character length. The default is 0 (no selection).

Special designation

SetSelection(0, -1) Select all

SetSelection(-1) Deselect

exception

None

Example of use

TextBox1.SetSelection(1, 4);

Related item

GetSelection method


TextBox.SetMargins method

Explanation

Set the left and right margins.

In the initial state, the left and right margins are in the OS standard position.

When setting the margin, specify so that the total value of the left and right margins fits within the text display area of ​​the TextBox.

Call format

TextBox.SetMargins( leftMargin , rightMargin ).

Return value

None

argument

integer leftMargin

Specify the left margin between 0 and 32767.

integer rightMargin

Specify the right margin between 0 and 32767.

exception

FUNC-4

Invalid argument

Example of use

TextBox1.SetMargins(2, 2);

Related item


TextBox event

API version 4

Event

iOS Android Windows

The following events are defined in the TextBox class.

API | name | Explanation
HT (10) | Clicked | Occurs when tapped
4 | Touch | Occurs when the value entered in the text box is confirmed

Class overview

Base class event


TextBox.Clicked event

Occurs when tapped.

It occurs only when tapped while the focus is on.


TextBox.MaxlengthReached event

This event is retained for compatibility. Nothing happens when I operate it.


TextBox.Touch event

This event occurs when the value of the text box is confirmed by input operation from the screen.

The Touch event occurs when a value change is confirmed by pressing the Enter key or function key, or when it loses focus and is confirmed. It does not occur for each key input character.


Extension3 package

This is an extended GUI package added in Biz/Browser Ver3.0.

class

API | name | Explanation
4 | DateEdit | Displays a text box dedicated to date input
4 | NumberEdit | Displays a text box dedicated to numeric input
4 | TabForm | Define each tab of the TabFrame class
4 | TabFrame | Show tab controls


DateEdit class

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | EditObject
 |  |  |  |  | DateEdit

It is a class that displays a text box for date input only.
In addition to keyboard input, DateEdit has a date input pop-up function that supports date input.

Screen display example

If you specify a format that includes time in the Format property, the date input popup will display a toggle switch between date and time.

Keyboard operation

This object supports keyboard operation. The following key operations can be performed.

Key | Explanation
0 ~ 9 | Enter 1 digit
SPACE | Show input popup
BACK | Delete one character
RETURN | Confirm the entered value
UP | Increment the number at the current cursor position (+1)
LEFT | Move cursor left one position
BOTTOM | Decrement the number at the current cursor position (-1)
RIGHT | Move cursor right one position

Operation of date input popup

By tapping on DateEdit, the date input popup will be displayed.

When you change the date or time value, the value is reflected in DateEdit, and when you press the "Close" button or tap outside the popup, the date input popup is closed and the value is confirmed.

・ Press the "Today" button to set the current date and time.

・ Press the "Clear" button to clear the date and time being entered.

If there are restrictions on the dates that can be entered by specifying the Format property, the dates that can be displayed in the date input popup will also be within that range.

For example, if the year is 2 digits, the display range is 1950 to 2049.

format

If the Format property is not specified, "YYYY/MM/DD" will be specified.

The year can be specified in the range of 4 to 2 digits, and the following range can be entered respectively.

2 digits: 1950-2049

0-49 is interpreted as 2000-2049, 50-99 as 1950-1999.

3 digits: 1900 to 2099

0-499 is interpreted as 2000-2499, 500-999 as 1500-1999.

However, the range of 1900 to 2099 that is within the representation range of Date type is valid.

4 digits: 1900 to 2099

The input value is directly interpreted as the year.

However, the range of 1900 to 2099 that is within the representation range of Date type is valid.

You can specify the year in multiple places of the Format property (such as "YY/MM/DD YY"), but you cannot specify different numbers of digits such as "YY (YYYY)".

You can use the Japanese calendar for the year. The Japanese calendar always uses a combination of the calendar ("WR") and the year ("WYY").

When used in combination with the Western calendar (such as "WRWYY (YYYY)"), the input value will be interpreted with priority given to the person who entered the Western calendar or Japanese calendar.

If you enter an element other than the year, the one specified on the left side of the screen will be preferentially interpreted.

Completion of hidden elements

If there is an item that is not specified as an input item in the Format property (such as "YY/MM" with only the year/month as the input item), the missing part will be complemented automatically.

If the Value property was previously set in the script, it will be completed with that date and time. If not set, year and month are complemented with today's value, day is 1 day, and time is 00:00:00.

If the complemented date is an invalid date, the following rules will be used to correct it so that it is a valid date.

-The items to be corrected are only those whose unit is smaller than the input item.

For example, if Month is an input item, Year is not adjusted. If the day is an input item, the year and month are not corrected.

・ Compensation is performed with priority given to smaller units.

For example, in a script

Value = "2000/2/29";
Format = "YYYY";

If is specified, the month and day are candidates for correction.

If you enter 2005 in this state, the month and day will be complemented from the Value property to become 2005/2/29, which is an invalid date.

The month correction will be 2005/3/29, and the day correction will be 2005/2/28, but in such a case, it will be converted to a valid date by the smaller day correction (2005/2/28). ..

・ The correction is performed so that the date is as close as possible to the input value.

For example, in a script

Value = "1989/1/5";
Format = "WRWYY\"year \"MM\"month \"";

If is specified, it is "January 1988".

If you enter Heisei 1 in this state, the date will be corrected to January 8, 1989, which is a closer date in Heisei 1.

Also,

Value = "2005/3/31";
Format = "YY/MM";

If is specified, it will be corrected on the 30th for April, June, September, and November input, and on the 28th or 29th for February input.

Other restrictions

The following cannot be specified in the Format property.

・ TZ specification

You cannot specify the TZ that displays the time zone.

・ Specifying u

The option u that displays the time in UTC cannot be specified. Always local time.

-Specification that does not include datetime elements

If the date / time element is not included (such as "/DAY ,."), a PKG-37 exception is raised.

Default property and ValueType

The default property is Value . The ValueType specification is invalid.

Notes on scaling

◆ Date input popup is not subject to scaling


DateEdit property

API version 4

Property

iOS Android Windows

The following properties are defined in the DateEdit class.

API | name | access | Type | initial value | Explanation
HT (10) | AutoTab | CRW | boolean | $FALSE | Focus is automatically moved by inputting all digits
4 | Border | CR | boolean | $TRUE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | EditText | CR | String |  | Character string displayed on the screen
4 | Format | CR | String |  | Format string
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
HT (10) | InvalidDate | R | boolean | $FALSE | Check for incorrect dates
26 | PopupBorder | CR | $FALSE | 1.0 | Diplay frame of the date input pop-up
25 | PopupScale | CRW | Number | 1.0 | Scale factor of the display size of the date input pop-up
HT (10) | ShowFormat | CR | boolean | $FALSE | Display the specified contents of the Format property
HT (10) | UndecidedStyle | CR | integer | $STD | What happens when you enter an invalid value
HT (10) | UseHelper | CR | integer | $STD | Whether to automatically launch the input popup
4 | Value | CRW | Date |  | The value to display in the DateEdit object
5 | VerticalAlign | CR | integer | $STD | Vertical alignment

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


DateEdit.AutoTab property

Setting $TRUE will automatically move the focus to the next tab-ordered object when keyboard input reaches the maximum number of digits.


DateEdit.EditText property

Acquires the character string displayed on the screen (character string after applying the format by the Format property) as is.


DateEdit.Format property

Specifies the format of the edit string.

Specified character | Example | Explanation
Y | "YYYY, MM, DD" | Displays the year of the Christian era. The number with Y indicates the number of digits displayed in the Christian era.
WS | "WSWYY.MM.DD" | The Japanese calendar year is displayed in abbreviated form (M, T, S, H ...).
WR | "WRWYY \" year \ "MM \" month \ "DD \" day \ "" | The year of the Japanese calendar is displayed (Meiji, Taisho, Showa, Heisei ..).
WYY | "WRWYY \" year \ "MM \" month \ "DD \" day \ "" | Displays the year of the Japanese calendar.
MM | "YYYY / MM" | Displays the month (1-12).
MONTH | "MONTH DD YYYY" | Displays the name of the month (JANUARY ...). It is displayed in 9 digits.
month | "month DD YYYY" | Displays the name of the capitalized month (January ...). It is displayed in 9 digits.
MON | "dy, DD MON YYYY" | Displays the month name abbreviation (JAN ...).
mon | "dy, DD mon YYYY" | Displays the abbreviation (Jan ...) for the capitalized month name.
DD | "YY / MM / DD" | Displays the day (1-31).
DAY | "YY / MM / DD DAY" | Displays the day of the week (SUNDAY ...).
day | "YY / MM / DD day" | Shows the capitalized day of the week (Sunday ...).
DY | "YY / MM / DD DY" | Displays the abbreviation for the day of the week (SUN ...).
dy | "dy, DD mon YYYY" | Displays the abbreviation (Sun ...) for the capitalized day of the week.
DJ | "YY / MM / DD DJ" | Displays the local form of the day of the week (Monday, Tuesday ...).
HH24 | "HH24: MI: SS" | 24. Displays the time system (0 to 23).
HH | "HH: MI: SS" | Displays the 24-hour clock (0 to 23). (Same as HH24. 12-hour display is not possible.)
MI | "HH: MI: SS" | Displays minutes (0 to 59).
SS | "HH: MI: SS" | Displays seconds (0 to 59).
-/,.;: | "HH: MI: SS" | The specified character is displayed at the specified position.

* WS, WR, and WYY can only be used in areas where the Japanese calendar is valid.

* If you want to use the Japanese calendar year and year with WS, WR, and WYY, you need to set the year information in advance with the Root.SetWareki method. From the Meiji era to the Heisei era, it is set automatically.

* It is not possible to specify a day of the week such as DAY or-/,.;:, Etc. alone. Be sure to use these in combination with an input format.


HorizontalAlign property

Performs horizontal alignment. $STD is left justified.

constant | value | Explanation
$STD | 0 | Same as $LEFT
$LEFT | 1 | Left justified
$CENTER | 2 | Centered
$RIGHT | 3 | Right justified


DateEdit.InvalidDate property

If the date entered on the screen is incorrect, it will be $TRUE. If the date is correct or not entered, it will be $FALSE.

By checking this property and the Value property, you can see what kind of input was made.

Value | InvalidDate | Explanation
Greater than 0 | $FALSE | The date is entered correctly
Greater than 0 | $TRUE | Incorrect date entered
0 | $FALSE | Nothing has been entered
0 | $TRUE | Incorrect date entered

This property is set by the value entered on the screen when it is confirmed.

It is not set when the Value property is rewritten from the script.


DateEdit.PopupBorder property

iOSAndroidWindows

When $TRUE is set, the frame of the date input pop-up is displayed.


DateEdit.PopupScale property

iOSAndroidWindows

Specify the scale factor of the display size of the date input pop-up.

There is no maximum value, but it will actually scale up to the size that fits on the screen (95% of the screen width, 90% of the screen height).

Minimum value is 0.5. If you specify a value less than 0.5, it will be 0.5.

The default value is 1.0.


DateEdit.ShowFormat property

Display the specifications of the Format property to make it easier to understand what to enter.

Display date elements (YYYY, MM, etc.) with _.

Example

Format = "WRWYY\"year\"MM\"month\"DD\"day\""

"______year__month__day" is displayed.


DateEdit.UndecidedStyle property

Set the operation when an invalid value is entered as the date and confirmed.

constant | value | Explanation
$STD | 0 | do nothing
$BgColor | 1 | Display background in red
$FgColor | 2 | Characters are displayed in red
$Reverse | 3 | Invert background and text color
$Clear | 4 | Clear the value


DateEdit.UseHelper property

Select whether to activate the input popup that can be displayed from the object by touch operation.

constant | value | Explanation
$STD | 0 | Starts, but not in Mobile compatibility mode
$POPUP_OFF | 1 | Does not start regardless of mode
$POPUP_ON | 2 | Start regardless of mode


DateEdit.Value property

The value to display in the DateEdit object. Holds a Date type value.

The input value on the screen is not reflected immediately. For details, refer to When the Value property is updated .


DateEdit method

API version 4

Method

The following methods are defined in the DateEdit class.

API | name | Explanation
HT (10) | ShowHelper | Displays the input popup.
4 | SetMargins | Set the left and right margins.

Class overview

Base class methods


DateEdit.SetMargins method

Explanation

Set the left and right margins.

In the initial state, the left and right margins are in the OS standard position.

When setting the margin, specify so that the total value of the left and right margins fits within the character display area of ​​DateEdit.

Call format

DateEdit.SetMargins( leftMargin , rightMargin ).

Return value

None

argument

integer leftMargin

Specify the left margin between 0 and 32767.

integer rightMargin

Specify the right margin between 0 and 32767.

exception

FUNC-4

Invalid argument

Example of use

DateEdit1.SetMargins(2, 2);

Related item


DateEdit.ShowHelper method

Explanation

Displays the input popup.

The popup that appears is the same one that appears when you tap DateEdit.

Call format

DateEdit.ShowHelper()

Return value

None

argument

None

exception

None

Example of use

DateEdit.ShowHelper();

Related item


DateEdit event

API version 4

Event

iOS Android Windows

The following events are defined in the DateEdit class.

API | name | Explanation
HT (10) | Clicked | Occurs when tapped
4 | Touch | Occurs when the value entered in DateEdit is confirmed

Class overview

Base class event


DateEdit.Clicked event

Occurs when tapped.


DateEdit.Touch event

This event occurs when the value changes due to an input operation from the screen.

The Touch event occurs when a value change is confirmed by pressing the Enter key or function key, or when it loses focus and is confirmed. It does not occur for each key input character.


NumberEdit class

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | EditObject
 |  |  |  |  | NumberEdit

It is a class that displays a text box only for numeric input.
In addition to keyboard input, NumberEdit has a touch-sensitive numeric keypad function that supports numeric input.

Mobile compatibility mode
When you tap NumberEdit or receive focus, the numeric keypad pops up normally, but it does not start in mobile compatibility mode.
However, it can be started by pressing the space key or calling the ShowHelper method.

Screen display example

Keyboard operation

This object supports keyboard operation. The following key operations can be performed.

Key | Explanation
0 ~ 9 | Enter 1 digit
SPACE | Show input popup
BACK | Delete one character
RETURN | Confirm the entered value
- | ± Sign reversal
. | Enter '.'

Numeric keypad

The numeric keypad is activated by tapping on NumberEdit.

You can enter up to 15 digits excluding sign and decimal point.

・ "<X" button deletes the digit being entered. Also, press and hold to clear to zero.

-The "+/-" button inverts the sign of the number being entered.

・ The "Confirm" button confirms the entered value and closes the numeric keypad. Also, tap on outside the pop-up to confirm and close the numeric keypad.

-The "Clear" button clears to zero.

Notes on using the numeric keypad

Even if the format of the edit character string is specified in the Format property, the contents of the Format property are not reflected in the simple calculator.

Therefore, it is possible to input data that does not follow the set format on the simple calculator, but since the value is changed to the format that was set when the value on the simple calculator was reflected in NumberEdit, a value different from the input value on the calculator. May be displayed.

(Example)

Format: Format = "999,990"; * Cannot be entered after the decimal point

Input on the simple calculator: 1.05

Display when reflected in NumberEdit: 105

Input digit limit

To limit the number of input digits , specify the Format property and the MaxLength property.

If the decimal point and the number of integers such as "999." and ".00" are not set in the Format property, input restrictions will be applied based on the MaxLength property. For example, when the MaxLength property is the initial value (15), the number of decimal places is 12 (15-3) when it is "999.", and the number of integers is 13 (15-2 when it is "00." ).

If the MaxLength property has a value that is less than or equal to the number of digits in the Format property, the number of digits in the Format property takes precedence.

If neither digit is specified in the Format property, the total length will not exceed MaxLength property.

Default property and ValueType

The default property is Value . The ValueType specification is invalid.

Notes on scaling

◆ Numeric keys are not subject to scaling


NumberEdit property

API version 4

Property

iOS Android Windows

The following properties are defined in the NumberEdit class.

API | name | access | Type | initial value | Explanation
HT (10) | AutoTab | CRW | boolean | $FALSE | Focus is automatically moved by inputting all digits
4 | Border | CR | boolean | $TRUE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | Format | CR | String |  | Format string
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
4 | IsNull | CRW | boolean |  | Determining when the Value property is 0
4 | MaxLength | CR | integer | 15 | Number of characters that can be entered
26 | PopupBorder | CR | boolean | $FALSE | Display of frame of the numeric keypad
25 | PopupScale | CRW | Number | 1.0 | Scale factor of the display size of the numeric keypad
HT (10) | UseHelper | CR | integer | $STD | Whether to automatically launch the input popup
4 | Value | CRW | Number | 0 | The value to display in the NumberEdit object
5 | VerticalAlign | CR | integer | $STD | Vertical alignment

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


NumberEdit.AutoTab property

If you set $TRUE , the focus is automatically moved to the next tab-ordered object when the keyboard input reaches the number of digits specified by the Format property or the MaxLength property. ..


NumberEdit.Format property

Specifies the format of the edit string.

Specified character | Example | Explanation
@ | "\"maximum\"@" | Displays in the specified position in the default format.
"TEXT" | "9990 \" Yen \ "" | The characters enclosed in "" are displayed at the specified position. It cannot be specified at the position that separates the sequence of numbers.
9 | "999" | The number that describes 9 indicates the number of digits, and the leading 0 is deleted. If specified after the decimal point, it means only the number of digits and zero suppression is not performed.
0 | "0999" "9990" | Leading 0 becomes 0.
$ | "$9990" | Add a $ mark at the beginning.
MI | "999MI" "MI999" | If it is a negative number, a minus sign (-) is displayed at the specified position (right or left).
S | "S9990" "9990S" | The sign is displayed at the specified position (right or left).
D or .(period) | "99D99" "99.99" | Displays the decimal point at the specified position. If you do not specify the number of digits after the decimal point, up to the last number within the effective precision range is displayed.
L | "L9990" "9990L" | Displays the local currency symbol at the specified position (right or left).
,(comma) | "999,990" | A comma is displayed every 3 digits.
"" (Space) | "99" | The number of spaces described indicates the number of digits, and leading 0s are replaced with whitespace characters (spaces). If it is specified after the decimal point, it is invalid and has no meaning.
N | "990N" | Does not display empty data.


NumberEdit.HorizontalAlign property

Performs horizontal alignment. $STD is right justified.

constant | value | Explanation
$STD | 0 | Same as $RIGHT
$LEFT | 1 | Left justified
$CENTER | 2 | Centered
$RIGHT | 3 | Right justified


NumberEdit.IsNull property

Do not display empty data in the Format property When the format (N) is specified and the Value property is 0, it is used to determine whether it is 0 entered or cleared with the Delete key.

When you refer to the property, it will have the following value.

value | Explanation
$TRUE | It is in the state cleared by the Delete key
$FALSE | 0 is entered

When you set a value for the property, the behavior is as follows.

value | Explanation
$TRUE | Do not display 0 and leave it blank
$FALSE | Show 0

Example)

NumberEdit num1 {
    Format = "990N";
    Function OnTouch(e){
        if(Value == 0 && IsNull == $TRUE) {
            MessageBox("Please enter something");
        }
    }
}
Button btn {
    Title = "Clear";
    Function OnTouch(e){
        ^.num1.IsNull = $TRUE;
    }
}

Do not display empty data in the Format property If a format (N) is not specified, setting $TRUE for this property will not result in blanks. Also, when there is a screen operation, it will be $FALSE.


NumberEdit.MaxLength property

Set the maximum number of characters to enter. Does not include decimal point and sign.

If the Format property is set, the number of digits in the Format property takes precedence.


NumberEdit.PopupBorder property

iOSAndroidWindows

When $TRUE is set, the frame of the numeric keypad is displayed.


NumberEdit.PopupScale property

iOSAndroidWindows

Specify the scale factor of the display size of the numeric keypad.

There is no maximum value, but it will actually scale up to the size that fits on the screen (95% of the screen width, 90% of the screen height).

Minimum value is 0.5. If you specify a value less than 0.5, it will be 0.5.

The default value is 1.0.


NumberEdit.UseHelper method

HT API version 10

NumberEdit.UseHelper property

iOS Android Windows

Select whether to activate the input popup that can be displayed from the object by touch operation.

constant | value | Explanation
$STD | 0 | Starts, but not in Mobile compatibility mode
$POPUP_OFF | 1 | Does not start regardless of mode
$POPUP_OFF | 2 | Start regardless of mode


NumberEdit.Value property

The value to display in the NumberEdit object. Holds a value of type Number.

The input value on the screen is not reflected immediately. For details, refer to When the Value property is updated .


NumberEdit method

API version 4

Method

The following methods are defined in the NumberEdit class.

API | name | Explanation
4 | SetMargins | Set the left and right margins.
4 | ShowHelper | Displays the input popup.

Class overview

Base class methods


NumberEdit.SetMargins method

Explanation

Set the left and right margins.

In the initial state, the left and right margins are in the OS standard position.

When setting the margin, specify so that the total value of the left and right margins fits within the character display area of NumberEdit.

Call format

NumberEdit.SetMargins( leftMargin , rightMargin ).

Return value

None

argument

integer leftMargin

Specify the left margin between 0 and 32767.

integer rightMargin

Specify the right margin between 0 and 32767.

exception

FUNC-4

Invalid argument

Example of use

NumberEdit1.SetMargins(2, 2);

Related item


NumberEdit.ShowHelper method

Explanation

Displays the input popup.

The popup that appears is the same one that appears when you tap NumberEdit.

Call format

NumberEdit.ShowHelper()

Return value

None

argument

None

exception

None

Example of use

NumberEdit1.ShowHelper();

Related item


NumberEdit event

API version 4

Event

iOS Android Windows

The following events are defined in the NumberEdit class.

API | name | Explanation
4 | Clicked | Occurs when tapped
4 | Touch | Occurs when the value entered in NumberEdit is confirmed

Class overview

Base class event


NumberEdit.Clicked event

Occurs when tapped.


NumberEdit.Touch event

This event occurs when the value changes due to an input operation from the screen.

The Touch event occurs when a value change is confirmed by pressing the Enter key or function key, or when it loses focus and is confirmed. It does not occur for each key input character.

When a format (N) that does not display empty data is specified in the Format property, there is no change in the value when 0 is entered from a blank or when the Delete key is used while 0 is being displayed, but the Touch event It will be a condition of occurrence.


TabForm class

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | Form
 |  |  |  |  | TabForm

A class that defines each tab of the TabFrame class. Be sure to use it as a child object of TabFrame class

The TabForm class inherits the functionality of the Form class, so you can place objects underneath . Subordinate objects are not displayed beyond the area of the TabForm object to which they belong, and are clipped by the size of the TabForm object.

Screen display example

Default property and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

◆ The size of TabForm is automatically determined by the size of TabFrame, but the size is further corrected to correct the scaling error that occurs in TabFrame. Specifically, when enlarged, the size will be larger than the theoretical value.


TabForm property

API version 4

Property

iOS Android Windows

The following properties are defined in the TabForm class.

API | name | access | Type | initial value | Explanation
4 | Height | R | integer |  | Vertical display size
4 | Selected | CRW | boolean |  | Selected state
HT (10) | Title | CRW | String |  | Title to be displayed in the tab part
4 | Width | R | integer |  | Horizontal display size
4 | X | R | integer |  | Horizontal display position
4 | Y | R | integer |  | Vertical display position

access | R | Readable
 | W | Writable
 | C | Initializable

* The HorizontalScale , VerticalScale , and FontScale properties of the Form class are not inherited by this class. If you want to use these functions, place the Form inside the TabForm.

Class overview

Base class properties


TabForm.Height property

Indicates the vertical display size.

This property is read-only. You cannot change the value.


TabForm.Selected property

Indicates whether the tab is selected and the TabForm object is displayed.

$TRUE if the tab is selected, $FALSE otherwise.


TabForm.Title property

The value to display in the tab part. See TabFrame class for details.


TabForm.Width property

Indicates the horizontal display size.

This property is read-only. You cannot change the value.


TabForm.X property

Indicates the horizontal display position.

This property is read-only. You cannot change the value.


TabForm.Y property

Indicates the vertical display position.

This property is read-only. You cannot change the value.


TabForm method

API version 4

Method

iOS Android Windows

There are no methods defined in the TabForm class.

Class overview

Base class methods


TabForm event

API version 4

Event

iOS Android Windows

There are no events defined in the TabForm class.

Class overview

Base class event


TabFrame class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | TabFrame

Class that displays a tab control.

The TabFrame class works in concert with the TabForm class.

You must place an object of the TabForm class or its descendants in a defined structure below the TabFrame object.

The TabForm object does not extend beyond the area of ​​the TabFrame object to which it belongs and is clipped at the size of the TabFrame object.

The tab part of the TabFrame class is not displayed.

Mobile compatibility mode
Instead of tabs, two overlays , "Marker" indicating the current position of the tab and "Title" indicating the value of the Title property of the currently displayed TabForm object , are displayed above the tab form. Will be added to overlap.
This overlay display does not capture touch activity, and the touch activity is propagated to the currently displayed TabForm or object on the TabForm. For example, you can tap a button even if it has an overlay display above it.
The overlay display can be controlled by the TabHeight property and TabStyle property.

(Display example)

Object structure

Screen display example

Default property and ValueType

The default property is Value . The ValueType specification is invalid.

Notes on scaling

◆ There is nothing in particular.


TabFrame property

API version 4

Property

The following properties are defined in the TabFrame class.

API | name | access | Type | initial value | Explanation
HT (10) | Arrangement | CR | integer | $STD | It is retained for compatibility. It does not work.
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
HT (10) | FontFace | CR | integer | $STD | It is retained for compatibility. It does not work.
HT (10) | FontKind | CR | integer | $STD | It is retained for compatibility. It does not work.
HT (10) | FontSize | CR | integer | 10 | It is retained for compatibility. It does not work.
HT (10) | TabHeight | CRW | integer |  | Tab height
HT (10) | TabPosition | CR | integer | $STD | It is retained for compatibility. It does not work.
HT (10) | TabStyle | CR | integer | $FLAT | Tab display style
HT (10) | TabWidth | CR | integer |  | It is retained for compatibility. It does not work.
5 | UsePageTurning | CR | integer | TabFrame.TurningNone | Tab switching by gesture
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | It is retained for compatibility. It does not work.
4 | Value | CRW | integer |  | Selected position

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


TabFrame.Arrangement property

This property is retained for compatibility. Nothing happens when I operate it.


TabFrame.TabHeight property

This property is valid only when operating in Mobile compatibility mode.

Mobile compatibility mode
Specifies the height of the entire overlay display, showing the Mobile Compatibility Mode tabs.


TabFrame.TabPosition property

This property is retained for compatibility. Nothing happens when I operate it.


TabFrame.TabStyle property

This property is valid only when operating in Mobile compatibility mode.

Mobile compatibility mode
Set the display style of the overlay display that shows the Mobile compatibility mode tab.

constant | value | Explanation
$FLAT | 0 | Show marker and title
$NONE | 1 | Display nothing
$TITLEONLY | 10 | Show title only


TabFrame.TabWidth property

This property is retained for compatibility. Nothing happens when I operate it.


TabFrame.UsePageTurning property

iOSAndroidWindows

Sets the tab switching mode by gesture operation.

constant | value | explanation
TabFrame.TurningNone | 0 | No tab switching by gesture operation
TabFrame.TurningHorz | 1 | Switch tabs by scrolling (swiping) horizontally
TabFrame.TurningVert | 2 | Switch tabs by scrolling (swiping) vertically


TabFrame.Value property

The number of the currently displayed TabForm object.

-1 if all TabForm objects are hidden, 0 or higher otherwise.

Changing the Value property also changes the TabForm object that is displayed, but you cannot select the hidden TabForm object.


TabFrame method

API version 4

Method

iOS Android Windows

There are no methods defined in the TabFrame class.

Class overview

Base class methods


TabFrame event

API version 4

Event

The following events are defined in the TabFrame class.

API | name | Explanation
4 | Clicked | Does not occur
4 | RClicked | Does not occur

Class overview

Base class methods


Extension4 package

An extended GUI package added in Biz/Browser Ver4.0

class

API | name | Explanation
4 | GroupBox | Show group box
4 | Image | Hold the image
4 | ImageButton | Show image button
4 | ImageLabel | Display image label
4 | ImageList | Defines an image list that holds multiple images
HT (10) | MaskEdit | Show mask edit

FlexView related classes

API | name | Explanation
4 | FlexButton | Define a button for the FlexView class
4 | FlexButtonCell | An accessor to each cell of the FlexButton class
4 | FlexCell | The base class for the flexview accessor class
4 | FlexCheckButton | Defines a checkbox for the FlexView class
4 | FlexCheckButtonCell | An accessor to each cell of the FlexCheckButton class
4 | FlexColumnSet | A class that defines how columns in the FlexView class are displayed.
4 | FlexData | Base class for screen display class with flex view data
4 | FlexGroupHeader | Defines a group header for the FlexView class
4 | FlexGroupHeaderCell | An accessor to each cell of the FlexGroupHeader class
4 | FlexHeader | Define the header of the FlexView class
4 | FlexHeaderCell | An accessor to each cell of the FlexHeader class
4 | FlexIndentLabel | Defines indentation travel for the FlexView class
4 | FlexIndentLabelCell | An accessor to each cell of the FlexIndentLabel class
4 | FlexItem | The base class of the flex view screen display class
4 | FlexLabel | Defines a label for the FlexView class
4 | FlexLabelCell | An accessor to each cell of the FlexLabel class
4 | FlexListBox | Defines a list box for the FlexView class
4 | FlexListBoxCell | An accessor to each cell of the FlexListBox class
4 | FlexRecord | Define a row for the FlexView class
4 | FlexRow | Manipulate individual rows in the FlexView class
4 | FlexRowSet | A class that defines how columns in the FlexView class are displayed.
4 | FlexTextBox | Defines a text box for the FlexView class
4 | FlexTextBoxCell | An accessor to each cell of the FlexTextBox class
4 | FlexTreeHeader | Defines a tree header for the FlexView class
4 | FlexTreeHeaderCell | An accessor to each cell of the FlexTreeHeader class
4 | FlexView | Show flex view


FlexView class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | FlexView

A class for displaying tabular data.

It's similar to the ListView class, but it can be grouped according to the content of the data, or it can be displayed like a split merge of cells. In addition, text boxes and buttons can be placed directly in the cell.

The FlexView class, unlike other tabular classes, has no corresponding object for each cell. Like CSVDocument, individual cells are managed as internal data in FlexView and need to be accessed through methods. Even if the number of rows is large, the number of created objects is small, so you can handle more rows than ListView.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
RETURN | Processing linked with the CursorMove property
UP | Move up one cell
LEFT | Move to the left cell
BOTTOM | Move to the next lower cell
RIGHT | Move to the right cell
NEXT (PAGE_DOWN) | Move to the next page
PROIR (PAGE_UP) | Move to the previous page

Default properties and ValueType

The default property is RowPosition . The ValueType specification is invalid.

FlexView overview

The FlexView object is a composite object that does not work on its own, and uses FlexRecord and FlexItem derived classes at the bottom.

Place one FlexRecord under FlexView. You cannot place multiple FlexRecords or an array of FlexRecords. Note that FlexRecord is an object that defines the display of table rows, not the rows themselves.

FlexRecord in the lower of FlexItem is derived from, you can be arranging a plurality of the following objects. These objects define the display form of columns and the initial values ​​of cells, not the cells themselves.

class | Cell accessor class | Explanation
FlexRowSet | None | Display the lower FlexItems in multiple lines.
FlexColumnSet | None | Display the lower FlexItems in multiple columns.
FlexHeader | FlexHeaderCell | Line header
FlexGroupHeader | FlexGroupHeaderCell | Grouping line header
FlexTreeHeader | FlexTreeHeaderCell | Tree display row header
FlexLabel | FlexLabelCell | Display cells like labels
FlexIndentLabel | FlexIndentLabelCell | Indent travel
FlexButton | FlexButtonCell | Display cells like buttons. It is possible to press the button with a tap.
FlexCheckButton | FlexCheckButtonCell | Display cells like checkboxes. You can change the selection status by tapping.
FlexTextBox | FlexTextBoxCell | Makes the cell look like a text box. Editing by key input is possible.
FlexListBox | FlexListBoxCell | Display the cells like a pull-down list. You can change the selection status by tapping.

The class whose class name is described in the cell accessor class is a class derived from the FlexData class and displays the data corresponding to one column of table data in the cell. Classes marked "None" are not related to table data.

The FlexRowSet and FlexColumnSet classes define the placement of cells and place lower FlexItems in the column or row direction. Derived classes of FlexItem can be placed at the lower level, and any division can be performed by placing multiple FlexRowSets and FlexColumnSets at the lower level.

FlexRecord R {
    FlexRowSet Row1 {
        FlexColumnSet Col1 {
            FlexLabel Label1;
            FlexLabel Label2;
            FlexLabel Label3;
        }
        FlexColumnSet Col2 {
            FlexLabel Label4;
            FlexLabel Label5;
            FlexLabel Label6;
        }
    }
}

Relationship between FlexData and cells

The data displayed in the cell is configured by referring to the derived object from the FlexData class placed under the FlexRecord object when the row is generated by the FlexView.InsertRow method etc. and managed as the internal data of the FlexView object. Will be done.

The value specified for FlexLabel.Value etc. is copied when the cell is configured and maintained as a separate instance from FlexLabel.Value. Therefore, updating the values ​​of individual cells does not affect the FlexLabel object.

Results displayed by InsertRow

① | ③ | ④
②

In this example, one FlexRowSet and four FlexLabels are placed below FlexRecord. Since FlexRowSet is not derived from the FlexData class, no corresponding cell will be created. Since FlexLabel is a class derived from FlexData, 4 cells (1) to (4) corresponding to 4 FlexLabels are generated.

Some properties such as Value value and FgColor set in FlexLabel are copied to these generated cells and maintained for each cell. Also, other properties such as VerticalAlign and BorderStyle are not duplicated and are referenced and shared by all cells.

Note that properties that are not managed on a cell-by-cell basis cannot be changed on a per-cell basis. For example, you cannot change the display style of the cell frame specified by FlexLebel.BorderStyle on a cell-by-cell basis. Which properties are managed on a cell-by-cell basis and which properties are shared depends on the class. See the documentation for each class for details.

Accessor object

You can't work with individual cells directly because cells aren't objects, but a derived class of the FlexCell class is defined as an accessor to the cell. An accessor is a kind of pointer, and operations on the accessor are transmitted to the cell pointed to by the accessor. For example, if you change the BgColor of FlexLabelCell, the accessor of a cell composed of FlexLabel, the background color of the cell pointed to by FlexLabelCell will change.

Since the accessor is not the cell itself, all operations on the accessor do not affect the cell. For example, accessors can be deleted with the Delete method, but cells are not deleted. Also, the accessor object is preserved even if the cell pointed to by the accessor is lost, such as with the FlexView.DeleteRow method.

Generation of accessors

Accessors cannot be generated directly from a script, they are generated as return values ​​for the FlexView.GetRow , FlexView.InsertRow , and FlexView.DeleteRow methods, and as child objects of the FlexRow object that can be obtained as additional data for various events .

A FlexRow points to a specific row in the table and has a FlexCell derived object in its child object that has the same name as the FlexData derived object from which the cell originated. Each FlexCell derived object points to the corresponding cell in the row that FlexRow points to.

Example accessor returned by InsertRow

A | C | D
B

var row = FlexView1.InsertRow(1,1);

The structure of the FlexRow returned to row. Row points to the new row you inserted.

If you update row.A, it will be reflected in the cell corresponding to A.

row.A.BgColor = $RED;
row.C.Value = "123";

A | one two Three | D
B

Restrictions on using accessors

All accessors must have unique names because they are generated as direct children of FlexRow. On the other hand, FlexItem can be defined hierarchically by making it a child of FlexRowSet and FlexColumnSet, but if there are multiple FlexData derived objects with the same name at that time, the objects with the same name defined after the second one. You will not be able to use the accessor corresponding to by name.

In the case of this example, subsequent LabelA and LabelB (yellow part) cannot be operated by name. By using the GetColumn and GetHeaderColumn methods provided in FlexRow, you can get the FlexCell by position instead of by name, and when operating subsequent LabelA and LabelB,

var lb_a = row.GetColumn(2); /* 3rd column LabelA */
var lb_b = row.GetColumn(3); /* 4th column LabelB */

However, if you change the display position, you will need to modify the program accordingly.

Also, when loading a named CSV, no data will be assigned to subsequent LabelA and LabelB.

Using the same column name often causes such restrictions. Whenever possible, try to give each column a unique name.

Scope of use of accessors

Accessors are spawned dependent on the FlexRow object that points to the row and work with the internal FlexRow object to actually access the cell. Therefore, the accessor object cannot function if the FlexRow object is lost. Make sure to keep the FlexRow object at all times while using the accessor.

Constraints on display order and cursor movement order

FlexData-derived classes that are placed under FlexRecord are displayed from left to right and top to bottom in the order in which they are defined. Also, the left and right arrow keys move the cursor in the defined order. It cannot be displayed in an order different from the definition order, or the cursor movement order cannot be changed.

Constraints on the placement of FlexData derived classes

FlexData derived classes that are placed under FlexRecord have restrictions on the placement order depending on their type. From left to right, FlexTreeHeader, FlexGroupHeader, FlexHeader, and other FlexData-derived classes should be in that order.

You cannot see the FlexTreeHeader on the far right or the FlexHeader on the left side of the FlexGroupHeader.

Constraints on the placement of FlexHeader and derived classes

FlexHeader and derived classes cannot co-exist with classes that are not derived from FlexHeader, such as FlexLabel, under FlexRowSet or FlexColumnSet. Header columns always occupy one row.

Constraints on placement of FlexTreeHeader class

The FlexTreeHeader class cannot be placed under the FlexRowSet. Always occupy one line.

Precautions when scaling

◆ When FlexView is enlarged to eliminate the error of the internal effective area at the time of enlargement, it is adjusted to a size slightly smaller than the logically calculated value.

◆ FlexCheckButton checkboxes are not subject to scaling

◆ The width of the drop-down button of FlexListBox is not subject to scaling.

◆ FlexIndentLabel fold buttons are not scaled


FlexButton class

Object
 | FlexItem
 |  | FlexData
 |  |  | FlexButton

The FlexButton class is a class that defines how cells in FlexView are displayed, and the corresponding cells are displayed like buttons.

Place the FlexButton object below the FlexRecord, FlexColumnSet, or FlexRowSet objects.

If the HorizontalAlign property is set to $STD, the horizontal position will be $CENTER.

If the VerticalAlign property is set to $STD, the vertical position will be $CENTER.

Since the standard button style has priority, the color specification by the BgColor property is invalid.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
SPACE | Press the button

Placement constraints

FlexButton objects cannot be placed to the left (before in definition order) of objects in the FlexHeader class and its derived classes.

When positioned as a child of FlexRowSet and FlexColumnSet, it cannot co-exist with objects in the FlexHeader class and its derived classes.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexButton property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexButton class.

API | name | access | Type | initial value | Explanation
4 | Active | CRW | boolean | $TRUE | Designation of activity
27 | PushedColor | CRW | integer | $STD | Button pressed state color when Style property is FlexView.StyleFlat
27 | Style | CRW | integer | 0 | Display style of button
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexButton.Active property

Specifies the initial value of button activity on the cell.

The value of the Active property is used as the initial value of the activity to display in the cells of each row generated by the FlexView.InsertRow method. You can also change the activity of all existing rows at once by updating the Active property.

To change the activity of a particular cell, get the FlexRow object for the row you want to change and set the Active property of the FlexButtonCell object that will be placed as a child object of FlexRow with the same name as the corresponding FlexButton object.

If set to true, the button can be operated.

If false is specified, button operations are prohibited.


FlexButton.PushedColor property

iOSAndroidWindows

A color constant that specifies the background color when the button is pressed when the Style property is FlexView.StyleFlat.

If you specify $STD, it will be the same as FlexData.BgColor.

The default value is $STD.


FlexButton.Style property

iOSAndroidWindows

Specifies the style of button display. It can be one of the values below:

constant | value | explanation
FlexView.StyleStd | 0 | Displays normal buttons.
FlexView.StyleFlat | 1 | Display the button in a flat design. The background color will be the same as the specified value of the FlexData.BgColor property.

Display example

The default value is FlexView.StyleStd.


FlexButton.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexButton method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexButton class.

Class overview

Base class methods


FlexButton event

API version 4

Event

iOS Android Windows

The following events are defined in the FlexButton class.

API | name | Explanation
4 | Pushed | It occurs when you press a button by tapping etc.
4 | RClicked | Occurs when long tapped

Class overview

Base class event


FlexButton.Pushed event

This is an event that occurs when the button of the cell corresponding to FlexButton is pressed. The Pushed event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexButton.RClicked event

An event that occurs with a long tap on the button of the cell corresponding to the FlexButton. The RClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexButtonCell class

Object
 | FlexCell
 |  | FlexButtonCell

The FlexButtonCell class is an accessor for manipulating FlexView cells generated by FlexButton.

You can manipulate the pointed cell by manipulating the properties of the FlexButtonCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexButtonCell property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexButtonCell class.

API | name | access | Type | initial value | Explanation
4 | Active | CRW | boolean | $TRUE | Active state

access | R | Readable
 | W | Writable
 | C | Initializable
27 | PushedColor | CRW | integer | $STD | Button pressed state color when Style property is FlexView.StyleFlat
27 | Style | CRW | integer | 0 | Display style of button

Class overview

Base class properties


FlexButtonCell.Active property

Specifies the activity of the button on the cell.

If set to true, the button can be operated.

If false is specified, button operations are prohibited.


FlexButtonCell.PushedColor property

iOSAndroidWindows

A color constant that specifies the background color when the button is pressed when the Style property is FlexView.StyleFlat.

If you specify $STD, it will be the same as FlexData.BgColor.


FlexButtonCell.Style property

iOSAndroidWindows

Specifies the style of button display. It can be one of the values below:

constant | value | explanation
FlexView.StyleStd | 0 | Displays normal buttons.
FlexView.StyleFlat | 1 | Display the button in a flat design. The background color will be the same as the specified value of the FlexData.BgColor property.

Display example


FlexButtonCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexButtonCell class.

Class overview

Base class methods


FlexButtonCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexButtonCell class.

Class overview

Base class event


FlexCell class

Object
 | FlexCell

The FlexCell class is an accessor for manipulating FlexView cells. You can manipulate the pointed cell by manipulating the properties of FlexCell.

The FlexCell object is a virtual class that underlies other accessor classes and has no substance. FlexCell derived classes cannot be created directly from a script and are created as child objects of the FlexRow object by methods that return FlexRow.


FlexCell property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexCell class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Data | CRW | String |  | General purpose data
4 | FgColor | CRW | integer | $STD | Letter color
4 | Value | CRW | * |  | Cell value

* Determined by the ValueType of the original FlexData inheritance class.

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexCell.BgColor property

Specifies the background color of the cell.

The background color that is actually displayed varies depending on the cell type and state.


FlexCell.Data property

A generic string property. It can be used for any purpose in the application.


FlexCell.FgColor property

Specifies the text color of the cell.

The color that is actually displayed varies depending on the cell type and state.


FlexCell.Value property

The value of the cell.

The cell value is displayed in the cell, but how it is displayed depends on the cell type.


FlexCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexCell class.

Class overview

Base class methods


FlexCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexCell class.

Class overview

Base class event


FlexCheckButton class

Object
 | FlexItem
 |  | FlexData
 |  |  | FlexCheckButton

The FlexCheckButton class is a class that defines how cells in FlexView are displayed, and the corresponding cells are displayed like checkboxes.

Place the FlexCheckButton object below the FlexRecord, FlexColumnSet, or FlexRowSet objects.

If the VerticalAlign property is set to $STD, the vertical position will be $CENTER.

The tap operation for checking is valid for the entire FlexCheckButton.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
SPACE | Invert check status

Placement constraints

FlexCheckButton objects cannot be placed to the left (before in definition order) of objects in the FlexHeader class and its derived classes.

When positioned as a child of FlexRowSet and FlexColumnSet, it cannot co-exist with objects in the FlexHeader class and its derived classes.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexCheckButton property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexCheckButton class.

API | name | access | Type | initial value | Explanation
4 | Active | CRW | boolean | $TRUE | Active state
4 | Border | CRW | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | BorderStyle | CRW | integer | $SUNKEN | Border type
28 | BorderWidth | CRW | Number | 0 | Border width
27 | FlatCheckColor | CRW | integer | $STD | Checkbox color when the Style property is FlexView.StyleFlat
4 | Selected | CRW | boolean | $TRUE | Check status
27 | Style | CRW | integer | 0 | Display style of checkbox
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexCheckButton.Active property

Specifies the initial value of the activity of the check button on the cell.

The value of the Active property is used as the initial value of the activity to display in the cells of each row generated by the FlexView.InsertRow method. You can also change the activity of all existing rows at once by updating the Active property.

To change the activity of a particular cell, get the FlexRow object for the row you want to change and set the Active property of the FlexCheckButtonCell object that will be placed as a child object of FlexRow with the same name as the corresponding FlexCheckButton object.

If set to true, the button can be operated.

If false is specified, button operations are prohibited.


BorderStyle property

Specify the border type. Only valid if the Border property is $TRUE.

constant | value | Explanation
$SUNKEN | 0 | The whole is displayed in a concave shape
$RISED | 1 | The whole is displayed in a convex shape
$ETCHED | 2 | Display the border with a concave shape
$BUMP | 3 | Display the border with a convex shape
$GRAYFRAME | 4 | Border is displayed in two colors of gray
$SOFT | 5 | Displays a frame in black and white
$SOFTETCHED | 6 | Displays the border with a soft concave shape
$SOFTBUMP | 7 | Displays the frame line as a soft convex shape
$PLANE | 8 | Display with black single line
$DASH | 9 | Display with a long dotted line
$DOT | 10 | Display with fine dotted lines
$FLATSUNKEN | 11 | The whole is displayed with a low concave shape
$FLATRISED | 12 | Displays the whole as a low convex shape

Display example


FlexCheckButton.FlatCheckColorプロパティ

API version 27

FlexCheckButton.FlatCheckColor property

iOSAndroidWindows

Checkbox color when Style property is FlexView.StyleFlat color constant.

Specifying $STD is the same as FlexData.FgColor.

The default value is $STD.


FlexCheckButton.Selected property

Specify the initial value of the selected state of the check box.

The value of the Selected property is used as the initial value for the selected state of each cell generated by the FlexView.InsertRow method.

You can also update the cell values ​​in all existing rows at once by updating the Selected property.

To update the value of a particular cell, get the FlexRow object in the row you want to change and set the Selected property of the FlexCell object that will be placed as a child object of FlexRow with the same name as the FlexItem object in the column you want to change.


FlexCheckButton.Style property

iOSAndroidWindows

Specifies the display style of the check box. It can be one of the values below:

constant | value | explanation
FlexView.StyleStd | 0 | Display a normal checkbox.
FlexView.StyleFlat | 1 | Display a checkbox in a flat design. The background color will be the same as the specified value of the FlexData.BgColor property. The icon color will be the same as the value specified in the FlexData.FgColor property.

Display example

The default value is FlexView.StyleStd.


FlexCheckButton.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexCheckButton method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexCheckButton class.

Class overview

Base class methods


FlexCheckButton event

API version 4

Event

iOS Android Windows

The following events are defined in the FlexCheckButton class.

API | name | Explanation
4 | CheckChanged | It occurs when the check is turned on / off by tapping etc.
4 | RClicked | Occurs when long tapped

Class overview

Base class event


FlexCheckButton.CheckChanged event

This event occurs when the check status of the cell corresponding to FlexCheckButton is changed. The CheckChanged event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexCheckButton.RClicked event

This event is generated by a long tap on the cell corresponding to FlexCheckButton. The RClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexCheckButtonCell class

Object
 | FlexCell
 |  | FlexCheckButtonCell

The FlexCeckButtonCell class is an accessor for manipulating FlexView cells generated by FlexCehckButton.

You can manipulate the pointed cell by manipulating the properties of FlexCheckButtonCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexCheckButtonCell property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexCheckButtonCell class.

API | name | access | Type | initial value | Explanation
4 | Active | CRW | boolean | $TRUE | Designation of activity
27 | FlatCheckColor | CRW | integer | $STD | Checkbox color when the Style property is FlexView.StyleFlat
4 | Selected | CRW | boolean | $TRUE | Check status

access | R | Readable
 | W | Writable
 | C | Initializable
27 | Style | CRW | integer | 0 | Display style of checkbox

Class overview

Base class properties


FlexCheckButtonCell.Active property

Specifies the activity of the check button on the cell.

If set to true, the check button can be operated.

If false is specified, the operation of the check button is prohibited.


FlexCheckButtonCell.FlatCheckColor property

iOSAndroidWindows

Checkbox color when Style property is FlexView.StyleFlat color constant.

Specifying $STD is the same as FlexData.FgColor.


FlexCheckButtonCell.Selected property

Specifies the selected state of the check box.


FlexCheckButtonCell.Style property

iOSAndroidWindows

Specifies the display style of the check box. It can be one of the values below:

constant | value | explanation
FlexView.StyleStd | 0 | Display a normal checkbox.
FlexView.StyleFlat | 1 | Display a checkbox in a flat design. The background color will be the same as the specified value of the FlexData.BgColor property. The icon color will be the same as the value specified in the FlexData.FgColor property.

Display example


FlexCheckButtonCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexCheckButtonCell class.

Class overview

Base class methods


FlexCheckButtonCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexCheckButtonCell class.

Class overview

Base class event


FlexColumnSet class

Object
 | FlexItem
 |  | FlexColumnSet

FlexColumnSet is a class that defines how to display the columns of the FlexView class, and displays the derived classes of FlexItem placed under it side by side in the horizontal direction.

Screen display example

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexColumnSet property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexColumnSet class.

API | name | access | Type | Explanation
4 | Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexColumnSet.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


FlexColumnSet method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexColumnSet class.

Class overview

Base class methods


FlexColumnSet event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexColumnSet class.

Class overview

Base class event


FlexData class

Object
 | FlexItem
 |  | FlexData

FlexData is a class that defines how cells in the FlexView class are displayed. FlexData is a virtual class that is the basis of other classes and has no substance.


FlexData property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexData class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Data | CRW | String |  | General purpose data
4 | FgColor | CRW | integer | $STD | Letter color
4 | Format | CR | String |  | Format string
4 | HorizontalAlign | CR | integer | $STD | Horizontal placement
4 | Value | CRW | * |  | Initial value of cell
4 | VerticalAlign | CR | integer | $STD | Vertical placement

* Depends on the ValueType of the inherited class

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexData.BgColor property

Specifies the initial value of the cell background color. If the default value is $STD, the display color will be different for each class derived from FlexData.

The value of the BgColor property is used as the initial value for the background color of each cell generated by the FlexView.InsertRow method. You can also change the background color of cells in all existing rows at once by updating the BgColor property.

To update the value of a particular cell, get the FlexRow object in the row you want to change and set the BgColor property of the FlexCell object that will be placed as a child object of FlexRow with the same name as the FlexItem object in the column you want to change.


FlexData.Data property

A general-purpose string property. It can be used for any purpose of the application. The Data property is copied as the initial value of the Data property that each cell has when generating the FlexView column.


FlexButton.FgColor property

API version 4

FlexData.FgColor property

iOS Android Windows

Specify the initial value of the text color of the cell. If the default value is $STD, the display color will be different for each class derived from FlexData.

The value of the FgColor property is used as the initial value for the text color of each cell generated by the FlexView.InsertRow method. You can also change the text color of cells in all existing rows at once by updating the FgColor property.

To update the value of a particular cell, get the FlexRow object in the row you want to change and set the FgColor property of the FlexCell object that will be placed as a child object of FlexRow with the same name as the FlexItem object in the column you want to change.


FlexData.HorizontalAlign property

Performs horizontal alignment. $STD is left justified.

constant | value | Explanation
$STD | 0 | Same as $LEFT *
$LEFT | 1 | Left justified
$CENTER | 2 | Centered
$RIGHT | 3 | Right justified

* The default alignment may differ depending on the object. See also the page for each class.


FlexData.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

The value of the Value property is used as the initial value for the cells in each row generated by the FlexView.InsertRow method. Note that the Value property itself is not displayed in the cell, but the copied value as the initial value of the cell.

You can update the cell values ​​in all existing rows at once by updating the Value property.

To update the value of a particular cell, get the FlexRow object in the row you want to change and set the Value property of the FlexCell object that will be placed as a child object of FlexRow with the same name as the FlexItem object in the column you want to change.


FlexData.VerticalAlign property

Performs vertical alignment. $STD is upside down.

constant | value | Explanation
$STD | 0 | Same as $TOP *
$TOP | 1 | Top alignment
$CENTER | 2 | Centered
$BOTTOM | 3 | Bottom alignment

If you specify the FlexLabel VerticalAlign property, the characters in the FlexLabel cannot be wrapped.
If VerticalAlign is not specified, the characters in the FlexLabel will be wrapped.

* The default alignment may differ depending on the object. See also the page for each class.


FlexData method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexData class.

Class overview

Base class methods


FlexData event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexData class.

Class overview

Base class event


FlexGroupHeader class

Object |  |  |  |
 | FlexItem
 |  | FlexData
 |  |  | FlexHeader
 |  |  |  | FlexGroupHeader

The FlexGroupHeader class is a class that defines how FlexView row headers are displayed.

Corresponding header cells can display cell values ​​and row numbers, similar to FlexHeader. Also, the horizontal scroll is fixed, it is always displayed on the left side and the cursor cannot be placed.

The cells corresponding to FlexGroupHeader are displayed by key break of the cell value or grouped by the specified number of rows.

Place the FlexGroupHeader object under the FlexRecord or FlexColumnSet object.

If the HorizontalAlign property is set to $STD, the horizontal position will be $CENTER.

If the VerticalAlign property is set to $STD, the vertical position will be $CENTER.

Screen display example

Placement constraints

FlexGroupHeader objects cannot be placed to the right (after in definition order) of objects of classes derived from FlexHeader and non-FlexHeader.

When positioned as a child of FlexColumnSet, it cannot live with objects of classes derived from anything other than FlexHeader.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexGroupHeader property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexGroupHeader class.

API | name | access | Type | initial value | Explanation
4 | GroupCount | CRW | integer | 0 | Group unit
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexGroupHeader.GroupCount property

Specifies the number of rows to group.

If you specify 0, grouping by the number of rows is not performed, but grouping by key break by cell value is performed.

If you specify a value greater than 0, the cell value is not considered and is grouped by the specified number of rows.

Display example

GroupCount = 0

GroupCount = 2


FlexGroupHeader.HorizontalAlign property

Performs horizontal alignment. $STD is centered.

constant | value | Explanation
$STD | 0 | Same as $CENTER
$LEFT | 1 | Left justified
$CENTER | 2 | Centered
$RIGHT | 3 | Right justified


FlexGroupHeader.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexGroupHeader method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexGroupHeader class.

Class overview

Base class methods


FlexGroupHeader event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexGroupHeader class.

Class overview

Base class event


FlexGroupHeaderCell class

Object
 | FlexCell
 |  | FlexGroupHeaderCell

The FlexGroupHeaderCell class is an accessor for manipulating FlexView cells generated by FlexGroupHeader.

You can manipulate the pointed cell by manipulating the properties of FlexGroupHeaderCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexGroupHeaderCell property

API version 4

Property

iOS Android Windows

There are no properties defined in the FlexGroupHeaderCell class.

Class overview

Base class properties


FlexGroupHeaderCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexGroupHeaderCell class.

Class overview

Base class methods


FlexGroupHeaderCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexGroupHeaderCell class.

Class overview

Base class event


FlexHeader class

Object
 | FlexItem
 |  | FlexData
 |  |  | FlexHeader

The FlexHeader class is a class that defines how to display the row headers of FlexView.

Corresponding header cells can display cell values ​​and row numbers. Also, the horizontal scroll is fixed, it is always displayed on the left side and the cursor cannot be placed.

Place the FlexHeader object below the FlexRecord, FlexColumnSet, or FlexRowSet objects.

If the HorizontalAlign property is set to $STD, the horizontal position will be $CENTER.

If the VerticalAlign property is set to $STD, the vertical position will be $CENTER.

Screen display example

Placement constraints

FlexHeader objects cannot be placed to the right (after in definition order) of objects in classes derived from anything other than FlexHeader.

When positioned as a child of FlexRowSet and FlexColumnSet, it cannot co-exist with objects of classes derived from anything other than FlexHeader.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexHeader property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexHeader class.

API | name | access | Type | initial value | Explanation
4 | Border | CRW | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | BorderStyle | CRW | integer | $SUNKEN | Border type
28 | BorderWidth | CRW | Number | 0 | Border width
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
4 | Icon | CRW | integer | 0 | Icon number
4 | Numbered | CRW | boolean | $FALSE | Line number display
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexHeader.HorizontalAlign property

Performs horizontal alignment. $STD is centered.

constant | value | Explanation
$STD | 0 | Same as $CENTER
$LEFT | 1 | Left justified
$CENTER | 2 | Centered
$RIGHT | 3 | Right justified


FlexHeader.Icon property

Specifies the initial value of the icon to be displayed in the cell.

The value of the Icon property is used as the initial value for the icon displayed in the cells of each row generated by the FlexView.InsertRow method. You can also change the cell icons in all existing rows at once by updating the Icon property.

The value to be specified is the number starting from 0 in the ImegaList set by the setImage method to specify which icon to display.

To display a particular cell with a different icon, get the FlexRow object for the row you want to change and set the Icon property of the FlexHeaderCell object that will be placed as a child object of FlexRow with the same name as the corresponding FlexHeader object.

Display example


FlexHeader.Numbered property

Select whether to display the Value property value in the cell or the row number.

For $FALSE, the Value value is formatted and displayed with the Format property.

For $TRUE, the value of the Value property is preserved but not displayed, with line numbers starting at 1. The line number display is not formatted by the Format property.

Display example

Numbered = $FALSE

Numbered = $TRUE


FlexHeader.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexHeader method

API version 4

Method

iOS Android Windows

The following methods are defined in the FlexHeader class.

API | name | Explanation
4 | ResetImage | Discard the image list set by the SetImage method
4 | SetImage | Sets the image list used to display the cell icon

Class overview

Base class methods


FlexHeader.ResetImage method

Explanation

Discards the image list set by the SetImage method.

Call format

FlexHeader1.ResetImage()

Return value

None

argument

None

exception

None

Example of use

FlexHeader1.ResetImage();

Related item

SetImage method


FlexHeader.SetImage method

Explanation

Sets the image list used to display the cell icon.

Display example

If the icon to display is larger than the row height, it will be reduced while maintaining the aspect ratio.

Call format

FlexHeader1.SetImage( img )

Return value

None

argument

ImageList img

ImageList object that holds the image list you want to display

exception

None

Example of use

FlexHeader FlexHeader1 {
    ::
}
var img = new ImageList {
    MaskUse = $TRUE;
    MaskColR = 1;
    LoadImage("icons.png");
}
FlexHeader1.SetImage(img);
FlexHeader1.Icon = 0;

Related item

Icon property

ResetImage method

ImageList class


FlexHeader event

API version 4

Event

iOS Android Windows

The following events are defined in the FlexHeader class.

API | name | Explanation
4 | Clicked | Occurs when tapped
4 | DoubleClicked | Occurs when double tapped
4 | RClicked | Occurs when long tapped

Class overview

Base class event


FlexHeader.Clicked event

This is an event that occurs when you tap on the cell corresponding to FlexHeader.

The Clicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexHeader.DoubleClicked event

This event is generated by double tapping on the cell corresponding to FlexHeader.

The DoubleClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexHeader.RClicked event

This event is generated by a long tap on the cell corresponding to FlexHeader.

The RClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexHeaderCell class

Object
 | FlexCell
 |  | FlexHeaderCell

The FlexHeaderCell class is an accessor for manipulating FlexView cells generated by FlexHeader.

You can manipulate the pointed cell by manipulating the properties of FlexHeaderCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexHeaderCell property

API version 4

Property

iOS Android Windows

There are no properties defined in the FlexHeaderCell class.

Class overview

Base class properties


FlexHeaderCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexHeaderCell class.

Class overview

Base class methods


FlexHeaderCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexHeaderCell class.

Class overview

Base class event


FlexIndentLabel class

Object |  |  |  |
 | FlexItem
 |  | FlexData
 |  |  | FlexLabel
 |  |  |  | FlexIndentLabel

The FlexIndentLabel class is a class that defines how FlexView cells are displayed.

FlexIndentLabel is a class derived from FlexLabel, and can display character strings and icons in the same way as FlexLabel. In addition, indented display can be performed by specifying the Key property and ParentKey property. This display is similar to FlexTreeHeader, but FlexIndentLabel is a hierarchical display within a single column, and the depth of the hierarchy changes dynamically depending on the data set in the Key and ParentKey properties. Also, the part that can be collapsed is only the beginning of the indent, but the contents of the following columns are also displayed in the collapsed row.

Place the FlexIndentLabel object below the FlexRecord object.

If the VerticalAlign property is set to $STD, the vertical position will be $CENTER.

Tap operations that raise the Clicked event and collapse subsequent columns are valid for the entire FlexIndentLabel.

Screen display example

Placement constraints

FlexIndentLabel objects cannot be placed to the left (before in definition order) of objects in FlexHeader and its derived classes.

FlexIndentLabel cannot be used in more than one column.

It can be placed as a child of FlexColumnSet, but the indented connecting lines are not connected.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexIndentLabel property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexIndentLabel class.

API | name | access | Type | initial value | Explanation
4 | Foldable | CRW | boolean | $TRUE | Whether or not folding operation is possible
4 | Folding | CRW | boolean | $FALSE | Folded state
4 | Indent | CRW | boolean | $TRUE | Indented state
4 | Key | CRW | String |  | My key
4 | ParentKey | CRW | String |  | Parent key
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexIndentLabel.Foldable property

Specify whether to allow folding by operating the screen.

If you specify $TRUE, it will be foldable and each cell will display a box showing the fold status. If you specify $FALSE, folding is not possible and the box showing the folded state is not displayed.

Foldable = $TRUE

Foldable = $FALSE


FlexIndentLabel.Folding property

Specifies the folded state.

If True is specified, it will be in the folded state, and if False is specified, it will be in the open state. Folding and unfolding with the Folding property is available regardless of the Foldable property specified.


FlexIndentLabel.Indent property

Specifies the indent display state.

If True is specified, the indent will be displayed, and if False is specified, the indent will not be displayed.


FlexIndentLabel.Key property

This is the key value for indentation display. Normally, this property is specified only for individual cells.

The Key property is used together with the ParentKey property. Subsequent lines that have the same value in the ParentKey property as the value specified in the Key property are displayed connected as a parent and child.

Display example

line | Key property value | The value of the ParentKey property
1 | Kanto |
2 | Tokyo | Kanto
3 | Ikebukuro | Tokyo
4 | Shinjuku | Tokyo
5 | Ueno | Tokyo
6 | Shinagawa | Tokyo
7 | Chiba | Kanto
8 | Funabashi | Chiba
9 | Narita | Chiba


FlexIndentLabel.ParentKey property

This is the key value for indentation display. Normally, this property is specified only for individual cells.

The ParentKey property is used together with the Key property. Subsequent lines that have the same value in the ParentKey property as the value specified in the Key property are displayed connected as a parent and child.

Display example

line | Key property value | The value of the ParentKey property
1 | Kanto |
2 | Tokyo | Kanto
3 | Ikebukuro | Tokyo
4 | Shinjuku | Tokyo
5 | Ueno | Tokyo
6 | Shinagawa | Tokyo
7 | Chiba | Kanto
8 | Funabashi | Chiba
9 | Narita | Chiba


FlexIndentLabel.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexIndentLabel method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexIndentLabel class.

Class overview

Base class methods


FlexIndentLabel event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexIndentLabel class.

Class overview

Base class event


FlexIndentLabelCell class

Object
 | FlexCell
 |  | FlexILabelCell
 |  |  | FlexIndentLabelCell

The FlexIndentLabelCell class is an accessor for manipulating FlexView cells generated by FlexIndentLabel.

You can manipulate the pointed cell by manipulating the properties of FlexIndentLabelCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexIndentLabelCell property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexIndentLabelCell class.

API | name | access | Type | initial value | Explanation
4 | Folding | CRW | boolean | $FALSE | Folded state
4 | Key | CRW | String |  | Own key
4 | ParentKey | CRW | String |  | Parent key

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


FlexIndentLabelCell.Folding property

Indicates the folded state.

True indicates the collapsed state, and False indicates the unfolded state.

Lines that cannot be folded have no meaning.


FlexIndentLabelCell.Key property

This is the key value for indentation display.

The Key property is used together with the ParentKey property. Subsequent lines that have the same value in the ParentKey property as the value specified in the Key property are displayed connected as a parent and child.

Display example

line | Key property value | The value of the ParentKey property
1 | Kanto |
2 | Tokyo | Kanto
3 | Ikebukuro | Tokyo
4 | Shinjuku | Tokyo
5 | Ueno | Tokyo
6 | Shinagawa | Tokyo
7 | Chiba | Kanto
8 | Funabashi | Chiba
9 | Narita | Chiba


FlexIndentLabelCell.ParentKey property

This is the key value for indentation display.

The ParentKey property is used together with the Key property. Subsequent lines that have the same value in the ParentKey property as the value specified in the Key property are displayed connected as a parent and child.

Display example

line | Key property value | The value of the ParentKey property
1 | Kanto |
2 | Tokyo | Kanto
3 | Ikebukuro | Tokyo
4 | Shinjuku | Tokyo
5 | Ueno | Tokyo
6 | Shinagawa | Tokyo
7 | Chiba | Kanto
8 | Funabashi | Chiba
9 | Narita | Chiba


FlexIndentLabelCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexIndentLabelCell class.

Class overview

Base class methods


FlexIndentLabelCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexIndentLabelCell class.

Class overview

Base class event


FlexItem class

Object
 | FlexItem

FlexItem is a class that defines how columns of the FlexView class are displayed. FlexItem is a virtual class that is the basis of other classes and has no substance.


FlexItem property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexItem class.

API | name | access | Type | initial value | Explanation
4 | Title | CRW | String |  | Column title
4 | TitleBgColor | CRW | integer | $STD | Title background color
4 | TitleFgColor | CRW | integer | $STD | Title text color
4 | TitleHorzAlign | CR | integer | $STD | Horizontal allocation of titles
4 | TitleMarker | CRW | integer | 0 | Designation of title marker
HT (10) | TitleResize | CRW | boolean | $FALSE | Whether the column width can be changed
4 | TitleRows | CR | integer | 0 | Title occupancy
27 | TitleStyle | CRW | integer | -1 | Style of title
4 | TitleVertAlign | CR | integer | $STD | Vertical assignment of titles
4 | Width | CRW | integer | 100 | Column width

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


FlexItem.Title property

Specifies the column title.

The titles of FlexColumnSets and FlexRowSets are displayed separately from the FlexItems placed below them.

If you do not want to display the title, set the string "null". Even if null is set, it becomes "null" by character string conversion, so it is synonymous.

If "null" is set, it will be hidden including the title frame, and if possible, the display area will not be allocated.

Display example when Title = null is not specified

Display example when Title = null is specified

Script example

FlexRecord FlexRecord1 {
    FlexHeader header {
        Numbered = $TRUE;
    }
    FlexLabel FlexLabel4 {
        Title = "Label4";
    }
    FlexRowSet RowSet1 {
        Title = null;
        FlexColumnSet ColSet1 {
            Title = null;
            FlexLabel FlexLabel2 {
                Title = "Label2";
            }
            FlexLabel FlexLabel3 {
                Title = "Label3";
            }
        }
        FlexLabel FlexLabel4 {
            Title = "Label4";
        }
    }
}


FlexItem.TitleBgColor property

Specifies the background color for column titles.

The title background color is affected by the TitleBgColor property as well as the TitleBgColor defined in FlexView. As shown in the following table, the FlexItem TitleBgColor specification takes precedence.

FlexItem.TitleBgColor | FlexView.TitleBgColor | Display color
unspecified | unspecified | Default color
unspecified | Specified | FlexView.TitleBgColor
Specified | unspecified | FlexItem.TitleBgColor
Specified | Specified | FlexItem.TitleBgColor

TitleBgColor specification example

FlexView FlexView1 {
    ::
    TitleBgColor = $6666FF;
    ::
    FlexRecord FlexRecord1 {
        ::
        FlexColumnSet FlexColumnSet1 {
            ::
            Title = "TreeSet";
            TitleBgColor = $33FF33;
            ::
            FlexTreeHeader FlexTreeHeader1 {
                Title = "Tree1";
                ::
            }
            FlexTreeHeader FlexTreeHeader2 {
                Title = "Tree2";
                ::
            }
        }
    }
}


FlexItem.TitleFgColor property

Specifies the text color of the column title.

In addition to the TitleFgColor property, the text color of the title is also affected by the TitleFgColor defined in FlexView. As shown in the following table, the FlexItem TitleFgColor specification takes precedence.

FlexItem.TitleFgColor | FlexView.TitleFgColor | Display color
unspecified | unspecified | Default color
unspecified | Specified | FlexView.TitleFgColor
Specified | unspecified | FlexItem.TitleFgColor
Specified | Specified | FlexItem.TitleFgColor

TitleFgColor specification example

FlexView FlexView1 {
    ::
    TitleFgColor = $3333FF;
    ::
    FlexRecord FlexRecord1 {
        ::
        FlexColumnSet FlexColumnSet1 {
            ::
            Title = "TreeSet";
            TitleFgColor = $FF0000;
            ::
            FlexTreeHeader FlexTreeHeader1 {
                Title = "Tree1";
                ::
            }
            FlexTreeHeader FlexTreeHeader2 {
                Title = "Tree2";
                ::
            }
        }
    }
}


FlexItem.TitleHorzAlign property

Specifies the horizontal assignment of column titles.

In addition to the TitleHorzAlign property, title assignment is also affected by the HorizontalAlign property defined by FlexLabel, FlexTextBox, and so on. The TitleHorzAlign specification takes precedence, as shown in the following table.

TitleHorzAlign | HorizontalAlign | allocation
unspecified | unspecified | Centered
unspecified | Specified | Follow HorizontalAlign
Specified | unspecified | Follow Title Horz Align
Specified | Specified | Follow Title Horz Align

TitleHorzAlign specification example


FlexItem.TitleMarker property

Specifies the marker to display in the column title.

You can specify $UPMARKER and $DOWNMARKER. If you specify 0, the marker is not displayed.

constant | Explanation
$UPMARKER | △ is displayed on the right side of the title character
$DOWNMARKER | ▽ is displayed on the right side of the title character

Title Marker specification example


FlexItem.TitleResize property

Specify whether to resize the column width by mouse operation of the column title.

If you specify true, you can change the column width by dragging the column border with the mouse.

If false is specified, the column width will be fixed.

Changing the column width is limited to columns that consist of a single FlexItem. Boundaries involving multiple columns in combination with FlexColumnSet and FlexRowSet cannot be changed regardless of the TitleResize property specified.


FlexItem.TitleRows property

Specify the occupancy in the number of rows when a multi-row column title is displayed.

When displaying multi-row column titles, by default each row is displayed at equal height. If you specify the TitleRows property, the title displayed by the specified FlexItem will be displayed occupying the specified number of rows. The actual height displayed is determined by dividing the height of the entire title defined by FlexView.TitleHeight by the total number of rows using the value of the TitleRows property. For example, when a two-row title is displayed, if one of the TitleRows properties is specified as 2, it will be apportioned by 2/3 and 1/3 of the TitleHeight.

TitleRows specification example

FlexView FlexView1 {
    ::
    FlexRecord FlexRecord1 {
        ::
        FlexRowSet FlexRowSet1 {
            ::
            Title = "TitleRows = 3";
            TitleRows = 3;
            ::
            FlexCheckButton FlexCheckButton1 {
                ::
                Title = "TitleRows = 2";
                TitleRows = 2;
                ::
            }
            FlexTextBox FlexTextBox1 {
                ::
                Title = "TitleRows = 1";
                TitleRows = 1;
                ::
            }
        }
    }
}


FlexItem.TitleStyle property

iOSAndroidWindows

Specifies how the title is displayed. It can be one of the values below:

constant | value | explanation
FlexView.StyleNone | -1 | As specified by the FlexView.TitleStyle property.
FlexView.StyleStd | 0 | Normal title display.
FlexView.StyleFlat | 1 | Display the title in a flat design.

Display example

The default value is FlexView.StyleNone.


FlexItem.TitleVertAlign property

Specifies the vertical allocation of column titles.

In addition to the TitleVertAlign property, title assignment is also affected by the VerticalAlign property defined by FlexLabel, FlexTextBox, and so on. The TitleVertAlign specification takes precedence, as shown in the following table.

TitleVertAlign | VerticalAlign | allocation
unspecified | unspecified | Centered
unspecified | Specified | Follow Vertical Align
Specified | unspecified | Follow Title Vert Align
Specified | Specified | Follow Title Vert Align

TitleVertAlign specification example


FlexItem.Width property

Specifies the width of the column.

FlexColumnSets and FlexItems placed below FlexRowSet will not be displayed beyond the upper width. Be sure to specify the upper Width with a size that fits the lower FlexItem.

In this example, the total Width of Label2 and Label3 must match the Width of Label4.


FlexItem method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexItem class.

Class overview

Base class methods


FlexItem event

API version 4

Event

iOS Android Windows

The following events are defined in the FlexItem class.

API | name | Explanation
4 | TitleDClicked | Occurs with a double tap on the title
4 | TitleLClicked | Occurs with a tap on the title
4 | TitleRClicked | Occurs with a long tap on the title

Class overview

Base class event


FlexItem.TitleDClicked event

It is an event that occurs by double tap on the title.

The following child objects are added to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.


FlexItem.TitleLClicked event

An event that occurs when you tap the title.

The following child objects are added to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.


FlexItem.TitleRClicked event

It is an event that occurs with a long tap on the title.

The following child objects are added to the Event object.

Type | name | Explanation
Number | ShiftKey | It is retained for compatibility. The value is always 0.
Number | CtrlKey | It is retained for compatibility. The value is always 0.
Number | AltKey | It is retained for compatibility. The value is always 0.


FlexLabel class

Object
 | FlexItem
 |  | FlexData
 |  |  | FlexLabel

The FlexLabel class is a class that defines how cells in FlexView are displayed, and the corresponding cells are displayed like labels.

Place the FlexLabel object below the FlexRecord, FlexColumnSet, or FlexRowSet objects.

If you specify the VerticalAlign property, the characters in the FlexLabel cannot be wrapped.

If you do not specify the VerticalAlign property, the characters in the FlexLabel are wrapped. At that time, word wrap is taken into consideration for the line break position, and if no word break is found in alphabetic characters, no line break is performed.

If the character does not fit within the right edge of the display range, it will be displayed on the next line with a line break. Word wrap is taken into consideration for the line break position, and if no word break is found in alphabetic characters, no line break will occur.

Screen display example

Placement constraints

FlexLabel objects cannot be placed to the left (before in definition order) of objects in the FlexHeader class and its derived classes.

When positioned as a child of FlexRowSet and FlexColumnSet, it cannot co-exist with objects in the FlexHeader class and its derived classes.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexLabel property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexLabel class.

API | name | access | Type | initial value | Explanation
4 | Border | CRW | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | BorderStyle | CRW | integer | $SUNKEN | Border type
28 | BorderWidth | CRW | Number | 0 | Border width
4 | Icon | CRW | integer | 0 | Initial value of icon number to be displayed in cell
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexLabel.Icon property

Specifies the initial value of the icon to be displayed in the cell.

The value of the Icon property is used as the initial value for the icon displayed in the cells of each row generated by the FlexView.InsertRow method. You can also change the cell icons in all existing rows at once by updating the Icon property.

The value to be specified is the number starting from 0 in the ImegaList set by the setImage method to specify which icon to display.

To display a particular cell with a different icon, get the FlexRow object for the row you want to change and set the Icon property of the FlexLabelCell object that will be placed as a child object of FlexRow with the same name as the corresponding FlexLabel object.

Display example


FlexLabel.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexLabel method

API version 4

Method

iOS Android Windows

The following methods are defined in the FlexLabel class.

API | name | Explanation
4 | ResetImage | Discard the image list set by the SetImage method
4 | SetImage | Sets the image list used to display the cell icon

Class overview

Base class methods


FlexLabel.ResetImage method

Explanation

Discards the image list set by the SetImage method.

Call format

FlexLabel1.ResetImage()

Return value

None

argument

None

exception

None

Example of use

FlexLabel1.ResetImage();

Related item

SetImage method


FlexLabel.SetImage method

Explanation

Sets the image list used to display the cell icon.

Display example

If the icon to display is larger than the row height, it will be reduced while maintaining the aspect ratio.

Call format

FlexLabel1.SetImage( img )

Return value

None

argument

ImageList img

ImageList object that holds the image list you want to display

exception

None

Example of use

FlexLabel FlexLabel1 {
    ::
}
var img = new ImageList {
    MaskUse = $TRUE;
    MaskColR = 1;
    LoadImage("icons.png");
}
FlexLabel1.SetImage(img);
FlexLabel1.Icon = 0;

Related item

Icon property

ResetImage method

ImageList class


FlexLabel event

API version 4

Event

iOS Android Windows

The following events are defined in the FlexLabel class.

API | name | Explanation
4 | Clicked | Occurs when tapped
4 | DoubleClicked | Occurs when double tapped
4 | RClicked | Occurs when long tapped

Class overview

Base class event


FlexLabel.Clicked event

This is an event that occurs when you tap on the cell corresponding to FlexLabel.

The Clicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexLabel.DoubleClicked event

This event is generated by double tapping on the cell corresponding to FlexLabel.

The DoubleClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexLabel.RClicked event

This event is generated by a long tap on the cell corresponding to FlexLabel.

The RClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor placed at that point. You may be pointing to a different line than the position you are in. Therefore, in order to operate the data at the position where the event occurred, please specify the row by the row of the event.


FlexLabelCell class

Object
 | FlexCell
 |  | FlexLabelCell

The FlexLabelCell class is an accessor for manipulating FlexView cells generated by FlexLabel.

You can manipulate the pointed cell by manipulating the properties of FlexLabelCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexLabelCell property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexLabelCell class.

API | name | access | Type | initial value | Explanation
4 | Icon | CRW | integer | 0 | Initial value of icon number to be displayed in cell

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


FlexLabelCell.Icon property

Specifies the icon to display in the cell.

The value to be specified is the number starting from 0 in the ImegaList set by the setImage method to specify which icon to display.

Display example


FlexLabelCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexLabelCell class.

Class overview

Base class methods


FlexLabelCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexLabelCell class.

Class overview

Base class event


FlexListBox class

Object
 | FlexItem
 |  | FlexData
 |  |  | FlexListBox

The FlexListBox class is a class that defines how to display cells in FlexView, and the corresponding cells are displayed like a pull-down list.

Place the FlexListBox object below the FlexRecord, FlexColumnSet, or FlexRowSet objects.

The tap operation that raises the Clicked event and opens / closes the list is valid for the entire FlexListBox.
Since the standard list style has priority, the color specification by the BgColor property is invalid.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
F4 | Display of choices
SPACE | Display of choices

Placement constraints

FlexListBox objects cannot be placed to the left (before in definition order) of objects in the FlexHeader class and its derived classes.

When positioned as a child of FlexRowSet and FlexColumnSet, it cannot co-exist with objects in the FlexHeader class and its derived classes.


FlexListBox property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexListBox class.

API | name | access | Type | initial value | Explanation
4 | Active | CRW | boolean | $TRUE | Designation of activity
HT (10) | AutoCursorMove | CR | boolean | $FALSE | Automatic movement of cell cursor
4 | Border | CRW | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | BorderStyle | CRW | integer | $SUNKEN | Border type
28 | BorderWidth | CRW | Number | 0 | Border width
HT (10) | DropdownKey | CR | integer |  | Specify the key to drop down
HT (10) | DropdownStyle | CR | integer | $STD | How to display the selection list
27 | FlatIconColor | CRW | integer | $STD | Listbox icon color
HT (10) | KeySelect | CRW | boolean | $FALSE | Whether or not items can be selected by key input
4 | ListData | CRW | String |  | List choices
27 | Style | CRW | integer | 0 | List box display style
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation
4 | Value | CRW | String |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexListBox.Active property

Specifies the initial value of button activity on the cell.

The value of the Active property is used as the initial value of the activity to display in the cells of each row generated by the FlexView.InsertRow method. You can also change the activity of all existing rows at once by updating the Active property.

To change the activity of a particular cell, get the FlexRow object for the row you want to change and set the Active property of the FlexListBoxCell object that will be placed as a child object of FlexRow with the same name as the corresponding FlexListBox object.

If set to true, the button can be operated.

If false is specified, button operations are prohibited.


FlexListBox.AutoCursorMove property

Set to true if you want the cell cursor to move automatically.

If you specify true, the cell cursor will move in the same way as when you press the right arrow key at the next opportunity.

-When the input content is confirmed by pressing the Enter key.

If the cursor does not move when you press the right arrow key, such as at the end of a line, the cell cursor does not move even if you specify the AutoCursorMove property to true, but the input content is confirmed and the SelectChanged event occurs if there is a change I will.


FlexListBox.DropdownKey property

Set the key to drop down.

If not set, the F4 key will be the drop-down key.

For the values ​​that can be specified for the DropdownKey property, refer to Key specification .


FlexListBox.DropdownStyle property

Specifies the display style of the select list section.

Specify the following constants.

constant | value | Explanation
$STD | 0 | standard. List display at the bottom of the object
$FLOATING | 1 | Enlarge the list to the center of the screen and display it in a pop-up

The display position of the list when $FLOATING is specified is automatically adjusted according to the screen size.

In addition, the font is used by automatically adjusting the size of the currently specified font.


FlexListBox.FlatIconColor property

iOSAndroidWindows

A color constant that specifies the color of the list box icons when the Style property is FlexView.StyleFlat.

Specifying $STD is the same as FlexData.FgColor.

The default value is $STD.


FlexListBox.KeySelect property

Specifies whether to select items by key input.

The default is false.


FlexListBox.ListData property

Specifies the choices displayed in the list box.

The choices are specified as comma-separated strings. It cannot contain line breaks or tabs.

If you want to include commas in your choices, enclose one element in double caution (") or escape it with \.

If you want to include double coating (") in your choices, write double coating (") instead of enclosing one element in double coating (") or escape with \.

Specification example

FlexListBox1.ListData = "Choice1,Choice2,Choice3";
FlexListBox2.ListData = "\"1,000\",\"2,000\",\"3,000\"";
FlexListBox3.ListData = "1\\,Sales,2\\,Purchases,3\\,Discard";

Display example

ListData = "Choice1,Choice2,Choice3"

ListData = "\"1,000\",\"2,000\",\"3,000\""

ListData = "1\\,Sales,2\\,Purchases,3\\,Discard"


FlexListBox.Style property

iOSAndroidWindows

Specifies the display style of the list box. It can be one of the values below:

constant | value | explanation
FlexView.StyleStd | 0 | Displays a normal list box.
FlexView.StyleFlat | 1 | Display a list box in a flat design. The background color will be the same as the specified value of the FlexData.BgColor property. The icon color will be the same as the value specified in the FlexData.FgColor property.

Display example

The default value is FlexView.StyleStd.


FlexListBox.Value property

Specify the initial value of the cell.

See the FlexData.Value property for the behavior of the Value property .


FlexListBox method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexListBox class.

Class overview

Base class methods


FlexListBox event

API version 4

Event

The following events are defined in the FlexListBox class.

API | name | Explanation
4 | Clicked | Occurs when tapped
4 | RClicked | Occurs when long tapped
4 | SelectChanged | Occurs when selecting a choice

Class overview

Base class event


FlexListBox.Clicked event

This event is generated by tapping on the cell corresponding to FlexListBox. It does not occur on the icon that displays the list box.

The Clicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition property and ColumnPosition property, but since the event goes through the event queue, the row and col values ​​of the Clicked event caught by the event handler will be the cell cursor at that point. It may be different from the position you are in. Therefore, in order to manipulate the data at the position where the Clicked event occurred, be sure to specify the cell by the row and col of the event.


FlexListBox.RClicked event

This event is generated by a long tap on the cell corresponding to FlexListBox.

The RClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler has the cell cursor at that point. It may point to a line that is different from the position. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexListBox.SelectChanged event

This event is generated by the list selection operation of the cell corresponding to FlexListBox. The SelectChanged event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexListBoxCell class

Object
 | FlexCell
 |  | FlexListBoxCell

The FlexListBoxCell class is an accessor for manipulating FlexView cells generated by FlexListBox.

You can manipulate the pointed cell by manipulating the properties of FlexListBoxCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexListBoxCell property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexListBoxCell class.

API | name | access | Type | initial value | Explanation
4 | Active | CRW | boolean | $TRUE | List selection is possible
27 | FlatIconColor | CRW | integer | $STD | Listbox icon color
27 | Style | CRW | integer | 0 | List box display style

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


FlexListBoxCell.Active property

Specifies the activity of the list box on the cell.

If set to true, the list box can be operated.

If false is specified, the operation of the list box is prohibited.


FlexListBoxCell.FlatIconColor property

iOSAndroidWindows

A color constant that specifies the color of the list box icons when the Style property is FlexView.StyleFlat.

Specifying $STD is the same as FlexData.FgColor.


FlexListBoxCell.Style property

iOSAndroidWindows

Specifies the display style of the list box. It can be one of the values below:

constant | value | explanation
FlexView.StyleStd | 0 | Displays a normal list box.
FlexView.StyleFlat | 1 | Display a list box in a flat design. The background color will be the same as the specified value of the FlexData.BgColor property. The icon color will be the same as the specified value of the FlexData.FgColor property.

Display example


FlexListBoxCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexListBoxCell class.

Class overview

Base class methods


FlexListBoxCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexListBoxCell class.

Class overview

Base class event


FlexRecord class

Object
 | FlexRecord

FlexRecord is a class that defines how rows are displayed for the FlexView class.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexRecord property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexRecord class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | Border | CRW | boolean | $FALSE | Frame display (not available, reserved for future)
4 | BorderStyle | CRW | integer | 0 | Border type (not available, reserved for future)
4 | Height | CRW | integer | 20 | Row height
4 | Striped Opacity | CRW | integer | 100 | Striped transparency
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexRecord.BgColor property

Specifies the background color of the row.

The color that is actually displayed is the color that has been transparently calculated by the StripedOpacity property.

For odd-numbered rows: White with BgColor transparent to Striped Opacity.

For even rows: BgColor.

Display example

BgColor = $CCFFFF

StripedOpacity = 80


FlexRecord.BorderStyle property

(Not available. Reserved for future use.)


FlexRecord.Height property

Specifies the height of one line.

Display example

Height = 40

Height = 60

If you are using FlexRowSet, you may see multiple rows of data in one row. The height of each data is the height specified in the Height property divided equally by the number of rows of data displayed in that column.


FlexRecord.StripedOpacity property

Specifies the transparency of odd-numbered lines when striping the lines in a ratio of 0 to 100.

If you specify 0, it becomes opaque and has the same color as even rows. If you specify 100, it will be completely transparent and white.

For odd-numbered rows: White with BgColor transparent to Striped Opacity.

For even rows: BgColor.

Display example

BgColor = $CCFFFF

Striped Opacity = 80


FlexRecord.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


FlexRecord method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexRecord class.

Class overview

Base class methods


FlexRecord event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexRecord class.

Class overview

Base class event


FlexRow class

Object
 | FlexRow

The FlexRow class is a class that represents the individual rows displayed in FlexView.

A FlexCell derived object that is subordinate to the FlexRow object allows you to access individual cells in the row that the FlexRow object points to.

The FlexRow object can be obtained as the return value of the FlexView.InsertRow, FlexView.DeleteRow, FlexView.GetRow methods, or as additional information for various events. It cannot be generated directly from a script.

After retrieving a FlexRow object, any operation that involves adding or removing rows can affect the row pointed to by the FlexRow object. The following operations and contents that are affected are explained.

If you delete a row before the row pointed to by FlexRow

FlexRow points to the previous row by the number of deleted rows.

If you delete a row after the row pointed to by FlexRow

FlexRow is unaffected.

If you delete the row pointed to by FlexRow

FlexRow is disabled and no row is pointed to.

If you add a new row before the row pointed to by FlexRow

FlexRow points to the next row by the number of added rows

If you add a new row after the row pointed to by FlexRow

FlexRow is unaffected

When the column structure is changed

FlexRow is disabled and no row is pointed to.

If you delete FlexView

FlexRow is disabled and no row is pointed to.

If the FlexRow object is in the disabled state, the InvalidState property is set to $TRUE and the method call fails.

Usage example Change the background color of Label1 of an existing line depending on the conditions

var row = FlexView1.GetRow();
while(!row.end) {
    if(row.Label1.Value> = 0) {
        row.Label1.BgColor = $WHITE;
    }else{
        row.Label1.BgColor = $RED;
    }
    row.MoveNext();
}

Default properties and ValueType

The default property is Position . The value type specification is invalid.


FlexRow property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexRow class.

API | name | access | Type | Explanation
4 | End | R | boolean | Indicates the end
4 | InvalidState | R | boolean | Indicates an invalid state
4 | Position | R | integer | Line position

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexRow.End property

When the row pointed to by FlexRow exceeds the end, it becomes $TRUE.

It will be $TRUE if the last line is exceeded by the MoveNext method and if the first line is exceeded by the MovePrev method.

Also, if the method that gets the FlexRow object does not find the row to point to, it will be $TRUE.

You can still call the MoveNext and MovePrev methods even if the End property is $TRUE . For example, you can do the following to find the last line:

var row = FlexView1.GetRow();
while(!row.End) {
    row.MoveNext();
}
row.MovePrev();

Note This sample is inefficient as it is written for the purpose of explaining the End property. Calling FlexView.GetRow (-1) is faster to point to the last row .

If the InvalidState property is $TRUE, referencing the End property raises the exception EXT-12.


FlexRow.InvalidState property

FlexRow will be $TRUE if it no longer points to any row.

If the InvalidState property is $TRUE, an exception will occur if you perform an operation that depends on the pointed row, such as moving a row with MoveNext or referencing the position property.

The InvalidState property is set to $TRUE by the following operation.

-When deleting the row pointed to by the FlexRow object.

· FlexView when you delete an object.


FlexRow.Position property

Indicates the line number currently pointing.

The line number is the line number when you refer to the Position property. After getting the FlexRow object, the row numbers may change due to FlexView row operations.

If the InvalidState property is $TRUE, referencing the Position property raises the exception EXT-12.

If MovePrev points before the first line, it will be FlexView.PrevEndPosition (-900).

If MoveNext points to the next in the last row, it will be FlexView.NextEndPosition (-901).


FlexRow method

API version 4

Method

iOS Android Windows

The following methods are defined in the FlexRow class.

API | name | Explanation
4 | GetColumn | Gets the FlexCell at the specified position
4 | GetHeaderColumn | Gets the FlexCell at the specified position
4 | MoveNext | Move to the next line
4 | MovePrev | Move to the previous line

Class overview

Base class methods


FlexRow.GetColumn method

Explanation

Returns a reference to the FlexCell object at the specified location

The GetColumn method can get the data column excluding the header column. Use the GetHeaderColumn method to get the header column .

If the InvalidState property is $TRUE, the exception EXT-12 is raised.

Call format

var col = row.GetColumn( pos )

Return value

If the FlexCell can be obtained successfully, the FlexCell reference is returned.

If it cannot be obtained, it returns null.

argument

integer pos

Specify the column number starting from 0 for the leftmost data excluding the header column.

exception

EXT-12

Invalid accessor

Example of use

var row = FlexView1.GetRow();
var key = null;
var sum = 0;
while(!row.End) {
    var col = row.GetColumn(1);
    col.BgColor = $STD;
    row.MoveNext();
}

Related item


FlexRow.GetHeaderColumn method

Explanation

Returns a reference to the FlexCell object at the specified location

Unlike GetColumn, you can specify the position with the leftmost header column as 0, and you can get both the header column and the data column.

If the InvalidState property is $TRUE, the exception EXT-12 is raised.

Call format

var col = row.GetHeaderColumn( pos )

Return value

If the FlexCell can be obtained successfully, the FlexCell reference is returned.

If it cannot be obtained, it returns null.

argument

integer pos

Specify a column number starting from 0. For the column number, specify 0 for the first header column and 1 for the next header column. The data column is specified by the serial number of the header.

exception

EXT-12

Invalid accessor

Example of use

var row = FlexView1.GetRow();
var key = null;
var sum = 0;
while(!row.End) {
    var col = row.GetHeaderColumn(1);
    col.BgColor = $STD;
    row.MoveNext();
}

Related item


FlexRow.MoveNext method

Explanation

Point to the next line

It is faster than the FlexView.GetRow(n) method when advancing the row to point to.

If the InvalidState property is $TRUE, the exception EXT-12 is raised.

Call format

var ret = row.MoveNext()

Return value

Returns true if moved successfully. Returns false if it cannot be moved.

argument

None

exception

EXT-12

Invalid accessor

Example of use

var row = FlexView1.GetRow();
while(!row.End) {
    if(row.lbDeleteFlag) {
        row = FlexView1.DeleteRow(row);
    }else{
        row.MoveNext();
    }
}

Related item

MovePrev method


FlexRow.MovePrevious method

API version 4

FlexRow.MovePrev method

iOS Android Windows

Explanation

Point to the previous line

It is faster than the FlexView.GetRow(n) method when returning to the row to point to.

If the InvalidState property is $TRUE, the exception EXT-12 is raised.

Call format

var ret = row.MovePrev()

Return value

Returns true if moved successfully. Returns false if it cannot be moved.

argument

None

exception

EXT-12

Invalid accessor

Example of use

var row = FlexView1.GetRow();
var key = null;
var sum = 0;
while(!row.End) {
    if(key! = null && key! = row.keyItem) {
        row.MovePrev();
        row.subTotal = sum;
        row.MoveNext();
        key = row.keyItem.ValueOf();
        sum = 0;
    }
    row.MoveNext();
}
row.MovePrev();
row.subTotal = sum;

Related item

MoveNext method


FlexRow event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexRow class.

Class overview

Base class event


FlexRowSet class

Object
 | FlexItem
 |  | FlexRowSet

FlexRowSet is a class that defines how the columns of the FlexView class are displayed, and displays the derived classes of FlexItems placed below them side by side in the vertical direction.

Screen display example

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexRowSet property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexRowSet class.

API | name | access | Type | Explanation
4 | Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexRowSet.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


FlexRowSet method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexRowSet class.

Class overview

Base class methods


FlexRowSet event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexRowSet class.

Class overview

Base class event


FlexTextBox class

Object
 | FlexItem
 |  | FlexData
 |  |  | FlexTextBox

The FlexTextBox class is a class that defines how cells in FlexView are displayed, and the corresponding cells are displayed like a text box.

Place the FlexTextBox object below the FlexRecord, FlexColumnSet, or FlexRowSet objects.

Screen display example

Editing status

In the editing state, the characters change to black on a white background, the character cursor blinks, and you can perform editing operations by key input or mouse.

The edit state has a new input mode and a re-edit mode. If you switch to the edit state by double-clicking the cell or pressing the F2 key, it will be in re-edit mode, otherwise it will be in new input mode. In re-edit mode, the current value is displayed and you can edit it, and the left and right arrow keys move the character cursor. In new input mode, the value before editing is not displayed, and the left and right arrow keys move the cell. You can switch to re-edit mode even if you press the F2 key during input, but the contents before editing will not be displayed.

The format specification by the Format property is canceled in the editing state and the format corresponding to the data type is input. The character types that can be entered are limited only to the specification of the InputMode property, and there are no restrictions depending on the data type. For example, you can enter "A" or "B" in a Number type FlexTextBox if it is not regulated by Input Mode. However, when the input value is confirmed, conversion is performed according to the data type, and invalid characters are invalidated.

Pressing the Enter key, moving the cell cursor, or moving the focus confirms the edited content and returns to the normal state. In addition, pressing the ESC key or scrolling cancels the editing state and returns to the normal state, and the content being entered is lost.

The entered value can be obtained with the Value property of the FlexCell object, but the Value property changes when the edit state is released. Note that if you reference the Value property in the edited state, you will get the value before entering the edited state. If you need to refer to the value in an event handler that does not release the edit state, such as the Timer event or the Clicked event of the Label class, use the DecideValue method of the Root class . The edit state is forcibly released, and the value being entered is stored in the Value property.

Normal state

Editing operations cannot be performed. The display is similar to a FlexLabel cell, but the cell cursor color specification is ignored and the display color specified for the cell is always maintained. Check the position of the cell cursor by the dotted line displayed around it.

Placement constraints

FlexTextBox objects cannot be placed to the left (before in definition order) of objects in the FlexHeader class and its derived classes.

When positioned as a child of FlexRowSet and FlexColumnSet, it cannot co-exist with objects in the FlexHeader class and its derived classes.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexTextBox property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexTextBox class.

API | name | access | Type | initial value | Explanation
HT (10) | AutoCursorMove | CR | boolean | $FALSE | Automatic movement of cell cursor
4 | Border | CRW | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | BorderStyle | CRW | integer | $SUNKEN | Border type
28 | BorderWidth | CRW | Number | 0 | Border width
4 | Editable | CRW | boolean | $TRUE | Editability
27 | EditBySingleTap | CR | boolean | $FALSE | Whether to enter edit state with a single tap
4 | IMEMode | CR | integer |  | IME control
4 | InputMode | CR | integer |  | Specifying the character types that can be entered
4 | MaxLength | CR | integer |  | Maximum number of characters that can be entered
5 | SIPMode | CR | integer | $STD | Specifying the appearance and operation of SIP (Software Input Panel)
HT (10) | UseTapAndHold | CRW | boolean | $FALSE | Whether to use tap and hold operation
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexTextBox.AutoCursorMove property

Set to true if you want the cell cursor to move automatically.

If set to true, the cell cursor will move in the same way as when the right arrow key is pressed at the next opportunity.

-When the input content is confirmed by pressing the Enter key.

-When the key input of the number of characters specified in the MaxLength property is performed.

If the cursor does not move when you press the right arrow key, such as at the end of a line, the cell cursor does not move even if you specify the AutoCursorMove property to true, but the input content is confirmed and the SelectChanged event occurs if there is a change. I will.


FlexTextBox.Editable property

Set permission / prohibition of editing.

constant | Explanation
$FALSE | Editing prohibited
$TRUE | Edit permission


FlexTextBox.EditBySingleTap property

iOSAndroidWindows

Specifies whether a single tap puts a cell into edit state.

If $TRUE, single-tapping a cell puts it into edit state.

If $FALSE, double-tapping a cell puts it into edit state.

Also, if the EditBySingleTap property is $TRUE, the Clicked event will not occur when single-tapping.

The default value is $FALSE.


FlexTextBox.IMEMode property

If specified, it will switch to the specified mode when the keyboard focus is received. It also reverts to its previous state when it loses keyboard focus.

Restrictions on Biz/Browser HT

In Biz/Browser HT, it is not possible to control the IME conversion mode (half-width kana input, non-converted input, etc.) due to OS restrictions.

Only the display / non-display of SIP (Software Input Panel) can be controlled with the IMEMode property.

However, depending on the IME on Android, SIP (Software Input Panel) may not be displayed / hidden correctly.

In Biz/Browser HT, SIPMode property can be used to control the input mode of SIP (Software Input Panel) .

Show / hide control of SIP (Software Input Panel) when the value is set to IMEMode property is as follows.

If you specify the SIP display value and the SIP non-display value at the same time, the SIP is not displayed.

constant | value | motion
$STD | 0 | Performs the default behavior (SIP display).
$CLOSE | 4096 | Do not show SIP
$OPEN | 8192 | Show SIP

For compatibility with other Biz/Browser products, the following constants can also be specified.

constant | value | motion
$SIP_CLOSE | 0x10000000 | Do not show SIP
$ALPHA | 2 | Show SIP
$KANA | 8
$DALPHA | 32
$DKANA | 128
$DHIRA | 256
$SIP_OPEN | 0x20000000


FlexTextBox.MaxLength property

Specify the maximum number of characters to be input.

You cannot enter more characters from the screen than the number of characters specified by the MaxLength property. However, it is possible to set more strings than MaxLength by script.

If ValueType is Number, it includes the sign and decimal point.


FlexTextBox.SIPMode property

Specify the appearance and operation of the displayed SIP (Software Input Panel).

Use the IMEMode property for SIP (Software Input Panel) display control when the object receives the keyboard focus .

Android version

Use the following constants in combination

Keyboard type

You can specify 0 to 1.

constant | value | Explanation
(unspecified) |  | Default mode
$SIP_TYPE_DATETIME | [TYPE_DATETIME] | Date / time input mode
$SIP_TYPE_DATE | [TYPE_DATE] | Date input mode
$SIP_TYPE_TIME | [TYPE_TIME] | Time input mode
$SIP_TYPE_NUMBER | [TYPE_NUMBER] | Numerical value input mode
$SIP_TYPE_PHONE | [TYPE_PHONE] | Phone number input mode
$SIP_TYPE_NAME | [TYPE_NAME] | Name (person name) input mode
$SIP_TYPE_EMAIL | [TYPE_EMAIL] | Email address input mode
$SIP_TYPE_URL | [TYPE_URL] | URL input mode

Return key type

You can specify 0 to 1.

constant | value | Explanation
(unspecified) |  | "Done" button
$SIP_RETURNKEY_DONE | [RETURNKEY_DONE] | "Done" button
$SIP_RETURNKEY_GO | [RETURNKEY_GO] | "Open" button
$SIP_RETURNKEY_NONE | [RETURNKEY_NONE] | "Line feed" button
$SIP_RETURNKEY_PREVIOUS | [RETURNKEY_PREVIOUS] | "back button
$SIP_RETURNKEY_SEARCH | [RETURNKEY_SEARCH] | "Search" button
$SIP_RETURNKEY_SEND | [RETURNKEY_SEND] | "Send" button


FlexTextBox.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexTextBox method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexTextBox class.

Class overview

Base class methods


FlexTextBox event

API version 4

Event

iOS Android Windows

The following events are defined in the FlexTextBox class.

API | name | Explanation
4 | Clicked | Occurs with a tap
4 | RClicked | Occurs with a long tap
4 | TextChanged | Occurs when entering text

Class overview

Base class event


FlexTextBox.Clicked event

An event that occurs when you tap on the cell that corresponds to the FlexTextBox.
The Clicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexTextBox.RClicked event

This event is generated by a long tap on the cell corresponding to FlexLabel.

The RClicked event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexTextBox.TextChanged event

This event occurs when the Value changes during the cell edit operation corresponding to the FlexTextBox. The TextChanged event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
}

The cell cursor can be referenced by the RowPosition and ColumnPosition properties of FlexView, but since the event goes through the event queue, the FlexRow object attached to the event caught by the event handler will have the cell cursor at that point. It may point to a line that is different from where it is. Therefore, in order to manipulate the data at the position where the event occurred, be sure to specify the row by the row of the event.


FlexTextBoxCell class

Object
 | FlexCell
 |  | FlexTextBoxCell

The FlexTextBoxCell class is an accessor for manipulating FlexView cells generated by FlexTextBox.

You can manipulate the pointed cell by manipulating the properties of FlexTextBoxCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexTextBoxCell property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexTextBoxCell class.

API | name | access | Type | initial value | Explanation
4 | Editable | CRW | boolean | $TRUE | Editability

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


FlexTextBoxCell.Editable property

Set permission / prohibition of editing.

constant | Explanation
$FALSE | Editing prohibited
$TRUE | Edit permission


FlexTextBoxCell method

API version 4

Method

iOS Android Windows

The following methods are defined in the FlexTextBoxCell class.

API | name | Explanation
27 | StartEditMode | Put the cell into edit state.

Class overview

Base class methods


FlexTextBoxCell.StartEditMode method

iOSAndroidWindows

Explanation

Put the cell into edit state.

Call format

cell.StartEditMode( )

Return value

none

argument

none

exception

none

Example of use

var row = FlexView1.GetRow(FlexView1.RowPosition);
var col = row.GetColumn(1);
col.StartEditMode();

Related item


FlexTextBoxCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexTextBoxCell class.

Class overview

Base class event


FlexTreeHeader class

Object |  |  |  |  |
 | FlexItem |  |  |  |
 |  | FlexData
 |  |  | FlexHeader
 |  |  |  | FlexGroupHeader
 |  |  |  |  | FlexTreeHeader

The FlexTreeHeader class is a class that defines how to display the row headers of FlexView. Corresponding header cells are displayed as a key break in the cell value or grouped by the specified number of rows, similar to FlexGroupHeader.

FlexTreeHeader can display groups in a tree format and collapse or unfold the groups by operating the screen.

Place the FlexTreeHeader object under the FlexRecord or FlexColumnSet object.

If the VerticalAlign property is set to $STD, the vertical position will be $CENTER.

The tap operation that raises the Clicked event and collapses the group is valid for the entire FlexTreeHeader.

Screen display example

Placement constraints

FlexTreeHeader objects cannot be placed to the right (after in definition order) of objects in classes derived from FlexHeader, FlexGroupHeader, or anything other than FlexHeader.

When positioned as a child of FlexColumnSet, it cannot live with objects of classes derived from anything other than FlexTreeHeader.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


FlexTreeHeader property

API version 4

Property

iOS Android Windows

The following properties are defined in the FlexTreeHeader class.

API | name | access | Type | initial value | Explanation
4 | BgStyle | CRW | integer | $INDENT | How to display the background
4 | Foldable | CRW | boolean | $TRUE | Whether or not folding operation is possible
4 | HorizontalAlign | CR | integer | $STD | Horizontal alignment
4 | Value | CRW | String Number Date |  | Initial value of cell

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexTreeHeader.BgStyle property

Specifies how to display the background of the tree.

Display example

BgStyle = $INDENT

BgStyle = $NONE

BgStyle = $LINE

BgStyle = $PANEL

BgStyle = $FILL


FlexTreeHeader.Foldable property

Specifies that the tree can be folded by screen operation.

If you specify $TRUE, a fold icon [image] will appear and you can tap to collapse or undo the tree.

If $FALSE is specified, the fold icon will not be displayed and the tree cannot be collapsed by screen operations.

The Foldable property cannot be specified individually for each row.

Display example

Foldable = $TRUE

Foldable = $FALSE


FlexTreeHeader.HorizontalAlign property

Performs horizontal alignment. $STD is centered.

constant | value | Explanation
$STD | 0 | Same as $LEFT
$LEFT | 1 | Left justified
$CENTER | 2 | Centered
$RIGHT | 3 | Right justified


FlexTreeHeader.Value property

Specify the initial value of the cell. Holds the value of the data type specified in ValueType .

See the FlexData.Value property for the behavior of the Value property .


FlexTreeHeader method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexTreeHeader class.

Class overview

Base class methods


FlexTreeHeader event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexTreeHeader class.

Class overview

Base class event


FlexTreeHeaderCell class

Object
 | FlexCell
 |  | FlexTreeHeaderCell

The FlexTreeHeaderCell class is an accessor for manipulating FlexView cells generated by FlexTreeHeader.

You can manipulate the pointed cell by manipulating the properties of FlexTreeHeaderCell.

Default properties and ValueType

The default property is Value . The value type specification is invalid.


FlexTreeHeaderCell property

API version 4

Property

iOS Android Windows

There are no properties defined in the FlexTreeHeaderCell class.

Class overview

Base class properties


FlexTreeHeaderCell method

API version 4

Method

iOS Android Windows

There are no methods defined in the FlexTreeHeaderCell class.

Class overview

Base class methods


FlexTreeHeaderCell event

API version 4

Event

iOS Android Windows

There are no events defined in the FlexTreeHeaderCell class.

Class overview

Base class event


FlexView property

API version 4

Property

The following properties are defined in the FlexView class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | 0 | Background color
4 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
4 | ColumnPosition | CRW | integer | -1 | Cursor sequence
4 | CursorCellOpacity | CRW | integer | 0 | Cursor transparency in cursor cell
4 | CursorColor | CRW | integer | 0 | Cursor color
4 | CursorLineOpacity | CRW | integer | 100 | Cursor transparency of cursor line
HT (10) | CursorMove | CRW | integer | $STD | How to move the cursor
4 | CursorTextColor | CRW | integer | 0 | Cursor cell text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | 10 | font size
4 | HScroll | CR | integer | $AUTO | How to display the horizontal scroll bar
HT (10) | NoPrefix | CRW | boolean | $FALSE | Mode that does not interpret &
4 | RowCount | CR | integer | 0 | Current number of lines
4 | RowPosition | CRW | integer | -1 | Cursor line
27 | RuledLine | CRW | boolean | $TRUE | Display ruled line
27 | RuledLineColor | CRW | integer | $STD | Ruled line color
4 | ShowTitle | CRW | boolean | $TRUE | Title display control
4 | TitleBgColor | CRW | integer | 0 | Title background color
4 | TitleFgColor | CRW | integer | 0 | Title text color
5 | TitleFontFace | CR | integer | $STD | Font decoration attribute of title
5 | TitleFontKind | CR | integer | $STD | Title font type
5 | TitleFontSize | CR | integer | $STD | Title font size
4 | TitleHeight | CRW | integer | 20 | Title height
27 | TitleRuledLine | CRW | boolean | $TRUE | Whether to display borders when the TitleStyle property is FlexView.StyleFlat
27 | TitleRuledLineColor | CRW | integer | $STD | Border color when the TitleStyle property is FlexView.StyleFlat
27 | TitleStyle | CRW | integer | 0 | Style of title
5 | UseTitleFont | CR | boolean | $FALSE | Whether to specify the font for each title
4 | VScroll | CR | integer | $AUTO | How to display the vertical scroll bar

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FlexView.ColumnPosition property

Indicates the currently selected column position. The column positions are 0,1,2 ... in the order of definition (from the left), except for columns made up of FlexHeader and derived classes.

If the cursor moves over FlexTreeHeader, it retains its previous value.

If no column is selected, it will be -1.

If you specify a value other than the existing column, an exception, Ext-14, will occur.


FlexView.CursorCellOpacity property

Specifies the cursor transparency of the cursor cell in a ratio of 0 to 100.

The color that is actually displayed is the color that is transparently calculated by CursorCellOpacity for the background color of CursorColor and FlexRow.

If 0 is specified, it becomes opaque and is displayed as CursorColor regardless of the background color.

If you specify 100, it will be completely transparent and the cursor will not be displayed.

Display example when FlexRow.BgColor = $CCFFFF, CursorColor = $0000FF

CursorCellOpacity = 0

CursorCellOpacity = 20

CursorCellOpacity = 60


FlexView.CursorColor property

Specifies the color of the cursor.

The colors that are actually displayed are the background color of FlexRow and the color that has been transparently calculated by the CursorCellOpacity and CursorLineOpacity properties.


FlexView.CursorLineOpacity property

Specifies the cursor transparency of the cursor line in a ratio of 0 to 100.

The color that is actually displayed is the color that is transparently calculated by CursorLineOpacity for the background color of CursorColor and FlexRow.

If 0 is specified, it becomes opaque and is displayed as CursorColor regardless of the background color.

If you specify 100, it will be completely transparent and the line cursor will not be displayed.

Display example when FlexRow.BgColor = $CCFFFF, CursorColor = $0000FF

CursorLineOpacity = 100

CursorLineOpacity = 80

CursorLineOpacity = 60


FlexView.CursorMove property

Specifies how to move the cell cursor with the left and right arrow keys.

constant

Explanation

$STD

Move to individual cells, excluding headers.

$INPUTITEM

Selectively move to a cell that can be operated by the user. Operable cells are cells generated from FlexButton, FlexTextBox, etc.

$ENTER

The Enter key moves the cell cursor in the same way as the right arrow key. Also, Shift + Enter key moves the cell cursor in the same way as the left arrow key.

$LINEFEED

It automatically moves from the end of the line to the beginning of the next line, or from the beginning of the line to the end of the previous line.

If the next line is a FlexTreeHeader header line, the header line is skipped.

$LINEUP

The cell cursor moves to the right automatically. The next operation moves the cell cursor in the same way as the down arrow key. $ LINEUP cannot be specified at the same time as $ INPUTITEM and $ LINEFEED.

object | motion
FlexTextBox | AutoCursorMove = $TRUE ENTER key confirmation operation AutoCursorMove = $TRUE and MaxLength input confirmation operation
FlexView | Pressing the ENTER key with CursorMove = $ ENTER + $LINEUP

$SKIPHIDDENCOL

Skip columns with Width of 0

If you want to specify the above multiple operations at the same time, add them. For example, if you specify $INPUTITEM + $LINEFEED, both $INPUTITEM operation and $LINEFEED operation are performed. If you specify $INPUTITEM + $ENTER, both $INPUTITEM operation and $ENTER operation are performed.


FlexView.CursorTextColor property

Specifies the text color at the cursor position.

Display example when FlexRow.BgColor = $CCFFFF, CursorColor = $0000FF

CursorTextColor = $WHITE


FlexView.HScroll property

Controls the display of the side-scrolling bar and the availability of side-scrolling.

Android version
scroll bar is not displayed.
This property can only control whether you can scroll beyond the visible range.

constant | value | Explanation
$AUTO | 0 | Automatic display The scroll bar is automatically displayed or hidden according to the size of the displayed content.
$NONE | 1 | None Not always displayed regardless of the size of the displayed content. It is not possible to scroll to the contents beyond the display range.
$STATIC | 2 | Fixed display Always display regardless of the size of the displayed content.


FlexView.RowCount property

Shows the current total number of lines.


FlexView.RowPosition property

Indicates the currently selected row position.

When the cursor moves over the FlexTreeHeader, the row will be different on the display, but the RowPosition will be the same value as the first row pointed to by the FlexTreeHeader.

If no row is selected, it will be -1.

If you specify a line that is folded and not displayed by FlexTreeHeader, the specified line is unfolded and displayed on the screen.

If you specify a value other than the existing row, an exception, Ext-13, will occur.


FlexView.RuledLine property

iOSAndroidWindows

Specifies the presence or absence of ruled line (separating lines between cells).

If $TRUE, display separator lines at cell boundaries.

IF $FALSE, the separator line is not displayed.

The default value is $TRUE.


FlexView.RuledLineColor property

iOSAndroidWindows

Specify the color of ruled line (cell separators) with color constant.


FlexView.ShowTitle property

Specify whether to show or hide the title.

ShowTitle = $TRUE

ShowTitle = $FALSE


FlexView.TitleBgColor property

Specify the background color of the title part.

Display example

TitleBgColor = $STD

TitleBgColor = $FFFFCC


FlexView.TitleFgColor property

Specify the text color of the title part.

Display example

TitleFgColor = $STD

TitleFgColor = $000099


FlexView.TitleFontFace property

Specifies the font decoration attribute of the title. Only valid when UseTitleFont property is $TRUE.

The specified value is the same as the FontFace property.


FlexView.TitleFontKind property

Specifies the font type of the title. Only valid when UseTitleFont property is $TRUE.

The specified value is the same as the FontKind property.


FlexView.TitleFontSize property

Specify the font size of the title. Only valid when UseTitleFont property is $TRUE.

The specified value is the same as the FontSize property.


FlexView.TitleHeight property

Specify the height of the title part. The default value is 20.

Display example

TitleHeight = 40

TitleHeight = 60

If you are using a FlexRowSet or FlexColumnSet, you may see multi-row titles. The height of each title row is the height specified in the TitleHeight property divided equally by the number of title rows displayed in that column.


FlexView.TitleRuledLine property

iOSAndroidWindows

Specifies whether or not to have ruled line (cell separators) for the title when FlexView.StyleFlat is specified for the TitleStyle property.

If $TRUE, display separator lines at cell boundaries.

If $FALSE, the separator line is not displayed.

The default value is $TRUE.


FlexView.TitleRuledLineColor property

iOSAndroidWindows

When the TitleStyle property is set to FlexView.StyleFlat, color constant.


FlexView.TitleStyle property

iOSAndroidWindows

Specifies how the title is displayed. It can be one of the values below:

constant | value | explanation
FlexView.StyleStd | 0 | Normal title display.
FlexView.StyleFlat | 1 | Display the title in a flat design.

Display example

The default value is FlexView.StyleStd.


FlexView.UseTitleFont property

Specifies whether to enable or disable the individual font specification for the title.

When $FALSE, the settings of FontFace, FontKind, and FontSize are valid.

At $TRUE, TitleFontFace, TitleFontKind, and TitleFontSize specifications are valid.

The default value is $FALSE.


FlexView.VScroll property

Controls the display of the vertical scroll bar and the availability of vertical scrolling.

Android version
scroll bar is not displayed.
This property can only control whether you can scroll beyond the visible range.

constant | value | Explanation
$AUTO | 0 | Automatic display The scroll bar is automatically displayed or hidden according to the size of the displayed content.
$NONE | 1 | None Not always displayed regardless of the size of the displayed content. It is not possible to scroll to the contents beyond the display range.
$STATIC | 2 | Fixed display Always display regardless of the size of the displayed content.


FlexView method

API version 4

Method

iOS Android Windows

The following methods are defined in the FlexView class.

API | name | Explanation
4 | ClearRows | Delete all lines
4 | DeleteRow | Deletes the line at the specified position
4 | GetRow | Gets the row at the specified position
4 | GetScrollPos | Gets the scroll position
4 | IndentSort | Sort FlexIndentLabel columns
4 | InsertRow | Adds a line at the specified position
4 | SetScrollPos | Set the scroll position
4 | Sort | Sort rows

Class overview

Base class methods


FlexView.ClearRows method

Explanation

Delete all lines

Call format

FlexView1.ClearRows()

Return value

None

argument

None

exception

None

Example of use

FlexView1.ClearRows();

Related item


FlexView.DeleteRow method

Explanation

Deletes the line at the specified position

Call format

var row = FlexView1.DeleteRow( position )

Return value

Returns a reference to the FlexRow object that points to the next row after the deleted row .

argument

integer position

Specify the position to delete with a line number starting from 0.

exception

EXT-6

FlexRecord not found

EXT-13

Row not found

Example of use

var row = FlexView1.GetRow();
while(!row.End) {
    if(row.item1.Value == "X") {
        row = FlexView1.DeleteRow(row.Position);
    }else{
        row.MoveNext();
    }
}

Related item


FlexView.GetRow method

Explanation

Gets the row at the specified position

Call format

var row = FlexView1.GetRow([ position ])

Return value

Returns a reference to the FlexRow object that points to the specified row .

argument

integer position

Specify the position to be acquired by the line number starting from 0.

If you specify a negative number, the last line is returned.

If omitted, the first line is returned.

exception

EXT-6

FlexRecord not found

EXT-13

Row not found

Example of use

var row = FlexView1.GetRow();
while(!row.End) {
    if(row.item1.Value == "X") {
        row = FlexView1.DeleteRow(row.Position);
    }else{
        row.MoveNext();
    }
}

Related item


FlexView.GetScrollPos method

Explanation

Gets the scroll position of the scroll bar.

Call format

var pos = FlexView1.GetScrollPos()

Return value

Returns the current scroll position (row number of the first row).

argument

None

exception

None

Example of use

FlexView1.GetScrollPos();

Related item


ListView.IndentSort method

API version 4

FlexView.IndentSort method

iOS Android Windows

Explanation

Sort the FlexIndentLabel column so that indents can connect.

The FlexIndentLabel column can express the parent-child relationship by the key property and ParentKey property of FlexIndentLabelCell, and indent the parent and child placed in consecutive rows, but the IndentSort method indents as many rows as possible. Sort the contents of the Key and ParentKey properties by key so that they can be viewed.

col , ad , and prop arguments can now be specified. If col or later is specified, sorting will be performed according to the specified conditions before the indent connection.

Call format

FlexView1.IndentSort([ col [, arr [, prop ]]])

Return value

None

argument

integer col

Specifies the number of columns to sort

String arr

Specify the sort direction.

If "d" is specified, it will be sorted in descending order.

Everything else is sorted in ascending order.

String prop

Specify the property to be used as the sort key as a character string. If omitted, the operation is the same as when "value" is specified.

exception

EXT-6

FlexRecord not found

EXT-14

Column not found

Example of use

FlexView1.IndentSort();

Related item


FlexView.InsertRow method

Explanation

Adds a line at the specified position

Call format

var row = FlexView1.InsertRow([ count [, position ]])

Return value

Returns a reference to the FlexRow object that points to the first row you insert .

argument

integer count

Specify the number of lines to insert.

If omitted, one line will be added.

integer position

Specify the insertion position with a line number starting from 0. -1 or if omitted, it is added at the end.

exception

EXT-1

Illegal argument

EXT-6

FlexRecord not found

EXT-13

Row not found

Example of use

var row = FlexView1.InsertRow(10);
for(var i = 0; i <10; i ++) {
    row.item1.Value = "a";
    row.MoveNext();
}

Related item


FlexView.SetScrollPos method

Explanation

Sets the scroll position of the scroll bar.

Call format

FlexView1.SetScrollPos( scrollpos ).

Return value

None

argument

integer scrollpos

Specify the scroll position (the line number of the first line).

exception

EXT-1

Invalid argument for SetScrollPos

EXT-13

Line not found

Example of use

FlexView1.SetScrollPos(5);

Related item


FlexView.Sort method

Explanation

Sorts the rows by the column at the specified position

Call format

FlexView1.Sort( col [, arr [, prop ]])

Return value

None

argument

integer col

Specifies the number of columns to sort

String arr

Specify the sort direction.

value | Explanation
"a" | Sort in ascending order
"d" | Sort in descending order
"aq" | Sort in ascending order with quicksort
"dq" | Sort in descending order with quicksort

If omitted or other than the above, sort in ascending order.

String prop

Specify the property to be used as the sort key as a character string.

If omitted, the operation is the same as when "value" is specified.

exception

EXT-6

FlexRecord not found

EXT-14

Column not found

EXT-17

Property not found

Example of use

FlexView1.Sort(1, "a", "data");
FlexView1.Sort(1, "aq", "data");

Related item


FlexView event

API version 4

Event

iOSAndroidWindows

The following events are defined in the FlexView class.

API | name | Explanation
4 | CursorMoved | Occurs when the cell cursor position changes
4 | Scrolled | Occurs when moving the vertical scrollbar

Class overview

Base class events


FlexView.CursorMoved event

This event occurs when the cell cursor moves. The CursorMoved event has the following structure:

Event {
    FlexRow row; /* FlexRow object pointing to the moved row */
    Number col; /* Moved column number */
}

The cell cursor can be referenced by the RowPosition property and ColumnPosition property, but since the event goes through the event queue, the FlexRow object or col attached to the event caught by the event handler will have the cell cursor placed at that point. It may point to a position different from the one you are in. Therefore, in order to manipulate the data of the cell in which the event occurred, be sure to identify the cell by the row and col attached to the event.

If you delete all rows or columns, the cell cursor moves to the invalid position. The row attached to the event that occurred at the invalid position is in the invalid state. In addition, FlexView.InvalidPosition (-999) is set for col.


FlexView.Scrolled event

Occurs when moving the vertical scroll bar.

The Scrolled event has the following structure.

Event {
    Number row;
}


FlexView operator

API version 4

operator

The following operators are defined in the FlexView class.

API | operator | Explanation
4 | FlexView << CSVDocument | Load the CSV Document into FlexView
4 | CSVDocument << FlexView | Output FlexView to CSV Document

Class overview


FlexView << CSVDocument operator

This operator loads the CSVDocument object on the right side against the FlexView object on the left side.

The existing data will be deleted and replaced with the data in the CSVDocument object.

If even one column name is defined in CSVDocument, it will be assigned to the corresponding FlexData in FlexView. If there is a mixture of anonymous columns, the anonymous columns will be ignored.

If no column name is defined in CSVDocument, it will be assigned to the corresponding FlexData in FlexView in the order of CSVDocument.

Example of use

/* Download CSV from the server and display it in FlexView */
var csvdoc = new CSVDocument;
csvdoc.Get("test.csv");
FlexView1 << csvdoc;

/* Display CSV constants in FlexView */
FlexView1 << new CSVDocument << csv {
item1,item2,item3
item1,item2,item3
item1,item2,item3
item1,item2,item3
};


CSVDocument << FlexView operator

This operator loads the FlexView object on the right side against the CSVDocument object on the left side.

The CSVDocument column corresponds to the Value property of the FlexData-derived class.

Example of use

/* Save the contents of FlexView as CSV */
var csvdoc = new CSVDocument;
csvdoc << FlexView1;
var fs = new FileSystem;
var fp = fs.open("test.csv", FileSystem.OPEN_WRITE);
csvdoc.save(fp);
fp.close();


GroupBox class

Object
 | NetObject
 |  | DisplayObject
 |  |  | GroupBox

A class that displays a group box.

The position of the displayed title (up / down / left / right) can be set with the TitilePosition property.

If there is no title, the frame will be drawn in the same size as the display range.

Box type and line type display is possible.

Screen display example

BoxStyle = $BOX

BoxStyle = $ROUND

BoxStyle = $HORZLINE

BoxStyle = $VERTLINE

Box type title display

If you specify $BOX or $ROUND for the BoxStyle property, the box type display will be displayed.

Normally, the title is displayed above the border, but in $SUNKEN, $RISED, $SOFTBUMP, $FLATSUNKEN, and $FLATRISED, it is displayed outside the border.

Line type title display

If you specify $HORZLINE or $VERTLINE for the BoxStyle property, the line type display will be displayed.

The title usually overlaps the line, but if the BorderStyle property is $SUNKEN, $RISED, $SOFTBUMP, $FLATSUNKEN, $FLATRISED, it will appear above or below the line (left or right for $VERTLINE). .. The display position at this time can be specified by the TitlePosition property $TOP and $BOTTOM ($LEFTSIDE and $RIGHTSIDE in $VERTLINE).

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Precautions when scaling

Nothing in particular


GroupBox property

API version 4

Property

The following properties are defined in the GroupBox class.

API | name | access | Type | initial value | Explanation
28 | BorderColor | CRW | integer | $STD | Border color
4 | BorderStyle | CRW | integer | $ETCHED | Border type
28 | BorderWidth | CRW | Number | 0 | Border width
4 | BoxStyle | CRW | integer | $BOX | Group box type
4 | FgColor | CRW | integer | $STD | Text color
4 | FontFace | CR | integer | $STD | Font decoration attributes
4 | FontKind | CR | integer | $STD | Font type
4 | FontSize | CR | integer | Ten | font size
4 | Title | CRW | String |  | Title to display
4 | TitleAlign | CRW | integer | $LEFT | Alignment of title string
4 | TitlePosition | CRW | integer | $TOP | Title display position
4 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


GroupBox.BorderStyle property

Specify the border type.

constant | value | Explanation
$SUNKEN | 0 | The whole is displayed in a concave shape
$RISED | 1 | The whole is displayed in a convex shape
$ETCHED | 2 | The line of the frame is displayed in a concave shape
$BUMP | 3 | Displays the frame line in a convex shape
$GRAYFRAME | 4 | Shows a border in two colors of gray
$SOFT | 5 | Display the frame in black and white
$SOFTETCHED | 6 | The border is displayed in a soft concave shape.
$SOFTBUMP | 7 | The border is displayed in a soft convex shape.
$PLANE | 8 | Display with a single black line
$DASH | 9 | Display with a long dotted line
$DOT | 10 | Display with a fine dotted line
$FLATSUNKEN | 11 | The whole is displayed in a low concave shape
$FLATRISED | 12 | Display the whole with a low convex shape

Display example

In $SUNKEN, $RISED, $SOFTBUMP, $FLATSUNKEN, $FLATRISED, the title is displayed outside the border.


GroupBox.BoxStyle property

Specifies the type of group box.

constant | value | Explanation
$BOX | 0 | Box type
$ROUND | 1 | Box type with rounded corners
$HORZLINE | 2 | Horizontal line type
$VERTLINE | 3 | Vertical line type


GroupBox.Title property

The value to be displayed in the title.

The title is always displayed on one line. It cannot be wrapped and displayed on multiple lines.


GroupBox.TitleAlign property

Aligns the title string.

constant | value | Explanation
$LEFT | 1 | Left justified
$CENTER | 2 | Centered
$RIGHT | 3 | Right justified

The display position of the title is specified by the TitlePosition property.


GroupBox.TitlePosition property

Specify the display position of the title.

constant | value | Explanation
$TOP | 1 | Upper side
$LEFTSIDE | 2 | left
$BOTTOM | 3 | Lower
$RIGHTSIDE | 4 | Right side

The title string is aligned with the TitleAlign property.


GroupBox.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.

The characters to be displayed are set by the Title property.


GroupBox method

API version 4

Method

There are no methods defined in the GroupBox class.

Class overview

Base class methods


GroupBox event

API version 4

Event

There are no events defined in the GroupBox class.

Class overview

Base class event


Image class

Object
 | Image

A class that holds images.

Default properties and ValueType

There are no default properties. The value type specification is invalid.


Image property

API version 4

Property

The following properties are defined in the Image class.

API | name | access | Type | Explanation
4 | Height | R | integer | Height of the loaded image
4 | Width | R | integer | Width of loaded image

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


Image.Height property

The height of the loaded image.


Image.Width property

The width of the loaded image.


Image method

API version 4

Method

The following methods are defined in the Image class.

API | name | Explanation
8 | GetInformation | Get various information of the image
4 | Loadimage | Load the image file
4 | RemoveImage | Discard the image loaded by the LoadImage method
5 | Rotate | Rotate image
5 | Save | Save the image in the specified format
21 | Scale | Scale image
27 | Trimming | Crop part of the image

Class overview

Base class methods


Image.GetInformation method

Explanation

Acquires various information of the image.

Call format

img.GetInformation( type )

Return value

None

argument

integer type

Specify the type of information to be acquired from the following values.

constant | value | Explanation
Image.INFO_LUMINANCE | 1 | Average brightness of image

exception

EXT-1

Image: GetInformation argument is invalid

EXT-26

It cannot be executed because the image does not exist

Example of use

/* Get brightness from image and update */
var lum = img1.GetInformation(Image.INFO_LUMINANCE);
print("brightness:" + Str(round(lum, 4));

Related item


Image.LoadImage method

Explanation

Load the image file.

The image file format supports image files such as BMP, GIF, TIFF, JPEG, PNG (including transparent PNG).

If you call it repeatedly, the previous image will be overwritten and the last image will be valid.

Call format

img.LoadImage( URL or reader )

Return value

None

argument

URL or reader

Image file URL or Reader object

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

img.LoadImage("http: //localhost/picture.jpg");

Related item

RemoveImage method


Image.RemoveImage method

Explanation

Discard the image loaded by the LoadImage method.

Call format

img.RemoveImage()

Return value

None

argument

None

exception

None

Example of use

img.RemoveImage();

Related item

LoadImage method


Image.Rotate method

Explanation

Rotate the image.

However, it is invalid for the Image object obtained by the GetImage method of the ImageList class .

Call format

img.Rotate( direction )

Return value

None

argument

integer direction

Specify the rotation amount from the following values.

constant | value | Explanation
Image.deg90 | 0 | Rotate 90 degrees clockwise
Image.deg180 | 1 | Rotate 180 degrees
Image.deg270 | 2 | Rotate 270 degrees clockwise

exception

EXT-1

Image: Rotate argument is invalid

Example of use

Image img;
img.LoadImage("biz.jpg");
img.Rotate(Image.deg180);

Related item


Image.Save method

Explanation

Saves the image in the specified format in the Writer object.
However, it is invalid for the Image object obtained by the GetImage method of the ImageList class .

Call format

img.Save( writer , format [, option1 ])

Return value

None

argument

integer writer

Writer object to save to

Integer format

Specify the image format from the following values.

constant | value | Explanation
Image.FORMAT_JPEG | 1 | JPEG
Image.FORMAT_PNG | 2 | PNG

Any option1

When FORMAT_JPEG is specified, specify an image quality of 100 (highest) to 1 (lowest).

If omitted, 100 (maximum) is specified.

exception

EXT-1

Image: Save argument is invalid

EXT-26

It cannot be executed because the image does not exist

Example of use

var fs = new FileSystem;
var fp = fs.Open("sample.jpg", FileSystem.OPEN_WRITE);
img.Save(fp, Image.FORMAT_JPEG, 80);

Related item


Image.Scale method

iOSAndroidWindows

Explanation

Scale the image.

However, it is invalid for the Image object obtained by the GetImage method of the ImageList class .

Call format

img.Scale( size )

Return value

なし

argument

Number size

Specify the zoom-in and zoom-out ratio with a value greater than 0.

exception

EXT-1

Image: Scale argument is invalid

Example of use

Image img;
img.LoadImage("biz.jpg");
img.Scale(0.5);

Related item


Image.Trimming method

iOSAndroidWindows

Explanation

Crop part of the image. Calling this method changes the contents of the calling Image object.

However, it is invalid for the Image object obtained by the GetImage method of the ImageList class .

Call format

img.Trimming( leftX , topY , width , height )

Return value

なし

argument

integer leftX

X coordinate of the top left corner of the clipping area.

Specify the coordinates with the upper left of the image as (0, 0).

integer topY

Y coordinate of the top left corner of the clipping area.

integer width

Width of the clipping area.

integer height

Height of the clipping area.

exception

EXT-1

Illegal argument Image: Trimming

EXT-26

Image data is object reference

Example of use

Image img;
img.LoadImage("biz.jpg");
img.Trimming(10, 10, 200, 200);

Related item


Image event

API version 4

Event

There are no events defined in the Image class.

Class overview

Base class event


ImageButton class

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | Button
 |  |  |  |  | ImageButton

A class that displays an image button. Images and titles can be displayed on the surface of the button.

Screen display example

ButtonStyle = $STD

ButtonStyle = $SURFACE

ButtonStyle = $ICON

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
SPACE | Press the button

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Relationship between image and character display position

The relationship between the set image and the characters specified in the Title property is as follows by specifying the VertPlacement and HorzPlacement properties.

Horz Placement

VertPlacement

$BEFORETEXT

$CENTERED

$AFTERTEXT

$ABOVETEXT

Image |
 | Text

Image

Text

 | Image
Text |

$CENTERED

Image

Text

Image

Text

Text

Image

$BELOWTEXT

 | Text
Image |

Text

Image

Text |
 | Image

Vertical and horizontal alignment using the VerticalAlign and HorizontalAlign properties is performed while maintaining the above positional relationship.

If the ButtonStyle property is $ICON and both the VertPlacement and HorzPlacement properties are $CENTERED, no text is displayed inside the image and text is displayed below the image. (VertPlacement property is the same display position as $ABOVETEXT)

The initial value of the margin ( Spacing property) around the button is set to 5. If you want to have no margins, set the Spacing property to 0.

Precautions when scaling

◆ The image displayed internally is also subject to scaling.


ImageButton property

API version 4

Property

The following properties are defined in the ImageButton class.

API | name | access | Type | initial value | Explanation
4 | BgColor | CRW | integer | $STD | Background color
4 | ButtonMode | CRW | integer | $PUSH | Button operation mode
4 | ButtonStyle | CRW | integer | $STD | Button appearance
4 | FgColor | CRW | integer | $STD | Text color
4 | HorzPlacement | CRW | integer | $STD | Horizontal display position of images and characters
4 | ImageHeight | CRW | integer | 32 | Height when scaling the image
4 | ImageWidth | CRW | integer | 32 | Width when scaling the image
HT (10) | NoPrefix | CRW | boolean | $FALSE | Mode that does not interpret &
4 | Resize | CRW | integer | $STD | How to enlarge / reduce the image
4 | Spacing | CRW | integer | 5 | Peripheral margin
4 | Toggle | CRW | integer | 0 | Toggle button state
4 | VerticalAlign | CR | integer | $STD | Vertical alignment
4 | VertPlacement | CRW | integer | $STD | Vertical display position of images and characters

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


ImageButton.ButtonMode property

The operation mode of the button.

constant | value | Explanation
$TOGGLE | 1 | Toggle button Press the button to lock it in the pressed state, and press it again to return it to its original state.
$PUSH | 2 | Normal button When you press the button, it will be pushed in, and when you release it, it will return to its original state.

The state of the toggle button can be obtained with the Toggle property.


ImageButton.ButtonStyle property

The appearance of the button.

constant | value | Explanation
$STD | 0 | Normal It is displayed as a normal three-dimensional button.
$SURFACE | 1 | Plane When the mouse cursor is over, the display is three-dimensional, otherwise it is flat.
$ICON | 2 | icon The size of the button will be the same as the image size.


ImageButton.HorzPlacement property

Specifies the horizontal display position of images and text.

constant | value | Explanation
$STD | 0 | Same as $BEFORETEXT
$BEFORETEXT | 1 | Left position from the text
$CENTERED | 2 | Central
$AFTERTEXT | 3 | Right position from the text

For details , refer to the relationship between the display position of images and characters .


ImageButton.ImageHeight property

Specify the height when enlarging / reducing the image.

If the Resize property is $FREE, the display size of the image will be the size specified by the ImageWidth and ImageHeight properties.

If the Resize property is $KEEPRATIO (fixed aspect ratio), the size is automatically determined based on the values ​​specified in the ImageWidth and ImageHeight properties.


ImageButton.ImageWidth property

Specify the width when enlarging / reducing the image.

If the Resize property is $FREE, the display size of the image will be the size specified by the ImageWidth and ImageHeight properties.

If the Resize property is $KEEPRATIO (fixed aspect ratio), the size is automatically determined based on the values ​​specified in the ImageWidth and ImageHeight properties.


ImageButton.Resize property

Specifies how to scale the image.

constant | value | Explanation
$STD | 0 | Original image size (no scaling)
$KEEPRATIO | 1 | Enlarge / reduce to the specified size with a fixed aspect ratio
$FREE | 2 | Enlarge / reduce to the specified size

Enlargement / reduction is performed based on the values ​​specified in the ImageWidth and ImageHeight properties.


ImageButton.Spacing property

The margin between the image displayed on the button and the outer circumference of the button.

The default value is set to 5, and there is a margin between the image and the outer circumference of the button.

Set to 0 if you want to have no margins.


ImageButton.Toggle property

The state of the toggle button. 0 represents the normal state and 1 represents the pushed state.

Only valid if the ButtonMode property is $TOGGLE.


ImageButton.VerticalAlign property

Performs vertical alignment. $STD is centered.

constant | value | Explanation
$STD | 0 | Same as $CENTER
$TOP | 1 | Top alignment
$CENTER | 2 | Centered
$BOTTOM | 3 | Bottom alignment


ImageButton.VertPlacement property

Specifies the vertical display position of the image and text.

constant | value | Explanation
$STD | 0 | Same as $CENTERED
$ABOVETEXT | 1 | Above the text
$CENTERED | 2 | Central
$BELOWTEXT | 3 | Below the text

For details , refer to the relationship between the display position of images and characters .


ImageButton method

API version 4

Method

The following methods are defined in the ImageButton class.

API | name | Explanation
4 | ResetImage | Discard the image set by the SetImage method
4 | ResetPushedImage | Discards the image set by the SetPushedImage method
4 | SetImage | Set the image to be displayed on the button
4 | SetPushedImage | Set the image to be displayed on the button in the pressed state

Class overview

Base class methods


ImageButton.ResetImage method

Explanation

The image set by the SetImage method is discarded.

Call format

ImageButton1.ResetImage()

Return value

None

argument

None

exception

None

Example of use

ImageButton1.ResetImage();

Related item

SetImage method


ImageButton.ResetPushedImage method

Explanation

Discards the image set by the SetPushedImage method.

Call format

ImageButton1.ResetPushedImage()

Return value

None

argument

None

exception

None

Example of use

ImageButton1.ResetPushedImage();

Related item

SetPushedImage method


ImageButton.SetImage method

Explanation

Set the image to be displayed on the button.

Call format

ImageButton1.SetImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

ImageButton1.SetImage(ImageList1.GetImage(0));
ImageButton2.SetImage("img/sample.png");

Related item

ResetImage method

Image , ImageList class


ImageButton.SetPushedImage method

Explanation

Set the image to be displayed on the button in the pressed state.

Call format

ImageButton1.SetPushedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

ImageButton1.SetPushedImage(ImageList1.GetImage(0));
ImageButton2.SetPushedImage("img/sample.png");

Related item

ResetPushedImage method

Image , ImageList class


ImageButton event

API version 4

Event

There are no events defined in the ImageButton class.

Class overview

Base class event


ImageLabel class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | Label
 |  |  |  | ImageLabel

A class that displays image labels. Images and text can be displayed on the surface of the label.

Screen display example

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.

Relationship between image and character display position

The relationship between the set image and the character specified in the Value property is as follows by specifying the VertPlacement and HorzPlacement properties.

Horz Placement

VertPlacement

$BEFORETEXT

$CENTERED

$AFTERTEXT

$ABOVETEXT

Image |
 | Text

Image

Text

 | Image
Text |

$CENTERED

Image

Text

Image

Text

Text

Image

$BELOWTEXT

 | Text
Image |

Text

Image

Text |
 | Image

Vertical and horizontal alignment with the VerticalAlign and HorizontalAlign properties is performed while maintaining the above positional relationship.

Precautions when scaling

◆ The image displayed internally is also subject to scaling.


ImageLabel property

API version 4

Property

The following properties are defined in the ImageLabel class.

API | name | access | Type | initial value | Explanation
4 | BoxStyle | CRW | integer | $ BOX | Label border shape
4 | HorzPlacement | CRW | integer | $STD | Horizontal display position of images and characters
4 | ImageHeight | CRW | integer | 32 | Height when scaling the image
4 | ImageWidth | CRW | integer | 32 | Width when scaling the image
HT (10) | NoPrefix | CRW | boolean | $FALSE | Mode that does not interpret &
4 | Resize | CRW | integer | $STD | How to enlarge / reduce the image
4 | Spacing | CRW | integer | 0 | Peripheral margin
4 | VertPlacement | CRW | integer | $STD | Vertical display position of images and characters

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


ImageLabel.BoxStyle property

Specifies the shape of the label border.

constant | value | Explanation
$BOX | 0 | Normal rectangle
$ROUND | 1 | Rectangle with rounded corners

Only valid if the Border property is $TRUE.

The border type is specified by the BorderStyle property.

Also, if a value greater than or equal to 0 is specified for the CornerRadius property at the same time as $ROUND, the CornerRadius property takes precedence.*1

Change log
*1　The specification has been changed since API version 16.


ImageLabel.HorzPlacement property

Specifies the horizontal display position of images and text.

constant | value | Explanation
$STD | 0 | Same as $BEFORETEXT
$BEFORETEXT | 1 | Left position from the text
$CENTERED | 2 | Central
$AFTERTEXT | 3 | Right position from the text

For details , refer to the relationship between the display position of images and characters .


ImageLabel.ImageHeight property

Specify the width when enlarging / reducing the image.

If the Resize property is $FREE, the display size of the image will be the size specified by the ImageWidth and ImageHeight properties.

If the Resize property is $KEEPRATIO (fixed aspect ratio), the size is automatically determined based on the values ​​specified in the ImageWidth and ImageHeight properties.


ImageLabel.ImageWidth property

Specify the width when enlarging / reducing the image.

If the Resize property is $FREE, the display size of the image will be the size specified by the ImageWidth and ImageHeight properties.

If the Resize property is $KEEPRATIO (fixed aspect ratio), the size is automatically determined based on the values ​​specified in the ImageWidth and ImageHeight properties.


ImageLabel.Resize property

Specifies how to scale the image.

constant | value | Explanation
$STD | 0 | Original image size (no scaling)
$KEEPRATIO | 1 | Enlarge / reduce to the specified size with a fixed aspect ratio
$FREE | 2 | Enlarge / reduce to the specified size

Enlargement / reduction is performed based on the values ​​specified in the ImageWidth and ImageHeight properties.


ImageLabel.Spacing property

The margin between the image displayed on the label and the outer circumference of the label.


ImageLabel.VertPlacement property

Specifies the vertical display position of the image and text.

constant | value | Explanation
$STD | 0 | Same as $CENTER
$ABOVETEXT | 1 | Above the text
$CENTERED | 2 | Central
$BELOWTEXT | 3 | Below the text

For details , refer to the relationship between the display position of images and characters .


ImageLabel method

API version 4

Method

The following methods are defined in the ImageLabel class.

API | name | Explanation
4 | ResetImage | Discard the image set by the SetImage method
4 | SetImage | Set the image to be displayed on the label

Class overview

Base class methods


ImageLabel.ResetImage method

Explanation

The image set by the SetImage method is discarded.

Call format

ImageLabel1.ResetImage()

Return value

None

argument

None

exception

None

Example of use

ImageLabel1.ResetImage();

Related item

SetImage method


ImageLabel.SetImage method

Explanation

Set the image to be displayed on the label.

Call format

ImageLabel1.SetImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

ImageLabel1.SetImage(ImageList1.GetImage(0));
ImageLabel1.SetImage("img/sample.png");

Related item

ResetImage method

Image , ImageList class


ImageLabel event

API version 4

Event

There are no events defined in the ImageLabel class.

Class overview

Base class event


ImageList class

Object
 | Image
 |  | ImageList

A class that defines an image list that holds multiple images.

There is a function to divide one image file into multiple parts with a specified size and manage them as individual images.

Used in classes that display images for multiple icons, such as the FlexHeader class.

Default properties and ValueType

There are no default properties. ValueType specification is invalid


ImageList property

API version 4

Property

The following properties are defined in the ImageList class.

API | name | access | Type | initial value | Explanation
4 | IconCount | R | integer | 0 | Total number of loaded images
4 | IconHeight | CRW | integer | 16 | Height of the image included in the image list
4 | IconWidth | CRW | integer | 16 | Width of images in the image list
4 | LargeImage | CRW | integer | $FALSE | LoadIcon method icon type
4 | MaskColR | CRW | integer | 0 | Value of the red component of transparent color
4 | MaskColG | CRW | integer | 0 | Value of green component of transparent color
4 | MaskColB | CRW | integer | 0 | Value of blue component of transparent color
4 | MaskUse | CRW | boolean | $FALSE | Use of image transparency

The Height and Width properties of the base class Image are always 0 for this class.

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


ImageList.IconCount property

The total number of images loaded.

The number of image files divided by the size of IconWidth and IconHeight properties will be the number after division.


ImageList.IconHeight property

The height of the image included in the image list. You can specify 16 to 1024.

The width of the image is specified by the IconWidth property.

The image file loaded by the LoadImage method is automatically divided to the size specified by this property.


ImageList.IconWidth property

The width of the image contained in the image list. You can specify 16 to 1024.

The height of the image is specified by the IconHeight property.

The image file loaded by the LoadImage method is automatically divided to the size specified by this property.


ImageList.LargeImage property

$TRUE represents a large icon and $FALSE represents a small icon.


ImageList.MaskColR property

The value of the transparent color (red component) used for transparency processing when the MaskUse property is set to $TRUE.

Specify a value from 0 to 255 in combination with the MaskColG and MaskColB properties.


ImageList.MaskColG property

The value of the transparent color (green component) used for transparency processing when the MaskUse property is set to $TRUE.

Specify a value from 0 to 255 in combination with the MaskColR and MaskColB properties.


ImageList.MaskColB property

The value of the transparent color (blue component) used for transparency processing when the MaskUse property is set to $TRUE.

Specify a value from 0 to 255 in combination with the MaskColR and MaskColG properties.


ImageList.MaskUse property

Specify $TRUE for transparent processing of the image.

The part of the color specified by MaskColR , MaskColG , and MaskColB becomes the transparent color.

For example

MaskUse = $TRUE;
MaskColR = 255;
MaskColG = 0;
MaskColB = 0;

Then, the red part of the image becomes a transparent color, and it becomes transparent without being displayed in red.

Use PNG format for images that want to use transparent colors. Due to the characteristics of the image, the JPEG format cannot make the transparent part one color.


ImageList method

API version 4

Method

The following methods are defined in the ImageList class.

API | name | Explanation
4 | ( Constructor ) | Initialize the ImageList object
4 | GetImage | Gets the image with the specified index number
HT (10) | LoadIcon | Loads the icon image associated with the extension
4 | LoadImage | Load the image file
4 | RemoveImage | Discard all loaded images
21 | Scale | Scale the image

Class overview

Base class methods


ImageList constructor

Explanation

Initialize the ImageList object.

Image file formats are JPEG, PNG (including transparent PNG),

It supports image files such as BMP, GIF, TIFF, and EXIF ​​formats.

The image file is automatically divided into the sizes specified for width and height , and each can be obtained as an individual image with the GetImage method.

Areas thatare less than the width and height values ​​are filled in black.

Call format

var img = new ImageList([ URL or reader [, width , height ]] )

Return value

Initialized ImageList object

argument

URL or reader

Image file URL or Reader object

The default is an empty image list, and you need to call the LoadImage method to load the image.

integer width

Image width

The range is 16 to 1024, and the default is 16. The specified value is set in the IconWidth property.

integer height

Image height

The range is 16 to 1024, and the default is 16. The specified value is set in the IconHeight property.

exception

EXT-1

The URL argument is invalid

EXT-4

The width of the image list exceeds 32767 dots

EXT-7

Invalid reference

EXT-11

Read method not found

Example of use

var img = new ImageList("sample.png", 32, 32);
ImageLabel1.SetImage(img.GetImage(0));

Related item

IconWidth , IconHeight property

GetImage , LoadImage


ImageList.GetImage method

Explanation

Gets the image with the specified index number.

Call format

var img = ImageList1.GetImage( no )

Return value

Image object

argument

integer no

Image list index number

Specify an integer starting from 0.

exception

None

Example of use

var img = new ImageList("sample.png", 32, 32);
ImageLabel1.SetImage(img.GetImage(0));

Related item

LoadImage method

Image class


ImageList.LoadIcon method

This method is retained for compatibility. Nothing happens when I operate it.


ImageList.LoadImage method

Explanation

Load the image file.

The image file format supports image files such as BMP, GIF, TIFF, JPEG, PNG (including transparent PNG).

The image file is automatically divided into the sizes specified in the IconWidth and IconHeight properties, and each can be obtained as a separate image with the GetImage method.

Areas that are less than the values ​​of the IconWidth and IconHeight properties are filled in black.

If you call the LoadImage method repeatedly, it will be added after the loaded image list. It will not be overwritten.

Call format

var num = ImageList1.LoadImage( URL or Reader )

Return value

Index number of newly added image

If multiple images are added, the first index number will be returned.

argument

URL or Reader

Specify the URL of the image file or the Reader object .

exception

EXT-1

The URL argument is invalid

EXT-7

Invalid reference

Example of use

ImageList ImageList1 {
    IconWidth = 32;
    IconHeight = 32;
    LoadImage("http://localhost/picture.jpg");
}

Related item

IconWidth , IconHeight property

GetImage , RemoveImage methods


ImageList.RemoveImage method

Explanation

Discard all loaded images.

Call format

ImageList1.RemoveImage()

Return value

None

argument

None

exception

None

Example of use

ImageList1.RemoveImage();

Related item

LoadImage method


ImageList event

API version 4

Event

There are no events defined in the ImageList class.

Class overview

Base class event


MaskEdit class

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | EditObject
 |  |  |  |  | MaskEdit

Mask Edit is a text box for inputting a fixed-length character string whose input format and output format can be customized by specifying the Mask property.

The format of the display by the Mask property is reflected only when not being edited. While editing, the operation is the same as for TextBox.

If the Mask property is not specified, the operability will be the same as the TextBox class.

The MaskEdit class cannot check the relevance of each input field. For example, the relevance of dates. Use the DateEdit class if you need to enter the exact date, and the NumberEdit class if you need to enter the exact number .

When the entered value is confirmed, the following properties will be updated according to the input status.

Value property

If the input value meets the specifications of the Mask property, it will be updated with the input value. If the Mask property specification is not met, it will be updated to the empty string. As a result, the Touch event is fired if the Value property changes from what it was before. Also, the Change event is fired if the UseChange property is set to $TRUE.

EditText property

It will be updated to the character string displayed on the screen.

InvalidText property

If the input value meets the specifications of the Mask property, it will be updated to $FALSE. If the Mask property specification is not met, it will be updated to $TRUE.

Screen display example

Default properties and ValueType

The default property is Value . The value type specification is invalid.


MaskEdit property

HT API version 10

Property

iOS Android Windows

The following properties are defined in the MaskEdit class.

API | name | access | Type | initial value | Explanation
HT (10) | AutoTab | CRW | boolean |  | Focus is automatically moved by inputting all digits
HT (10) | Border | CR | boolean | $TRUE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
HT (10) | EditText | R | integer | $STD | The character string displayed on the screen
HT (10) | HorizontalAlign | CR | integer | $STD | Horizontal alignment
HT (10) | InputMode | CR | integer |  | Specifying the character types that can be entered
HT (10) | InvalidText | R | boolean | $FALSE | Presence or absence of illegal input
HT (10) | Mask | CRW | String |  | Mask string
HT (10) | UndecidedColor | CR | integer |  | Display format at the time of incorrect input
HT (10) | Value | CRW | String |  | Value to display in mask edit

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


MaskEdit.AutoTab property

If you specify $TRUE, the focus is automatically moved to the next tab-ordered object when keyboard input fills the last input field.

Only valid if the Mask property is set.


MaskEdit.EditText property

Gets the character string displayed on the screen as it is, including the literal characters for editing added by the Mask property.

This property is set by the value entered on the screen when it is confirmed.

It is not reflected in the setting of the Value property from the script .


MaskEdit.InputMode property

Specify the character types that can be entered.

See InputMode for the values ​​you can specify .

Specifying the InputMode property has nothing to do with specifying the Mask property.

Only characters that meet both the Mask property and the InputMode property can be entered.

For example, if you specify "CC" indicating the character input field in the Mask property and $ZENKAKU in the InputMode property, only double-byte characters can be input only at the specified position.


MaskEdit.InvalidText property

Indicates whether the entered characters meet the conditions specified by the Mask property. You can check that the input is correct.

If not met, it will be $TRUE, if it is met or nothing is entered, it will be $FALSE.

This property is set by the value entered on the screen when it is confirmed.

It is not reflected in the setting of the Value property from the script .


MaskEdit.Mask property

A mask string that determines the editing behavior of mask edit.

For the mask string, specify a combination of mask characters, control characters, and literal characters for editing. See the table below for details.

Example

"009999-0999-000" Phone number

"000-0000" zip code

Date "September 99,9999"

"Seri\\a\\l No." When using escape

Mask character

letter | Required input | Enterable characters
# |  | Half-width numbers (0-9),'-','+', half-width spaces
0 | ○ | Half-width numbers (0-9)
9 |
A (uppercase) | ○ | Half-width alphabetic characters (A to Z, a to z), half-width numbers (0 to 9)
a (lowercase) |
L (uppercase) ,? | ○ | Half-width alphabetic characters (A to Z, a to z)
l (lowercase) |
C (uppercase), & | ○ | Any character
c (lowercase) |

Control character

letter | Explanation
< | Convert the letters after this symbol to lowercase and enter. (Full-width alphabets are not converted)
> | Convert the letters after this symbol to uppercase and enter. (Full-width alphabets are not converted)
<> | After this symbol, disable case conversion and follow the keystrokes.
\ | Escape character. Treats the next one character as an editing literal character. Example) \ A, \ 0, \ <
; | This is the delimiter when a blank character is specified.

Literal characters for editing

Characters other than the above are literal characters for editing.

The cursor is automatically skipped. It cannot be deleted or changed by screen operation.

Half-width conversion of full-width characters

If you enter full-width characters in the half-width character input field, they are automatically converted to half-width characters.

Double-byte characters to be converted are alphanumeric characters, + code,-code, and space.

Specifying a blank character

You can change the blank character displayed at the unentered position by specifying a semicolon ";" and one single-byte character at the end of the mask character string.

This specification is optional and will result in an underscore "_".

Example

"009999-0999-000; *"

The character used for the blank character can be entered as an input value, but it is not possible to determine whether the character specified for the blank character is set by key input or not entered.


MaskEdit.UndecidedColor property

This is the display format when the entered characters do not meet the conditions specified by the Mask property.

constant | value | Explanation
$STD | 0 | do nothing
$BgColor | 1 | Display background in red
$FgColor | 2 | Characters are displayed in red
$Reverse | 3 | Invert background and text color


MaskEdit.Value property

The value to be displayed in the mask edit.

If the entered value does not meet the specified conditions of the Mask property, it will be an empty string.

It does not include edit literal characters added by the Mask property.

Contains the characters entered in the input field and blank characters that appear in unfilled positions (default is underscore "_").

You can get a string containing edit literal characters with the EditText property.

Scripted value settings are not validated by the Mask property and are not affected by the InputMode property.

Specify a character string that is consistent with the contents specified in the Mask property.

The input value on the screen is not reflected immediately. For details, refer to When the Value property is updated .


MaskEdit method

HT API version 10

Method

iOS Android Windows

There are no methods defined in the MaskEdit class.

Class overview

Base class methods


MaskEdit event

HT API version 10

Event

iOS Android Windows

The following events are defined in the MaskEdit class.

API | name | Explanation
HT (10) | Clicked | Occurs when tapped
HT (10) | Touch | Occurs when the value entered in MaskEdit is confirmed

Class overview

Base class event


MaskEdit.Clicked event

Occurs when tapped.
It occurs only when tapped while the focus is on.


MaskEdit.Touch event

This event occurs when the mask edit value is confirmed by input operation from the screen.

The Touch event occurs when a value change is confirmed by pressing the Enter key or function key, or when it loses focus and is confirmed. It does not occur for each key input character.


Package and class

Extension5 package

It is an extended GUI package added in Biz/Browser Ver5.0.

class

API | name | Explanation
10 | CanvasView | Display the drawing canvas
9 | HtmlView | Display HTML
21 | MediaPlayer | Play the media
21 | MediaRecorder | Record video using the device's camera and microphone


CanvasView class

API version 10

CanvasView class Change History

iOS Android Windows

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | CanvasView

This class displays the drawing canvas.

With the CanvasView class, it is possible to draw a trajectory written by a drag / swipe operation.

It is also possible to get the drawn object as an Image object.

Color handling unique to this class (#RRGGBB format, #AARRGGBB format)

In addition to the standard color constants ($BLACK, $FF0000, etc.), any color can be used in this class.

Color information is represented by a character string in the following format.

"#RRGGBB"

First letter | #
Second and third characters (RR) | Hexadecimal number (00 to FF) that represents the red component
4,5th character (GG) | Hexadecimal number that represents the green component (00 to FF)
6th and 7th characters (BB) | Hexadecimal number that represents the blue component (00 to FF)

(Example) Orange: "#FFA500"

"#AARRGGBB"

First letter | #
Second and third letters (AA) | Hexadecimal number (00 to FF) that represents the alpha value (opacity)
4,5th character (RR) | Hexadecimal number (00 to FF) that represents the red component
6th and 7th character (GG) | Hexadecimal number that represents the green component (00 to FF)
8th and 9th character (BB) | Hexadecimal number that represents the blue component (00 to FF)

Example) Semi-transparent lime green: "#8032CD32"

For the color defined in the color constant, the color constant takes precedence even if the string format is specified.

If you specify $STD, the standard color (black: #000000) is set.

Undo / Redo buffer

The CanvasView class has a buffer that can record drawing operations and cancel or replay them. This is called the Undo / Redo buffer.

The Undo buffer records how to undo an operation, and the Redo buffer records the steps to replay an undone operation.

When you perform some drawing operation (for example, draw a drawing by handwriting), the operation is recorded in the undo buffer.

Calling the Undo method in this state cancels the operation. The canceled operation is registered in the Redo buffer.

If the operation is registered in the redo buffer, you can replay the operation by calling the redo method.

Up to 50 Undo / Redo buffers can be registered. The current status is counted as one in this.

When you record an operation in the Undo buffer, the contents of the Redo buffer are reset.

Pich zoom

CanvasView class enables to zoom in up to 5x with a pinch gesture (If the width or height of the image is less than 5 pixels, maximum of zoom ratio will be less than 5x). *1

While zoomed in, you can move the display position by panning with two fingers.

Use the Zoom property to set and get the zoom factor.

Changing the background image by SetImage or ResetImage mthod resets the zoom factor.

When acquiring an image with Snapshot method, you can select whether to acquire an zoomed image by pinching.

Properties | Methods | Events

Change History
*1　The specification has been changed since API version 25.


CanvasView property

API version 10

Property

iOS Android Windows

The following properties are defined in the CanvasView class.

API | name | access | Type | Explanation
21 | ZoomRatio | CRW | Number | Zoom factor

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


CanvasView.ZoomRatio property

iOSAndroidWindows

Specify the zoom factor.

You can specify a range from 1.0 to 5.0 (if the height or width of the image is less than 5 pixels, the maximum value of the zoom factor will be less than 5.0).

If you specify a value outside the specifiable range, it will fit within the specifiable value.


CanvasView method

API version 10

Method

iOS Android Windows

The following methods are defined in the CanvasView class.

API | name | Explanation
10 | Erase | Erases the drawing contents and the Undo / Redo buffer.
10 | Redo | Replays the operation undone with Undo.
10 | ResetImage | Discards the image set by the SetImage method.
10 | SetImage | Set the image to be displayed in the background.
10 | SetStroke | Specify the color and thickness of the drawn line.
10 | Snapshot | Gets the image drawn in CanvasView.
10 | Undo | Undo the last drawing operation.

Class overview

Base class methods


CanvasView.Erase method

Explanation

Erases the drawing contents and the Undo / Redo buffer.

This calls method, SetImage image and was set in the method SetStroke does not erase the information specified in the method.

Call format

CanvasView1.Erase()

Return value

None

argument

None

exception

None

Example of use

Button1 btnErase {
    X = 10;
    Y = 10;
    Width = 100;
    Height = 30;
    Title = "Erase drawing content";
    Function OnTouch(e){
        ^ .CanvasView1.Erase();
    }
}

Related item


CanvasView.Redo method

Explanation

Replays the last undone operation.

The replayed operation can be undone again with the Undo method, just like any other normal operation .

If the Redo buffer is empty, this method does nothing.

Call format

var succeeded = CanvasView1.Redo()

Return value

boolean

Redo success or failure

Returns true if Redo was successful, false otherwise.

argument

None

exception

None

Example of use

Button1 btnRedo{
    X = 10;
    Y = 10;
    Width = 100;
    Height = 30;
    Title = "Start over";
    Function OnTouch(e){
        ^ .CanvasView1.Redo();
    }
}

Related item

Undo method


CanvasView.ResetImage method

Explanation

The background image set by the SetImage method is discarded.

Call format

CanvasView1.ResetImage()

Return value

None

argument

None

exception

None

Example of use

CanvasView1.ResetImage();

Related item

SetImage method


CanvasView.SetImage method

Explanation

Set the background image.

The set background image is automatically enlarged / reduced according to the drawing area of ​​the CanvasView object.

Call format

CanvasView1.SetImage( img )

Return value

None

argument

Object img

Set the Image object.

exception

EXT-7

Invalid reference

Example of use

var img = new Image();
img.loadImage("backgroundImage.png");
CanvasView1.SetImage(img);

Related item

ResetImage method

Image class


CanvasView.SetStroke method

Explanation

Specify the color and thickness of the drawn line.

This setting is effective for newly drawn lines. Settings for already drawn lines are retained.

Call format

CanvasView1.SetStroke( strokeWidth , colorId ).

Or

CanvasView1.SetStroke( strokeWidth , colorCode ).

Return value

None

argument

Number strokeWidth

Specify the width of the line to be drawn with a value of 0 or more

The unit is pixel.

integer colorId

Specify the line color with a color constant.

If you specify $STD, it is assumed that black (#000000) is specified.

String colorCode

Specify the line color in color code format.

Color code is available in "#AARRGGBB" format and "#RRGGBB" format.

exception

FUNC-4

Invalid argument

Example of use

CanvasView1.SetStroke(3.0, "#80FF0000"); /* Set a thickness of 3px and a semi-transparent red color. */

Related item


CanvasView.Snapshot method

API version 10

CanvasView.Snapshot method Change History

iOS Android Windows

Explanation

Gets the image drawn in CanvasView.

The size of the acquired image is the display size (unit: pixel) on the screen of CanvasView multiplied by the value of the scale argument.

The calculation formula is as follows.

Image.Width (of the saved image) = CanvasView.Width * (total horizontal scaling factor) * scale argument value

Image.Height (of the saved image) = CanvasView.Height * (total vertical scaling factor) * scale argument value

The total scaling ratio is the product of the scaling ratio applied in the "scaling settings" and the scaling ratio of the Form object of its ancestor.

As an example, if the horizontal scale is applied 0.5 times to the CanvasView with Width = 300, Height = 200, the size of the acquired image will be 150 x 200 pixels.

Call format

CanvasView.Snapshot([ scale [, drawBackgroundImage [, applyZoom]]])

Return value

Image object

argument

Number scale

Specify the magnification of the acquired image with respect to the display size with a value greater than 0.

If you need to enlarge or reduce the image, you can obtain a higher definition image by specifying the scale with the scale argument.

In the case of 1.0, it will be acquired at the same size.

The default is 1.0.

boolean drawBackgroundImage

Specify whether to include the background image in the saved image.

When true is specified, the background image set by SetImage method is included. The background color is white (#FFFFFFFF).

If you specify false, the background image is not drawn. The background color is transparent (#00000000).

The default is false.

boolean applyZoom

Specifies whether to output images that are zoomed by pinching. *1

A part of the whole image is clipped and output.

If true is specified, the image displayed zoomed by pinching is output.

If false is specified, the image will be output ignoring the zoomed display by pinching.

The default is false.

exception

FUNC-4

Invalid argument

Example of use

var img = CanvasView1.Snapshot(); /* 1: 1 output with transparent image without background */

Related item

Change History
*1　The specification has been changed since API version 25.


CanvasView.Undo method

Explanation

Undo the last drawing operation.

The canceled operation can be played back by calling the Redo method before performing any drawing operation .

If the undo buffer is empty, this method does nothing.

Call format

var succeeded = CanvasView1.Undo()

Return value

boolean

Undo success or failure

Returns true if it can be undone, false otherwise.

argument

None

exception

None

Example of use

Button1 btnUndo{
    X = 10;
    Y = 10;
    Width = 100;
    Height = 30;
    Title = "Undo";
    Function OnTouch(e){
        ^ .CanvasView1.Undo();
    }
}

Related item

Redo method


CanvasView event

API version 10

Event

iOS Android Windows

There are no events defined in the CanvasView class.

Class overview

Base class events


HtmlView class

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | HtmlView

It is a class that displays HTML on Biz/Browser.

One object can display one web page.

In addition to displaying a normal website, you can use it as a label to display HTML by using the ParseHtml method.

Security restrictions can be set by setting the AllowAction property. This allows you to build secure web applications, unlike traditional web browser-based applications.

Android version

We use WebKit (Android 4.2 to 4.3) and Blink (Android 4.4 or later) which are standard Android web components as HTML execution engine.

There is a limitation in using ExecJavascript method in Android 4.3 or earlier .

PDF files cannot be opened by default due to OS security issues. If you want to open a PDF file on HtmlView, you need to specify the AllowAction property to $ALLOW_SCRIPT.

Displayable HTML specifications depend on the installed Web components. Therefore, the operation results may not match those of other web browsers such as Internet Explorer, Chrome, and Safari.

Therefore, HtmlView cannot guarantee that existing websites behave like other browsers. When displaying existing HTML contents or websites, be sure to check the operation on Biz/Browser.

About linking HtmlView with Web components

In addition, the HtmlView class can be linked with the HtmlView using Javascript.

ExecJavascript method can link from HtmlView to Web page, and MessageFromJavascript event can link from Web page to HtmlView.

Value conversion rule from Javascript to CRS

It is a rule that is applied to the return value of ExecJavascript method or child object of MessageFromJavascript event.

Source (Javascript) | Convert to (CRS)
object | Array (associative array)
array | Array (Regular array: 0 counting)
string | String
number | Number
boolean | boolean
null | null


HtmlView property

API version 9

Property

iOS Android Windows

The following properties are defined in the HtmlView class.

API | name | access | Type | Explanation
9 | AllowAction | CRW | integer | Specify the allowed actions
9 | Border | CR | boolean | Specifies the display of the frame
28 | BorderColor | CRW | integer | Border color
9 | IsBusy | R | boolean | Indicates whether the current state is page loading
9 | Silent | CR | boolean | Specify the suppression of the warning dialog output from HtmlView
9 | Title | R | String | Indicates the title of the currently displayed page
9 | URL | R | String | Indicates the URL of the page currently displayed

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


HtmlView.AllowAction property

Specify the permitted operation.

constant | value | Explanation
$ALLOW_NONE | 0 | Do not allow the following actions
$ALLOW_SCRIPT | 1 | Allow script

The initial value is $ ALLOW_NONE.


HtmlView.IsBusy property

Indicates whether the current state is page loading.

This property is read-only and cannot be updated.


HtmlView.Silent property

Specify the suppression of the warning dialog output from HtmlView.

If you specify $TRUE, "Cancel" is automatically selected for warning dialogs such as authentication warnings and script errors, and the display is suppressed.

If specified to $TRUE, page transition cannot be performed if the user needs to select to continue due to security warnings.

The initial value is $TRUE.


HtmlView.Title property

Indicates the title of the currently displayed page.

This property is read-only and cannot be updated.


HtmlView.URL property

Indicates the URL of the page currently displayed.

This property is read-only and cannot be updated.


HtmlView method

API version 9

Method

iOS Android Windows

The following methods are defined in the HtmlView class.

API | name | Explanation
9 | ClearCache | Releases resources cached by the web browser
9 | ExecJavascript | Execute the specified Javascript on the web browser
9 | GoBack | Returns to the previous page from the currently displayed page
9 | GoForward | Moves from the currently displayed page to the next page
9 | GoUrl | Specify the URL of the web page to display
9 | Refresh | Update the currently displayed page
9 | ParseHtml | Specifies the HTML source to display
9 | ScrollBy | Scrolls the displayed page relative to the current position
9 | Stop | Stop loading the currently loaded HTML source and resources such as images.
9 | Zoom | Scales the display

Class overview

Base class methods


HtmlView.ClearCache method

Explanation

Releases the resources that HtmlView caches.

Cookies and history will not be deleted.

Call format

HtmlView1.ClearCache()

Return value

None

argument

None

exception

None

Example of use

^.HtmlView1.ClearCache();

Related item


HtmlView.ExecJavascript method

Explanation

Executes the specified Javascript on the web browser.

Android version

Only available on Android 4.4 and above. CRS exception occurs in the OS before it.

Call format

HtmlView1.ExecJavascript ( js )

Return value

Object

Javascript execution result

The value converted according to the value conversion rule from Javascript to CRS is returned.

argument

String js

Specify the Javascript source to execute.

exception

EXT-27

Initialization is not completed

EXT-32

Javascript call failed

Example of use

^.HtmlView1.ExecJavascript("document.body.style.backgroundColor='#ccffcc';");

Related item


HtmlView.GoBack method

Explanation

Returns to the previous page from the currently displayed page.

If you can't go back, do nothing.

If you go to the next page by GoBack method, you can go to the next page by GoForward method.

Call format

HtmlView1.GoBack()

Return value

None

argument

None

exception

EXT-27

Initialization is not completed

Example of use

^.HtmlView1.GoBack();

Related item

GoUrl method

GoForward method


HtmlView.GoForward method

Explanation

Moves forward one page from the currently displayed page.

If you cannot proceed, do nothing.

It can be used when the page transitions with the GoBack method.

In the page transition from the GoUrl method or hyperlink, the page transition is not possible with the GoForward method.

Call format

HtmlView1.GoBack()

Return value

None

argument

None

exception

EXT-27

Initialization is not completed

Example of use

^.HtmlView1.GoForward();

Related item

GoUrl method

GoBack method


HtmlView.GoUrl method

Explanation

Specify the URL of the Web page to display.

This method allows you to switch the page displayed from your CRS program.

In addition, page transition is also possible from the displayed hyperlink of HTML.

Call format

HtmlView1.GoUrl( url )

Return value

None

argument

String url

Specify the URL (URI) string of the page to open.

You can open http, ftp, https, file (local path), etc.

exception

CRS-125

Function'GoURL 'terminated abnormally

Example of use

Button b {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.HtmlView1.GoUrl("http://google.co.jp/");
    }
}

Related item


HtmlView.Refresh method

Explanation

Update the currently displayed page.

Call format

HtmlView1.Refresh()

Return value

None

argument

None

exception

EXT-27

Initialization is not completed

Example of use

^.HtmlView1.Refresh();

Related item


HtmlView.ParseHtml method

Explanation

Specifies the HTML source to display.

Call format

HtmlView1.ParseHtml( html )

Return value

None

argument

String html

Specifies the HTML source to display.

exception

CRS-125

Function'ParseHtml 'failed

Example of use

^.HtmlView1.ParseHtml(
    "<b><i>test string</i></b>"
);
^ .HtmlView1.ParseHtml(
    "<html><head><title>title</title></head><body><p>first line</p><p>second line</p><p>third line</p></body></html>"
);

Related item


HtmlView.ScrollBy method

Explanation

Scrolls the displayed page relative to the current position.
The scrolling unit differs depending on the platform.

Call format

HtmlView1.ScrollBy( dx , dy )

Return value

None

argument

Number dx

Specifies the amount of movement to scroll horizontally.
Positive values ​​are to the right and negative values ​​are to the left.

Number dy

Specifies the amount of movement to scroll vertically.
Positive values ​​are downwards and negative values ​​are upwards.

exception

EXT-27

Initialization is not completed

Example of use

^.HtmlView1.ScrollBy(0, 100); / * Scroll down * /

Related item


HtmlView.Stop method

Explanation

Stops loading the currently loaded HTML source and resources such as images.

Call format

HtmlView1.Stop()

Return value

None

argument

None

exception

EXT-27

Initialization is not completed

Example of use

^.HtmlView1.Stop();

Related item


HtmlView.Zoom method

Explanation

Enlarges or reduces the display.

Android Version
The range of valid scaling factors varies depends on the meta information of the web page being displayed.

Call format

HtmlView1.Zoom([ ratio ])

Return value

None

argument

Number ratio

Specify the scaling rate.
If omitted, it is assumed to be 1.0.

exception

EXT-27

Initialization is not completed

Example of use

^.HtmlView1.Zoom(1.5); / * Magnification 150% * /

Related item


HtmlView event

API version 9

Event

iOS Android Windows

The following events are defined in the HtmlView class.

API | name | Explanation
9 | CloseWindow | Occurs when'window.close() 'is called in the browser
9 | DocumentComplete | Occurs when page loading is complete
9 | MessageFromJavascript | It occurs when an event issued on the Javascript side is received
9 | NavigateError | It occurs when moving to the specified URL fails

Class overview

Base class events


HtmlView.CloseWindow event

Occurs when 'window.close()' is called in the browser.

This event does not close the HtmlView and the window displaying the HtmlView.

This event only occurs when Javascript is enabled in the AllowAction property.


HtmlView.DocumentComplete event

Occurs when page loading is complete.


HtmlView.MessageFromJavascript event

It occurs when the event issued on the Javascript side is received.

This event only occurs when Javascript is enabled in the AllowAction property.

To issue an event, write the following in Javascript.

bizsd.postMessage(obj); // obj: any object

The object specified in the variable "obj" is internally converted to JSON and then converted according to the value conversion rule from Javascript to CRS .

The following child objects are added to the Event object.

Type | name | Explanation
Object | param | Value specified in the argument of postMessage function on Javascript side The value converted according to the value conversion rule from Javascript to CRS is set.


HtmlView.NavigateError event

It occurs when moving to the specified URL fails.

The following child objects are added to the Event object.

Type | name | Explanation
String | url | URL that failed to move
String | description | Reason for failure If the reason for failure cannot be acquired, an empty string will be stored.


MediaPlayer class

iOSAndroidWindows

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | MediaPlayer

Class for playing video files on Biz/Browser.

Play the video on the specified area, maintaining the aspect ratio of the video.

If there is rotation information in the video, such as when recording with the device in portrait orientation, the video orientation will be rotated according to the rotation information.

Supported video formats, audio formats, and video container formats differ by device and OS version.


MediaPlayer property

API version 21

Property

iOSAndroidWindows

The following properties are defined in the MediaPlayer class.

API | name | access | Type | Explanation
21 | IsLooping | CRW | boolean | Whether to perform loop playback
21 | IsPlaying | R | boolean | Whether it is playing or not
21 | IsScreenOnWhilePlaying | CRW | boolean | Whether to prevent the screen from disappearing automatically during playback

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


MediaPlayer.IsLooping property

iOSAndroidWindows

Specifies whether to perform loop playback.

If $TRUE is specified, playback will be looped, and playback will automatically resume from the beginning of the media after it reaches the end.

The value you set will take effect when you call the LoadFromURL or LoadFromFile methods.

The initial value is $FALSE.


MediaPlayer.IsPlaying property

iOSAndroidWindows

If the MediaPlayer is playing, it will be $TRUE, otherwise it will be $FALSE.

This property is read-only and cannot be updated.


MediaPlayer.IsScreenOnWhilePlaying property

iOSAndroidWindows

Specifies whether or not to prevent the screen from turning off automatically during playback.

If $TRUE is specified, the screen will not automatically turn off while the media is playing.

However, it is not possible to prevent the screen from being turned off by pressing the power button or other user operation.

Also, if the screen turns off, playback will stop at that point.

The value you set will take effect when you call the LoadFromURL or LoadFromFile methods.

The initial value is $FALSE.


MediaPlayer method

API version 21

Method

iOSAndroidWindows

The following methods are defined in the MediaPlayer class.

API | name | Explanation
21 | GetCurrentPos | Get the current playback position
21 | GetDuration | Get the playback time of the media
21 | LoadFromFile | Specify the media to play by file path
21 | LoadFromURL | Specify the media to play by URL
21 | Pause | Pause media playback
21 | Seek | Specifies the playback position of the media
21 | Start | Start/resume media playback
21 | Stop | Stop media playback

Class overview

Base class methods


MediaPlayer.GetCurrentPos method

iOSAndroidWindows

Explanation

Get the current playback position

Call format

var current = MediaPlayer1.GetCurrentPos()

Return value

Current playback position (in seconds)

argument

None

exception

None

Example of use

SetTimer(1.0);
Function OnTimer(e) {
    var pos = MediaPlayer1.GetCurrentPos();
    Label1.Value = "Current playback position:" + str(pos) + " seconds";
}

Related item


MediaPlayer.GetDuration method

iOSAndroidWindows

Explanation

Get the playback time of the media.

Call format

var time = MediaPlayer1.GetDuration()

Return value

Media play time (in seconds)

argument

None

exception

None

Example of use

Button btnDuration {
    X = 8;
    Y = 8;
    Width = 200;
    Height = 200;
    Function OnTouch(e) {
        var time = ^.MediaPlayer1.GetDuration();
        ^.Label1.Value = "再生時間:" + str(time) + " 秒";
    }
}

Related item


MediaPlayer.LoadFromFile method

iOSAndroidWindows

Explanation

Specify the media to play by file path.

Call format

MediaPlayer1.LoadFromFile( fs, path )

Return value

None

argument

FileSystem fs

The FileSystem object to reference

String path

File path of the media to play

Specifies a relative path based on the root folder of the file system specified by fs.

exception

EXT-33

Failed to load media

Example of use

MediaPlayer MediaPlayer1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStart {
    X = 8;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaPlayer1.LoadFromFile(fs, "sample.mp4");
        ^.MediaPlayer1.Start();
    }
}

Related item

LoadFromURL method


MediaPlayer.LoadFromURL method

iOSAndroidWindows

Explanation

Specify the media to play by URL.

Call format

MediaPlayer1.LoadFromURL( url )

Return value

None

argument

String url

Specifies the URL (URI) string of the media to be played.

You can open http, https, file (local path), etc.

exception

EXT-33

Failed to load media

Example of use

MediaPlayer MediaPlayer1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStart {
    X = 8;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaPlayer1.LoadFromURL("http://localhost/sample.mp4");
        ^.MediaPlayer1.Start();
    }
}

Related item

LoadFromFile method


MediaPlayer.Pause method

iOSAndroidWindows

Explanation

Pause media playback.

To resume playback, call the Start method.

Call format

MediaPlayer1.Pause()

Return value

None

argument

None

exception

EXT-34

Media is not loaded

EXT-35

Media playback control failed

Example of use

MediaPlayer MediaPlayer1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnPause {
    X = 8;
    Y = 250;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaPlayer1.Pause();
    }
}

Related item

Start method


MediaPlayer.Seek method

iOSAndroidWindows

Explanation

Specifies the playback position of the media.

The playback position can be absolute or relative to the current playback position.

Call format

MediaPlayer1.Seek( pos [, isRelative] )

Return value

None

argument

Number pos

Specifies the playback position in seconds.

If isRelative is $TRUE, the position is relative to the current playback position, and if pos is negative, the playback position will be moved backward.

boolean isRelative

Specifies whether the playback position specified by pos is relative or not.

The default value is $FALSE.

exception

EXT-34

Media is not loaded

EXT-35

Media playback control failed

Example of use

Button b1 {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        /* 先頭から5秒の位置に移動する */
        ^.MediaPlayer1.Seek(5.0);
    }
}
Button b2 {
    X = 8;
    Y = 90;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        /* 現在の再生位置から5秒後の位置に移動する */
        ^.MediaPlayer1.Seek(5.0, $TRUE);
    }
}
Button b3 {
    X = 110;
    Y = 90;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        /* 現在の再生位置から5秒前の位置に移動する */
        ^.MediaPlayer1.Seek(-5.0, $TRUE);
    }
}

Related item

GetDuration method

GetCurrentPos method


MediaPlayer.Start method

iOSAndroidWindows

Explanation

Start media playback.

Also, resumes playback from the state paused by the Pause method.

Call format

MediaPlayer1.Start()

Return value

None

argument

None

exception

EXT-34

Media is not loaded

EXT-35

Media playback control failed

Example of use

MediaPlayer MediaPlayer1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStart {
    X = 8;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaPlayer1.LoadFromFile(fs, "sample.mp4");
        ^.MediaPlayer1.Start();
    }
}

Related item

Stop method

Pause method


MediaPlayer.Stop method

iOSAndroidWindows

Explanation

Stops media playback.

If you start playback using the Start method again after stopping, playback will start from the beginning of the media.

Call format

MediaPlayer1.Stop()

Return value

None

argument

None

exception

EXT-34

Media is not loaded

EXT-35

Media playback control failed

Example of use

MediaPlayer MediaPlayer1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStop {
    X = 100;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaPlayer1.Stop();
    }
}

Related item

Start method


MediaPlayer event

API version 21

Event

iOSAndroidWindows

There are no events defined in the MediaPlayer class.

Class overview

Base class events


MediaRecorder class

iOSAndroidWindows

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | MediaRecorder

This class is for recording video on Biz/Browser using the device's camera and microphone.

Displays the preview video on the specified area while maintaining the aspect ratio of the video.

Settings related to recording can be set as profiles. By setting a profile, you can set the appropriate image quality and other settings according to the image size.

The video container format also depends on the profile.


MediaRecorder property

API version 21

Property

iOSAndroidWindows

The following properties are defined in the MediaRecorder class.

API | name | access | Type | Explanation
21 | IsRecording | R | boolean | Whether it is recording or not
21 | IsScreenOnWhileRecording | CRW | boolean | Whether or not to prevent the screen from turning off automatically during recording

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


MediaRecorder.IsRecording property

iOSAndroidWindows

If MediaRecorder is recording, it will be $TRUE, otherwise it will be $FALSE.

This property is read-only and cannot be updated.


MediaRecorder.IsScreenOnWhileRecording property

iOSAndroidWindows

Specifies whether to prevent the screen from turning off automatically during recording.

If $TRUE is specified, the screen will not be turned off automatically while recording media.

However, it will not prevent the screen from being turned off by user operation such as pressing the power button.

Also, when the screen turns off, the recording stops at that point.

The value you set will take effect when the Start method is called.

The default value is $FALSE.


MediaRecorder method

API version 21

Method

iOSAndroidWindows

The following methods are defined in the MediaRecorder class.

API | name | Explanation
21 | GetProfile | Get the current profile
21 | GetVideoBitrate | Get the set video bit rate.
27 | GetVideoCodec | Get the video codec.
21 | Pause | Pause recording
21 | Resume | Resume recording
21 | SetCameraSource | Specify the camera to be used
21 | SetOutputPath | Specify the path of the output file
21 | SetProfile | Set the profile
21 | SetVideoBitrate | Set the video bit rate
27 | SetVideoCodec | Set the video codec.
21 | Start | Start recording
21 | Stop | Stop recording

Class overview

Base class methods


MediaRecorder.GetProfile method

iOSAndroidWindows

Explanation

Gets the profile set in the SetProfile method.

Call format

var profile = MediaRecorder1.GetProfile()

Return value

Returns the profile that has been set.

The following values will be returned. If not set, 0 is returned.

constant | Value | Explanation
MediaPlayer.ProfileCameraHigh | 1 | Record in the maximum size supported by the camera.
MediaPlayer.ProfileCameraLow | 2 | Record in the smallest size supported by the camera.
MediaPlayer.ProfileCameraQVGA | 3 | Record in 320x240.
MediaPlayer.ProfileCameraCIF | 4 | Record in 352x288.
MediaPlayer.ProfileCamera480P | 5 | Record in 720x480, 704x480, or 640x480.
MediaPlayer.ProfileCamera720P | 6 | Record in 1280x720.
MediaPlayer.ProfileCamera1080P | 7 | Record in 1920x1080 or 1920x1088.

argument

None

exception

None

Example of use

Button b {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var profile = ^.MediaRecorder1.GetProfile();
        print("profile:", profile, "\n");
    }
}

Related item

SetProfile method


MediaRecorder.GetVideoBitrate method

iOSAndroidWindows

Explanation

Gets the video bitrate specified in the SetVideoBitrate method.

Call format

var bitrate = MediaRecorder1.GetVideoBitrate()

Return value

Video bit rate (in bps)

If not set, 0 is returned.

argument

None

exception

None

Example of use

Button b {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var bitrate = ^.MediaRecorder1.GetVideoBitrate();
        print("video bitrate:", bitrate, "\n");
    }
}

Related item

SetVideoBitrate method


MediaRecorder.GetVideoCodec method

iOSAndroidWindows

Explanation

Get the configured video codec.

Call format

var codec = MediaRecorder1.GetVideoCodec()

Return value

Video codec

The following values are returned:

constant | value | explanation
MediaRecorder.VideoCodecDefault | 0 | OS default codec
MediaRecorder.VideoCodecH264 | 1 | H.264
MediaRecorder.VideoCodecHEVC | 2 | HEVC(H.265)

argument

None

exception

None

Example of use

Button b {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var codec = ^.MediaRecorder1.GetVideoCodec();
        print("video codec:", codec, "\n");
    }
}

Related item

SetVideoCodec method


MediaRecorder.Pause method

iOSAndroidWindows

Explanation

Pause recording.

Resume recording is done by the Resume method. After resuming, the output will be continued to the same file.

Android version
Cannot be used with Android 6 or lower OS.

Call format

MediaRecorder1.Pause()

Return value

None

argument

None

exception

EXT-37

Recording control failed

EXT-38

Recording has not started

Example of use

Button btnPause {
    X = 8;
    Y = 260;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaRecorder1.Pause();
    }
}
Button btnResume {
    X = 120;
    Y = 260;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaRecorder1.Resume();
    }
}

Related item

Resume method


MediaRecorder.Resume method

iOSAndroidWindows

Explanation

Resume the recording that was paused by the Pause method.

After resuming recording, the output will continue in the same file.

Android version
Cannot be used with Android 6 or lower OS.

Call format

MediaRecorder1.Resume()

Return value

None

argument

None

exception

EXT-37

Recording control failed

EXT-38

Recording has not started

Example of use

Button btnPause {
    X = 8;
    Y = 260;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaRecorder1.Pause();
    }
}
Button btnResume {
    X = 120;
    Y = 260;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaRecorder1.Resume();
    }
}

Related item

Pause method


MediaRecorder.SetCameraSource method

iOSAndroidWindows

Explanation

Set the camera to be used for recording.

Call format

MediaRecorder1.SetCameraSource( source )

Return value

None

argument

integer source

Camera to be used for recording

Specify the following values:

constant | Value | Explanation
Runtime.SourceTypeRearCamera | 2 | Use the rear camera (on the back of the terminal).
Runtime.SourceTypeFrontCamera | 3 | Use the front camera (LCD side).

The default value is Runtime.SourceTypeRearCamera.

exception

EXT-39

Already recording

Example of use

Button b {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaRecorder1.LoadFromFile(fs, "sample.mp4");
        ^.MediaRecorder1.SetProfile(MediaRecorder.ProfileCamera480P);
        ^.MediaRecorder1.SetCameraSource(Runtime.SourceTypeRearCamera);
        ^.MediaRecorder1.Start();
    }
}

Related item


MediaRecorder.SetOutputPath method

iOSAndroidWindows

Explanation

Specify the path of the file to output the recording results.

Call format

MediaRecorder1.SetOutputPath( fs , path )

Return value

None

argument

FileSystem fs

The FileSystem object to reference

String path

File path of the output file

Specifies a relative path based on the root folder of the file system specified by fs.

exception

None

Example of use

MediaRecorder MediaRecorder1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStart {
    X = 8;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaRecorder1.SetOutputPath(fs, "sample.mp4");
        ^.MediaRecorder1.SetProfile(MediaRecorder.ProfileCamera480P);
        ^.MediaRecorder1.Start();
    }
}

Related item


MediaRecorder.SetProfile method

iOSAndroidWindows

Explanation

Specify the recording settings as a profile.

By specifying a profile, the system will automatically configure recording settings suitable for the device's camera.

Call format

MediaRecorder1.SetProfile( profile )

Return value

None

argument

integer profile

Profiles for recording settings

Specify the following values:

constant | Value | Explanation
MediaPlayer.ProfileCameraHigh | 1 | Record in the maximum size supported by the camera.
MediaPlayer.ProfileCameraLow | 2 | Record in the smallest size supported by the camera.
MediaPlayer.ProfileCameraQVGA | 3 | Record in 320x240.
MediaPlayer.ProfileCameraCIF | 4 | Record in 352x288.
MediaPlayer.ProfileCamera480P | 5 | Record in 720x480, 704x480, or 640x480.
MediaPlayer.ProfileCamera720P | 6 | Record in 1280x720.
MediaPlayer.ProfileCamera1080P | 7 | Record in 1920x1080 or 1920x1088.

If you do not specify a profile, it will be set to the profile with the largest size supported by the device, which is MediaPlayer.ProfileCamera480P or smaller.

If a profile that is not supported by the camera is set, the Start method will raise an EXT-36 exception.

exception

EXT-39

Already recording

Example of use

MediaRecorder MediaRecorder1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStart {
    X = 8;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaRecorder1.SetOutputPath(fs, "sample.mp4");
        ^.MediaRecorder1.SetProfile(MediaRecorder.ProfileCamera480P);
        ^.MediaRecorder1.Start();
    }
}

Related item

Start, GetProfile method


MediaRecorder.SetVideoBitrate method

iOSAndroidWindows

Explanation

Specifies the video bit rate of the video in bps (bits per second).

When set to 0, the bit rate will be automatically set according to the recording settings specified in the SetProfile method.

Android version
In Android 12 and later OS, setting a lower bit rate value may not be effective.

Call format

MediaRecorder1.SetVideoBitrate( bitrate )

Return value

None

argument

integer bps

Video bit rate (in bps)

The default is 0 (set automatically).

exception

EXT-39

Already recording

Example of use

Button b {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaRecorder1.SetOutputPath(fs, "sample.mp4");
        ^.MediaRecorder1.SetProfile(MediaRecorder.ProfileCamera480P);
        ^.MediaRecorder1.SetVideoBitrate(10000000);
        ^.MediaRecorder1.Start();
    }
}

Related item

SetProfile, GetVideoBitrate method


MediaRecorder.SetVideoCodec method

iOSAndroidWindows

Explanation

Set the video codec.

Call format

MediaRecorder1.SetVideoCodec( codec )

Return value

None

argument

integer codec

Specify the video codec from one of the following:

constant | value | explanation
MediaRecorder.VideoCodecDefault | 0 | Use the OS default codec. If an undefined value is specified, the behavior is the same as specifying MediaRecorder.VideoCodecDefault.
MediaRecorder.VideoCodecH264 | 1 | It uses H.264 as video codec.
MediaRecorder.VideoCodecHEVC | 2 | Uses HEVC (H.265) as video codec.

The default value is MediaRecorder.VideoCodecDefault.

exception

EXT-39

Already recording

Example of use

Button b {
    X = 8;
    Y = 8;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaRecorder1.LoadFromFile(fs, "sample.mp4");
        ^.MediaRecorder1.SetProfile(MediaRecorder.ProfileCamera480P);
        ^.MediaRecorder1.SetCameraSource(Runtime.SourceTypeRearCamera);
        ^.MediaRecorder1.SetVideoCodec(MediaRecorder.VideoCodecH264);
        ^.MediaRecorder1.Start();
    }
}

Related item

GetVideoCodec method


MediaRecorder.Start method

iOSAndroidWindows

Explanation

Start recording.

Call format

MediaRecorder1.Start()

Return value

None

argument

None

exception

EXT-36

Failed to prepare for recording

EXT-37

Recording control failed

EXT-39

Already recording

Example of use

MediaRecorder MediaRecorder1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStart {
    X = 8;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        var fs = new FileSystem;
        ^.MediaRecorder1.SetOutputPath(fs, "sample.mp4");
        ^.MediaRecorder1.SetProfile(MediaRecorder.ProfileCamera480P);
        ^.MediaRecorder1.Start();
    }
}

Related item

Stop, Pause method


MediaRecorder.Stop method

iOSAndroidWindows

Explanation

Stop recording.

Call format

MediaRecorder1.Stop()

Return value

None

argument

None

exception

EXT-37

Recording control failed

EXT-38

Recording has not started

Example of use

MediaRecorder MediaRecorder1 {
    X = 8;
    Y = 8;
    Width = 150;
    Height = 150;
}
Button btnStop {
    X = 100;
    Y = 180;
    Width = 95;
    Height = 70;
    Function OnTouch(e) {
        ^.MediaRecorder1.Stop();
    }
}

Related item

Start method


MediaRecorder event

API version 21

Event

iOSAndroidWindows

There are no events defined in the MediaRecorder class.

Class overview

Base class events


Extension6 package

It is an extended GUI package added in Biz/Browser HT.

class

API | name | Explanation
24 | ExpandableList | Displays a list that can be expand and closed (accordion list)
24 | ExpandableListItem | Defines the choices for the ExpandableList class
27 | ImageFilter | Process the the Image object
28 | SlideMenu | Operate slide menu
28 | SlideMenuContent | Display content in slide menu
24 | SwitchButton | Show switch control
24 | SwitchItem | Defines the choices for the SwitchButton class


ExpandableList class

iOSAndroidWindows

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | ExpandableList

This class displays a list that can be expanded and closed (accordion list).

ExpandableList class works in tandem with the ExpandableListItem class.

To set the data to be displayed as a choice, you need to place an object of ExpandableListItem or its derived class in the structure defined under the ExpandableList object.

Object structure

Keyboard operation

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
UP | Move to the previous option
LEFT | Move to the previous option
BOTTOM | Move to the next option
RIGHT | Move to the next option

Default properties and ValueType

The default property is Value. The value type specification is invalid.

Precautions when scaling

Nothing in particular


ExpandableList property

API version 24

Property

iOSAndroidWindows

The following properties are defined in the ExpandableList

API | name | access | Type | initial value | Explanation
24 | BgColor | CRW | integer | $STD | Background color
24 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
24 | Divider | CRW | boolean | $FALSE | Display of divider line
24 | DividerColor | CRW | integer | $STD | Divider color line
HT(24) | ExpandKey | CR | integer |  | Key to switch the expanded/closed state of group
24 | FontFace | CR | integer | $STD | Font decoration attributes
24 | FontKind | CR | integer | $STD | Font type
24 | GroupBgColor | CRW | integer | $STD | Background color of the parent item of the group
24 | GroupFgColor | CRW | integer | $STD | Text color of the parent item of the group
24 | GroupFontSize | CR | integer | 10 | Font size of the parent item of the group
24 | GroupHeight | CR | integer | 0 | Item height of the parent item of the group
24 | ImagePos | CR | integer | $LEFT | Display position of expanded/closed status icon
24 | Indent | CRW | integer | -1 | indented width
24 | ItemBgColor | CRW | integer | $STD | Background color of the item
24 | ItemFgColor | CRW | integer | $STD | Text color of the item
24 | ItemFontSize | CR | integer | 10 | Font size of the item
24 | ItemHeight | CR | integer | 0 | Item height
24 | Scroll | CR | integer | $AUTO | Scroll bar display control
24 | SelectedBgColor | CRW | integer | $STD | Background color of the selected item
24 | SelectedFgColor | CRW | integer | $STD | Text color of the selected item
24 | Value | CRW | integer |  | Selected position

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


ExpandableList.BgColor property

iOSAndroidWindows

Specify the background color with a color constant .

The color of the item is specified by the ItemBgColor property, and the color of the parent item of the group is specified by the GroupBgColor property.


ExpandableList.Divider property

iOSAndroidWindows

If set to $TRUE, a divider line is displayed between items.

If set to $FALSE, a divider line is hidden.


ExpandableList.DividerColor property

iOSAndroidWindows

Specify the divider line color with a color constant.


ExpandableList.ExpandKey property

iOSAndroidWindows

Set the key to switch the expanded/closed state.

If not set, the F4 key will be the expanded/closed key.

The expanded/closed status of the group to which the currently selected item belongs is toggled.

For the values that can be specified for the ExpandKey property, refer to Key specification.


ExpandableList.GroupBgColor property

iOSAndroidWindows

Specify the background color of the parent item of the group with a color constant.


ExpandableList.GroupFgColor property

iOSAndroidWindows

Specify the character color of the parent item of the group with a color constant.


ExpandableList.GroupFontSize property

iOSAndroidWindows

Specifies the font size of the parent item of the group with a number of points in the range 0-100. If 0 is specified, it will be displayed with the initial value of 10 points.

Negative values cannot be set.


ExpandableList.GroupHeight property

iOSAndroidWindows

Specifies the height of the parent item of the group.

The default value is 0, which means the default height if 0 is specified.

The height specified by this property is not scaled by the font size and the parent item of the group will always be displayed at the set height.


ExpandableList.ImagePos property

iOSAndroidWindows

Specifies the display position of the expanded/closed icon. Set one of the following values;

constant | value | explanation
$LEFT | 1 | Display icon on the left.
$RIGHT | 3 | Display icon on the right.

The indent width when the Indent property is -1 depends on the ImagePos property.


ExpandableList.Indent property

iOSAndroidWindows

Specifies the indentation width of the item's display content.

Items placed in a group are indented by the width specified by the Indent property.

If -1 is specified for the Indent property, the indent width will be as follows, depending on the ImagePos property.

Value of thr ImagePos property | Indented width
$LEFT | Width of expanded/closed icon
$RIGHT | 0


ExpandableList.ItemBgColor property

iOSAndroidWindows

Specify the background color of the item with a color constant.


ExpandableList.ItemFgColor property

iOSAndroidWindows

Specify the character color of the item with a color constant.


ExpandableList.ItemFontSize property

iOSAndroidWindows

Specifies the font size of the item with a number of points in the range 0-100. If 0 is specified, it will be displayed with the initial value of 10 points.

Negative values cannot be set.


ExpandableList.ItemHeight property

iOSAndroidWindows

Specifies the height of the ExpandableListItem item.

The default value is 0, which means the default height if 0 is specified.

The height specified by this property is not scaled by the font size and the ListItem will always be displayed at the set height.


ExpandableList.SelectedBgColor property

iOSAndroidWindows

Specify the background color of the selected item with a color constant.


ExpandableList.SelectedFgColor property

iOSAndroidWindows

Specify the character color of the selected item with a color constant.


ExpandableList.Value property

iOSAndroidWindows

The array number of the currently selected list item.

-1 indicates the unselected state.


ExpandableList method

API version 24

Method

iOSAndroidWindows

The following methods are defined in the ExpandableList class.

API | name | Explanation
24 | ResetClosedImage | Discard the image set by SetClosedImage method
24 | ResetExpandedImage | Discard the image set by SetExpandedImage method
24 | SetClosedImage | Set the image of the icon that appears when a group of items is closed.
24 | SetExpandedImage | Set the image of the icon that appears when a group of items is expanded.

Class overview

Base class methods


ExpandableList.ResetClosedImage method

iOSAndroidWindows

Explanation

Discards the image set by the SetClosedImage method and displays the default icon.

Call format

ExpandableList1.ResetClosedImage( )

Return value

None

argument

None

exception

None

Example of use

ExpandableList1.ResetClosedImage();

Related item

SetClosedImage method


ExpandableList.ResetExpandedImage method

iOSAndroidWindows

Explanation

Discards the image set by the SetExpandedImage method and displays the default icon.

Call format

ExpandableList1.ResetExpandedImage( )

Return value

None

argument

None

exception

None

Example of use

ExpandableList1.ResetExpandedImage();

Related item

SetExpandedImage method


ExpandableList.SetClosedImage method

iOSAndroidWindows

Explanation

Sets the image of the icon that is displayed when the group is closed, among the icons that indicate the open/closed status of the item group.

Call format

ExpandableList1.SetClosedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

If null is specified, the icon will be hidden.

exception

EXT-1

Illegal argument URL

EXT-7

%s is invalid reference

Example of use

ExpandableList1.SetClosedImage(ImageList1.GetImage(0));
ExpandableList1.SetClosedImage("img/sample.png");

Related item

ResetClosedImage method

Image、ImageList class


ExpandableList.SetExpandedImage method

iOSAndroidWindows

Explanation

Sets the image of the icon that is displayed when the group is expanded, among the icons that indicate the open/closed status of the item group.

Call format

ExpandableList1.SetExpandedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

If null is specified, the icon will be hidden.

exception

EXT-1

Illegal argument URL

EXT-7

%s is invalid reference

Example of use

ExpandableList1.SetExpandedImage(ImageList1.GetImage(0));
ExpandableList1.SetExpandedImage("img/sample.png");

Related item

ResetExpandedImage method

Image、ImageList class


ExpandableList event

API version 24

Event

iOSAndroidWindows

There are no events defined in the ExpandableList class.

Class overview

Base class event


ExpandableListItem class

iOSAndroidWindows

Object
 | NetObject
 |  | ExpandableListItem

A class that defines the choices of the ExpandableList class. Be sure to array and use it as a child object of ExpandableListBox class.

Default properties and ValueType

The default property is Value. ValueType can be String, Number, Date.


ExpandableListItem property

API version 24

Property

iOSAndroidWindows

The following properties are defined in the ExpandableListItem

API | name | access | Type | initial value | Explanation
24 | Expandable | CRW | boolean | $TRUE | Whether it can be opened and closed when tapped
24 | Expanded | CRW | boolean | $TRUE | Group expand/close status
24 | GroupKey | CR | String |  | Parent key of group
24 | Key | CR | String |  | my key
24 | Selected | CRW | boolean | $FALSE | Item selection status
24 | Title | CRW | String |  | The string displayed in the choices
24 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


ExpandableListItem.Expandable property

iOSAndroidWindows

Specifies whether groups can be expanded and closed by tapping.

Specify $TRUE if it can be expanded and closed, or $FALSE if it cannot be opened and closed.


ExpandableListItem.Expanded property

iOSAndroidWindows

The expand/close status of the group.

If a group is expanded, it is $TRUE; if not, it is $FALSE.


ExpandableListItem.GroupKey property

iOSAndroidWindows

This is the key value for group display.

The Key property is used together with the GroupKey property. Subsequent rows with a GroupKey property of the same value as that specified for the Key property will be connected and displayed as the same group.

Display example

row | Key property value | GroupKey property value | Title property value
1 | Group1 |  | Group1
2 |  | Group1 | item1-1
3 | Group1-2 | Group1 | Group1-2
4 |  | Group1-2 | item1-2-1
5 |  | Group1-2 | item1-2-2


ExpandableListItem.Key property

iOSAndroidWindows

This is the key value for group display. The item for which the Key property is specified is the parent item of the group.

The Key property is used together with the GroupKey property. Subsequent rows with a GroupKey property of the same value as that specified for the Key property will be connected and displayed as the same group.

Display example

row | Key property value | GroupKey property value | Title property value
1 | Group1 |  | Group1
2 |  | Group1 | item1-1
3 | Group1-2 | Group1 | Group1-2
4 |  | Group1-2 | item1-2-1
5 |  | Group1-2 | item1-2-2


ExpandableListItem.Selected property

iOSAndroidWindows

The selection state of the item.

$TRUE if selected, $FALSE if not selected.

If the Selected property of the parent item of the group is changed, no Touch event will be fired, and the ExpandableList.Value property will not change.


ExpandableListItem.Title property

iOSAndroidWindows

The characters to display in the list.


ExpandableListItem.Value property

iOSAndroidWindows

The value of the object. Holds the value of the data type specified in ValueType.

The value of this property does not affect the behavior of the object.

The selected state of the choice can be specified by the Selected property, and the character to be displayed as the choice can be specified by the Title property.


ExpandableListItem method

API version 24

Method

iOSAndroidWindows

There are no methods defined in the ExpandableListItem class.

Class overview

Base class methods


ExpandableListItem event

API version 24

Event

iOSAndroidWindows

The following events are defined in the ExpandableListItem class.

API | name | Explanation
24 | Expand | Occurs when the expand/close status of a group changes
24 | Touch | Occurs when an item is selected.
24 | DoubleClicked | Occurs when double tapped

Class overview

Base class event


ExpandableListItem.Expand event

iOSAndroidWindows

this event occurs when the expand/close status of a group changes.

It occurs regardless of the operation from the screen or the operation from the script.

Note

In the handler of the event that occurred in the ExpandableListItem class, do not use the Value property of the parent object ExpandableList class to refer to the selected item number. (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (ExpandableListItem object) of the Event object passed as an argument of the event handler. For the selected state of the item, refer to the Selected property from the From property.


ExpandableListItem.Touch event

iOSAndroidWindows

This event occurs when an item is selected.

It occurs regardless of the operation from the screen or the operation from the script.

If you tap the parent item of a group, this event will not occur.

Note

In the handler of the event that occurred in the ExpandableListItem class, do not use the Value property of the parent object ExpandableList class to refer to the selected item number. (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (ExpandableListItem object) of the Event object passed as an argument of the event handler. For the selected state of the item, refer to the Selected property from the From property.


ExpandableListItem.DoubleClicked event

iOSAndroidWindows

Occurs when double tapped.

The following child objects are attached to the Event object.

Type | name | Explanation
Number | xPos | X coordinate of mouse pointer
Number | yPos | Y coordinate of mouse pointer

Note

In the handler of the event that occurred in the ExpandableListItem class, do not use the Value property of the parent object ExpandableList class to refer to the selected item number. (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (ExpandableListItem object) of the Event object passed as an argument of the event handler. For the selected state of the item, refer to the Selected property from the From property.


ImageFilter class

iOSAndroidWindows

Object
 | ImageFilter

Process the Image object.

Default properties and ValueType

There are no default properties. The value type specification is invalid.


ImageFilter property

API version 27

Property

iOSAndroidWindows

There are no properties defined in the ImageFilter class.

Class overview

Base class properties


ImageFilter method

API version 27

Method

iOSAndroidWindows

The following methods are defined in the ImageFilter class.

Static method

API | name | Explanation
27 | Composite | Composites two images

Class overview

Base class methods


ImageFilter.Composite method

iOSAndroidWindows

Explanation

Composite two Image objects.

Cut out a part of tgtImg and overlay it on dstImg. The superimposed image is transformed to the size specified by dstW and dstH.

If you want to keep the aspect ratio of the superimposed image, please match the aspect ratio of the superimposed image to the image.

Call format

img = ImageFilter.Composite( dstImg , dstX , dstY , dstW , dstH , tgtImg , tgtX , tgtY , tgtW , tgtH [, option] )

Return value

an Image object for the composited image.

argument

Image dstImg

Image object to be overlaid.

If you specify an ImageList object, the first image is used.

integer dstX

X coordinate of top left corner of region to be clipped in dstImg.

integer dstY

Y coordinate of the top left corner of the region to be clipped in dstImg.

integer dstW

Width of region to cut out in dstImg.

integer dstH

Height of the region to cut out in dstImg.

Image tgtImg

Image object to overlay.

If you specify an ImageList object, the first image is used.

integer tgtX

X coordinate of upper left corner of overlapping region in tgtImg.

integer tgtY

Y coordinate of upper left corner of overlapping area in tgtImg.

integer tgtW

Width of overlapping area in tgtImg.

integer tgtH

Height of overlapping region in tgtImg.

The meaning of the arguments is as follows:

dstImg image | tgtImg image | Result

Negative values can be specified for dstX, dstY, tgtX, and tgtY.

dstX, dstY are negative values. | tgtX, tgtY are negative values.

Integer option

Specify the composition method from the following values:

constant | value | Explanation
ImageFilter.CompositeOptionLayer | 0 | Simply overlay the images.
ImageFilter.CompositeOptionMultiply | 1 | Overlay images in multiply mode.

If omitted, it will be ImageFilter.CompositeOptionLayer.

This is an example of results due to different composition methods:

Composition method | dstImg | tgtImg | Result
ImageFilter.CompositeOptionLayer |  |  |
ImageFilter.CompositeOptionMultiply |  |  |

exception

FUNC-4

Wrong argument value

EXT-1

Illegal argument

EXT-7

invalid reference

EXT-26

Image data is object reference

Example of use

/* Overlay the entire tgtImg while maintaining the size and aspect ratio */
var img = ImageFilter.Composite(dstImg, 100, 100, tgtImg.Width, tgtImg.Height, tgtImg, 0, 0, tgtImg.Width, tgtImg.Height, ImageFilter.CompositeOptionMultiply);

Related item


ImageFilter event

API version 27

Event

iOSAndroidWindows

There are no events defined in the ImageFilter class.

Class overview

Base class event


SlideMenu class

iOSAndroidWindows

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | SlideMenu

A class for operating the slide menu.

Place and manage a SlideMenuContent object under of the slide menu.

The X, Y, Width, and Height properties of the SlideMenu class have no effect. The size of the menu is determined by the Width and Height properties of the SlideMenuContent class.

The slide menu is opened with the Open method. To close the menu, call the Close method or tap outside the menu.

スOpening and closing the menu by swiping is not supported. If you want to open and close the menu by swiping, consider implementing it with the Form.Gesture event.

Screen display example

Default properties and ValueType

There are no default properties. The value type specification is invalid.


SlideMenu property

API version 28

Property

iOSAndroidWindows

The following properties are defined in the SlideMenu class.

API | name | access | type | Initial value | explanation
28 | Position | CR | integer | 0 | Position to display the slide menu

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class property


SlideMenu.Position property

iOSAndroidWindows

Specify the display position of the slide menu from the following:

constant | value | explanation
SlideMenu.Left | 0 | Displays the menu on the left side of the screen.
SlideMenu.Top | 1 | Display the menu at the top of the screen
SlideMenu.Right | 2 | Display the menu on the right side of the screen.
SlideMenu.Bottom | 3 | Display the menu at the bottom of the screen

The default value is SlideMenu.Left.


SlideMenu method

API version 28

Method

iOSAndroidWindows

The following properties are defined in SlideMenu class.

API | name | explanation
28 | Close | Hide the slide menu
28 | Open | Display the slide menu

Class overview

Base class method


SlideMenu.Close method

iOSAndroidWindows

explanation

Hide the slide menu.

Call format

slidemenu.Close()

Return value

None

argument

None

exception

None

Example of use

Form Form1 {
 X = 0;
 Y = 0;
 Width = 234;
 Height = 278;
 Button btnMenuOpen {
  X = 30;
  Y = 30;
  Width = 200;
  Height = 40;
  Title = "Open Slide Menu";
  Function OnTouch(e) {
   ^.slidemenu.Open();
  }
 }

 SlideMenu slidemenu {
  /* Specifies where to place the slide menu. */
  Position = SlideMenu.Left;

  SlideMenuContent content {
   Width  = 300;
   Height &= //.Height;

   /* Objects can be placed under SlideMenuContent. */
   Button btn {
    /* X, Y coordinates can be specified in SlideMenuContent. */
    X = 0;
    Y = 0;
    Width  = 200;
    Height = 40;
    Title = "Close Slide Menu";
    Function OnTouch(e) {
     ^.^.Close();
    }
   }

  }

 }

}

Related item

Open method


SlideMenu.Open method

iOSAndroidWindows

explanation

Display the slide menu.

Call format

slidemenu.Open()

Return value

None

argument

None

exception

None

Example of use

Form Form1 {
 X = 0;
 Y = 0;
 Width = 234;
 Height = 278;
 Button btnMenuOpen {
  X = 30;
  Y = 30;
  Width = 200;
  Height = 40;
  Title = "Open Slide Menu";
  Function OnTouch(e) {
   ^.slidemenu.Open();
  }
 }

 SlideMenu slidemenu {
  /* Specifies where to place the slide menu. */
  Position = SlideMenu.Left;

  SlideMenuContent content {
   Width  = 300;
   Height &= //.Height;

   /* Objects can be placed under SlideMenuContent. */
   Button btn {
    /* X, Y coordinates can be specified in SlideMenuContent. */
    X = 0;
    Y = 0;
    Width  = 200;
    Height = 40;
    Title = "Close Slide Menu";
    Function OnTouch(e) {
     ^.^.Close();
    }
   }

  }

 }

}

Related item

Close method


SlideMenu event

API version 28

Event

iOSAndroidWindows

There are no events defined in the SlideMenu class.

Class overview

Base class event


SlideMenuContent class

iOSAndroidWindows

Object |  |  |  |  |
 | NetObject |  |  |  |
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | Form
 |  |  |  |  | SlideMenuContent

A class that displays the contents of the slide menu.

Be sure to use it as a child object of SlideMenu class.

Place and manage another object under the SlideContent. Subordinate objects are not displayed beyond the area of the parent SlideMenuContent object to which they belong, and are clipped by the size of the parent SlideMenuContent object.

Specify the display size using the Width and Height properties However, specifying the X property and Y property is invalid.

Screen display example

Restrictions on displayable size

If the Width property and Height property of SlideMenuContent exceed the screen size, the area beyond the screen cannot be displayed.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


SlideMenuContent property

API version 28

Property

iOSAndroidWindows

There are no events defined in the SlideMenuContent class.

Class overview

Base class property


SlideMenuContent method

API version 28

Method

iOSAndroidWindows

There are no methods defined in the SlideMenuContent class.

Class overview

Base class method


SlideMenuContentevent

API version 28

Event

iOSAndroidWindows

There are no events defined in the SlideMenuContent class.

Class overview

Base class event


SwitchButton class

iOSAndroidWindows

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | ContainerObject
 |  |  |  | SwitchButton

This class displays a switch control that allows you to select any number from multiple choices.

The SwitchButton class works in tandem with the SwitchItem class.

To set the data to be displayed as a choice, you need to place the SwitchItem class or its derived class objects in the structure defined below the SwitchButton object.

Object structure

Screen display example

Default properties and ValueType

The default property is Value. The value type specification is invalid.

Precautions when scaling

Nothing in particular


SwitchButton property

API version 24

Property

iOSAndroidWindows

The following properties are defined in the SwitchButton.

API | name | access | Type | initial value | Explanation
24 | BgColor | CRW | integer | $STD | Background color
24 | Border | CR | boolean | $FALSE | Display of frame
28 | BorderColor | CRW | integer | $STD | Border color
24 | FgColor | CRW | integer | $STD | Text color
24 | FontFace | CR | integer | $STD | Font decoration attributes
24 | FontKind | CR | integer | $STD | Font type
24 | FontSize | CR | integer | 10 | Font size
24 | Scalable | CR | boolean | $FALSE | Whether the switch control is scalable or not
24 | Scroll | CR | integer | $AUTO | Scroll bar display control
24 | Value | CRW | integer |  | Selected position

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


SwitchButton.Scalable property

iOSAndroidWindows

If $TRUE, the checkbox size is scaled according to theForm.HorizontalScale and Form.VerticalScale properties. VerticalScale property.

If $FALSE, no scaling is performed.

Default value is $FALSE.

The switch control are scaled while maintaining the aspect ratio. If the values of the Form.HorizontalScale and Form.VerticalScale properties are different, the smaller value is used for the scaling factor.


SwitchButton.Value property

iOSAndroidWindows

The array number of the last selected item.

-1 indicates the unselected state.

Get the selected status of each option with the SwitchItem.Selected property.


SwitchButton method

API version 24

Method

iOSAndroidWindows

The following methods are defined in the SwitchButton class.

API | name | Explanation
24 | ResetThumbImage | Discard the image set by SetThumbImage method
24 | ResetTrachCheckedImage | Discard the image set by the SetTrachCheckedImage method
24 | ResetTrachUncheckedImage | Discard the image set by the SetTrachUncheckedImage method
24 | SetThumbImage | Set the thumb of switch image
24 | SetTrachCheckedImage | Set the background image for the check state
24 | SetTrachUncheckedImage | Set the background image for the unchecked state

Class overview

Base class methods


SwitchButton.ResetThumbImage method

iOSAndroidWindows

Explanation

Discards the switch control thumb image set by the SetThumbImage method.

Call format

SwitchButton1.ResetThumbImage( )

Return value

None

argument

None

exception

None

Example of use

SwitchButton1.ResetThumbImage();

Related item

SetThumbImage method


SwitchButton.ResetTrackCheckedImage method

iOSAndroidWindows

Explanation

Discard the image set by the SetTrackCheckedImage method.

Call format

SwitchButton1.ResetTrackCheckedImage( )

Return value

None

argument

None

exception

None

Example of use

SwitchButton1.ResetTrackCheckedImage();

Related item

SetTrackCheckedImage method


SwitchButton.ResetTrackUncheckedImage method

iOSAndroidWindows

Explanation

Discard the image set by the SetTrackUncheckedImage method.

Call format

SwitchButton1.ResetTrackUncheckedImage( )

Return value

None

argument

None

exception

None

Example of use

SwitchButton1.ResetTrackUncheckedImage();

Related item

SetTrackUncheckedImage method


SwitchButton.SetThumbImage method

iOSAndroidWindows

Explanation

Discard the image set by the SetThumbImage method.

Call format

SwitchButton1.SetThumbImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

Illegal argument URL

EXT-7

%s is invalid reference

Example of use

SwitchButton1.SetThumbImage(ImageList1.GetImage(0));
SwitchButton1.SetThumbImage("img/sample.png");

Related item

ResetThumbImage method

Image、ImageList class


SwitchButton.SetTrackCheckedImage method

iOSAndroidWindows

Explanation

Set the image to be displayed in the background of the switch control in the check state.

Call format

SwitchButton1.SetTrackCheckedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

Illegal argument URL

EXT-7

%s is invalid reference

Example of use

SwitchButton1.SetTrackCheckedImage(ImageList1.GetImage(0));
SwitchButton1.SetTrackCheckedImage("img/sample.png");

Related item

ResetTrackCheckedImage method

Image、ImageList class


SwitchButton.SetTrackUncheckedImage method

iOSAndroidWindows

Explanation

Set the image to be displayed in the background of unchecked switch controls.

Call format

SwitchButton1.SetTrackUncheckedImage( img )

Return value

None

argument

Object img

Set the Image object, ImageList object, or URL.

If you specify an ImageList object, the first image is used.

When set by URL, the image file format supports image files such as BMP, GIF, TIFF, JPEG, and PNG (including transparent PNG).

exception

EXT-1

Illegal argument URL

EXT-7

%s is invalid reference

Example of use

SwitchButton1.SetTrackUncheckedImage(ImageList1.GetImage(0));
SwitchButton1.SetTrackUncheckedImage("img/sample.png");

Related item

ResetTrackUncheckedImage method

Image、ImageList class


SwitchButton event

API version 24

Event

iOSAndroidWindows

There are no events defined in the SwitchButton class.

Class overview

Base class event


SwitchItem class

iOSAndroidWindows

Object |  |  |  |
 | NetObject
 |  | DisplayObject
 |  |  | FocusObject
 |  |  |  | SwitchItem

A class that defines the choices of the SwitchButton class. Be sure to array and use it as a child object of SwitchButton class.

Screen display example

Keyboard operation

This object supports keyboard operation. You can perform the following key operations.

Key | Explanation
SPACE | Invert selection

Default properties and ValueType

The default property is Value. ValueType can be String, Number, Date.

Precautions when scaling

◆ If you want to scale the select button, set the SwitchButton.Scalable property to $TRUE.


SwitchItem property

API version 24

Property

iOSAndroidWindows

The following properties are defined in the SwitchItem class.

API | name | access | Type | initial value | Explanation
24 | Selected | CRW | boolean | $FALSE | Item selection status
24 | Title | CRW | String |  | The string displayed in the choices
24 | Value | CRW | String Number Date |  | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


SwitchItem.Selected property

iOSAndroidWindows

The item is selected.

It will be $TRUE if checked and $FALSE if unchecked.


SwitchItem.Title property

iOSAndroidWindows

The character to be displayed as a choice.


SwitchItem.Value property

iOSAndroidWindows

The value of the object. Holds the value of the data type specified in ValueType.

The value of this property does not affect the behavior of the object.

The selected state of the choice can be specified by the Selected property, and the character to be displayed as the choice can be specified by the Title property.


SwitchItem method

API version 24

Method

iOSAndroidWindows

There are no methods defined in the SwitchItem class.

Class overview

Base class methods


SwitchItem event

API version 24

Event

iOSAndroidWindows

The following events are defined in the SwitchItem class.

API | name | Explanation
24 | Touch | Occurs when the switch control selection status is changed

Class overview

Base class event


SwitchItem.Touch event

iOSAndroidWindows

This event occurs when the selected state of the switch control is changed.

It occurs regardless of the operation from the screen or the operation from the script.

Note

In the handler of the event that occurred in SwitchItem class, do not use the Value property of SwitchButton class, which is the parent object, to refer to the selected item number. (The selected item number may not be reflected.)

For the selected item number, refer to the Index property (array subscript) of the From property (SwitchItem object) of the Event object passed as an argument of the event handler. For the selected state of the item, refer to the Selected property from the From property.


CSV package

This package is for handling CSV (comma-separated text) format data.

class

API | name | Explanation
4 | CSVDocument | Holds CSV data


CSVDocument class

Object
 | CSVDocument

A class that holds CSV data.

The CSVDocument class has the following features.

1. All cell data is stored in one CSVDocument object, which is lightweight.

2. You can freely add or delete rows and columns.

3. Sorting, merging, and file input / output are possible.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


CSVDocument property

API version 4

Property

iOS Android Windows

The following properties are defined in the CSVDocument class.

API | name | access | Type | Explanation
4 | Columns | R | integer | The number of columns in CSV data
4 | Rows | R | integer | The number of lines of CSV data
4 | Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


CSVDocument.Columns property

The number of columns in CSV data.

This property is read-only and cannot be changed.


CSVDocument.Rows property

The number of rows of CSV data.

This property is read-only and cannot be changed.


CSVDocument.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


CSVDocument method

API version 4

Method

iOS Android Windows

The following methods are defined in the CSVDocument class.

API | name | Overview
4 | ( Constructor ) | Initializes the CSVDocument object
4 | Clear | Remove all rows and columns
29 | CreateIndex | create an index
4 | ClearColumnName | Remove all column names
4 | DeleteColumn | Remove column
4 | DeleteRow | Delete line
4 | Find | Search CSV
4 | Get | Read CSV from URL
4 | GetCell | Gets the cell data
4 | GetCellByName | Gets the cell data by specifying the column name
4 | GetCells | Collects multiple columns of data in a specified row
4 | GetColumnName | Gets the name of the column
4 | InsertColumn | Insert a column
4 | InsertRow | Insert a line
4 | Load | Read CSV from Reader object
4 | Merge | Combine two CSVs
4 | Parse | Read CSV from string
4 | Replace | Replace data in multiple cells at once
4 | Save | Save CSV in Writer object
4 | SetCell | Set the cell data
4 | SetCellByName | Set the cell data by specifying the column name
4 | SetCells | Batch update the data in multiple columns in the specified row
4 | SetColumnName | Sets the name of the column
4 | Splice | Split CSV
4 | Sort | Sort CSV
4 | Truncate | Delete multiple lines at once

Class overview

Base class methods


CSVDocument constructor

Explanation

Initialize the CSVDocument object.

The internal character code is UTF-8.

Call format

var csvdoc = new CSVDocument([ enc ])

Return value

CSVDocument object

argument

integer enc

It is retained for compatibility.

The specification will be ignored.

exception

None

Example of use

var csvdoc = new CSVDocument();
var res = session.Get("/test/sample.csv");
csvdoc.Load(res);

Related item

Character code of CSVDocument in Biz/Browser HT

The internal character code of CSVDocument is always UTF-8. Therefore, the CSV file read by the Get method and Load method must be saved in UTF-8 format.

CSV files saved with other character codes (Shift-JIS, Unicode (UTF-16), etc.) cannot be read. In addition, saving with the Save method will also be in UTF-8 format.


CSVDocument.Clear method

Explanation

Delete all rows and columns to make it completely empty.

Call format

csvdoc.Clear()

Return value

None

argument

None

exception

None

Example of use

var csvdoc = new CSVDocument;
var res = session.Get("/test/sample.csv");
csvdoc.Load(res);
csvdoc.Clear();

Related item

Truncate method


CSVDocument.ClearColumnName method

Explanation

Delete the names of all columns.

Call format

csvdoc.ClearColumnName()

Return value

None

argument

None

exception

None

Example of use

var csvdoc = new CSVDocument;
csvdoc << CSV(c1, c2, c3){
1,2,3
4,5,6
};
for(var c = 0; c <csvdoc.Columns; c++) {
    print(csvdoc.GetColumnName(c), "\n");
}
csvdoc.ClearColumnName();

Related item

GetColumnName , SetColumnName methods


CSVDocument.CreateIndex method

iOSAndroidWindows

Explanation

Create an index to speed up searches using the Find method.

After creating an index with this method, if the search conditions given in the Find method are searchable conditions in the index, the search execution time will be shorter.

The index will be cleared by calling the method below;

Clear method

Parse method

Get method

Load method

When you call the method below, the index will be updated according to the changes made to the CSV data by the method;

DeleteColumn method (However, if you drop the indexed column, the index will also be dropped)

DeleteRow method

InsertColumn method

InsertRow method

Replace method

SetCell method

SetCellByName method

SetCells method

Splice method

Sort method

Truncate method

Also, the CSVDocument class object generated by the return value of the Merge method or Splice method has an index. I don't have it.

Call format

csvdoc.CreateIndex( column )

Return value

None

argument

integer column

0-based row number of the row to index

exception

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc.Get("/test/sample.csv");
csvdoc.CreateIndex(0);

Related item

Find method


CSVDocument.DeleteColumn method

Explanation

Deletes the column at the specified position.

Call format

csvdoc.DeleteColumn( column )

Return value

None

argument

integer column

0-based column number of the column to delete

If you specify 0, the first column is deleted, and if you specify 1, the second column is deleted.

exception

CSV-4

The specified column could not be deleted

Example of use

var csvdoc = new CSVDocument;
var res = session.Get("/test/sample.csv");
csvdoc.Load(res);
csvdoc.DeleteColumn(0);

Related item

InsertColumn , InsertRow , DeleteRow methods


CSVDocument.DeleteRow method

Explanation

Deletes the row at the specified position.

Call format

csvdoc.DeleteRow( row )

Return value

None

argument

integer row

Line number starting with 0 on the line to be deleted

If you specify 0, the first line is deleted, and if you specify 1, the second line is deleted.

exception

CSV-6

The specified line could not be deleted

Example of use

var csvdoc = new CSVDocument;
var res = session.Get("/test/sample.csv");
csvdoc.Load(res);
csvdoc.DeleteRow(0);

Related item

InsertRow , InsertColumn , DeleteColumn methods


CSVDocument.Find method

Explanation

Searches CSV data under the specified conditions and returns the line number of the first found line.

Call format

var ret = csvdoc.Find ( row [, cond1 [, cond2 ,…]])

Return value

Line number starting with 0 that first matches the condition

Returns -1 if no matching row is found.

argument

integer row

Line number starting with 0 on the line to start the search

The row after the row specified by row will be searched.

String cond

Search conditions

Specify in the same format as the Load method.

You can specify as many search conditions as there are columns at the maximum, and if you specify more than one, they will be combined by AND.

exception

None

Example of use

var csvdoc = new CSVDocument;
csvdoc << Form1.Spread1.row;
var row = csvdoc.Find(0, "0 == X11", "3n <100");
Form1.Spread1.Value = row;

Related item

Load , Replace method


CSVDocument.Get method

Explanation

Reads CSV data from the specified URL.

The data before executing the Get method will be lost.

The CSV data to be acquired is not cached. Always get from the server.

If you do not specify param , the request will be sent via HTTP GET.

If you specify param , the request will be sent via HTTP POST.

If the web server does not return 200 ($HTTP_OK) for the HTTP status code, a CRS-331 exception will occur.

It is also possible to raise an arbitrary exception by using the HTTP response header.

See NetObject.Get for more information.

If charset is specified in Content-Type of HTTP response header, WEB server parses the received CSV data as a character string with the specified character code.

If no character code is specified or the character code is unknown, it will be parsed as a UTF-8 character string.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

csvdoc.Get( URL [, param1 [, param2 ,…]])

Return value

None

argument

String URL

URL to read CSV data

Same as the URL of the NetObject.Get method .

Object param

Parameters to be added to the request

Same as param of NetObject.Get method .

exception

CSV-1

CSV format is invalid

CSV-10

The number of columns is not constant

CRS-331

Communication error

Same as the exception to the NetObject.Get method.

Example of use

var csvdoc = new CSVDocument;
csvdoc.Get("/test/sample.cgi", "KEY=126", "MODE=A");

Related item

Load , Parse , NetObject.Get methods


CSVDocument.GetCell method

Explanation

Get the cell data by specifying the row and column.

Call format

var data = csvdoc.GetCell ( row , column )

Return value

Cell string

If the corresponding cell does not exist, null is returned.

argument

integer row

0-based row number of the cell to retrieve

integer column

0-based column number of the cell to retrieve

exception

None

Example of use

var csvdoc = new CSVDocument;
var res = session.Get("/test/sample.csv");
csvdoc.Load(res);
var cell = csvobj.GetCell(0, 1);
print(cell, "\n");

Related item

SetCell , GetCells , GetCellByName methods


CSVDocument.GetCellByName method

Explanation

Get the cell data by specifying the column name and row number.

The column name is set by the SetColumnName method or CSV constant .

Call format

var cell = csvdoc.GetCellByName ( row , columnName )

Return value

The character string of the acquired cell

If the corresponding cell does not exist, null is returned.

argument

integer row

Line number starting with 0 on the line to get

String columnName

The name of the column to get

exception

CSV-13

Line position is incorrect

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc.Get("/test/sample.csv");
csvdoc.SetColumnName(2, "Type");
var cell = csvdoc.GetCellByName(0, "Type");
print(cell, "\n");

Related item

SetCellByName , GetCell , GetColumnName , SetColumnName methods


CSVDocument.GetCells method

Explanation

Collects data in multiple columns of the specified row at once.

Call format

csvdoc.GetCells ( row [, startcol [, endcol ]] )

Return value

Array of String objects of the retrieved cells

argument

integer row

Line number starting with 0 on the line to get

integer startcol

0-based column number of the column to start fetching

If startcol is greater than the number of columns that actually exist, no columns will be retrieved. If startcol is omitted or a negative number is specified, it is acquired from the first column.

integer endcol

0-based column number of the column for which acquisition ends

The column immediately before the specified column is acquired. If endcol is less than or equal to startcol, no columns will be retrieved. If endcol is omitted or a value larger than the number of columns that actually exist is specified, the last column is acquired.

exception

CSV-13

Line position is incorrect

Example of use

var csvdoc = new CSVDocument;
csvdoc.Load(robj);

/* Get the 3rd to 5th columns of the 2nd row */
var cells = csvdoc.GetCells(1, 2, 5);
for(var i = 0; i <cells.Length; i++) {
    print(cells[i], "\n");
}

Related item

SetCells , GetCell methods


CSVDocument.GetColumnName method

Explanation

Gets the name of the column.

You can get the name set by the SetColumnName method or CSV constant .

Call format

var name = csvdoc.GetColumnName ( column )

Return value

Name of the specified column

argument

integer column

0-based column number of the column for which you want to get the name

exception

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc << CSV(c1, c2, c3){
1,2,3
4,5,6
};
for(var c = 0; c<csvdoc.Columns; c++){
    print(csvdoc.GetColumnName(c), "\n");
}

Related item

SetColumnName , ClearColumnName , GetCellByName , SetCellByName methods


CSVDocument.InsertColumn method

Explanation

Inserts a column at the specified position.

The data in each cell of the inserted column is initialized with an empty string.

Call format

csvdoc.InsertColumn( column )

Return value

None

argument

integer column

Column number starting with 0 at the insertion position

If you specify 0, a new column is created, and if you specify 1, a new column is created in the second column. If you specify a number greater than -1 or the current number of columns, it will be inserted as the last column.

exception

None

Example of use

var csvdoc = new CSVDocument;
csvdoc.InsertColumn(-1);
csvdoc.InsertColumn(-1);
csvdoc.InsertRow(-1);
csvdoc.InsertRow(-1);
csvdoc.SetCell(1, 1, "sample");

Related item

DeleteColumn , InsertRow , DeleteRow methods


CSVDocument.InsertRow method

Explanation

Inserts a line at the specified position.

The data in each cell of the inserted row is initialized with an empty string.

Call format

csvdoc.InsertRow( row )

Return value

None

argument

integer row

Line number starting with 0 at the insertion position

If you specify 0, a new line is created, and if you specify 1, a new line is created on the second line. If you specify a number greater than -1 or the current number of lines, it will be inserted as the last line.

exception

None

Example of use

var csvdoc = new CSVDocument;
csvdoc.InsertColumn(-1);
csvdoc.InsertColumn(-1);
csvdoc.InsertRow(-1);
csvdoc.InsertRow(-1);
csvdoc.SetCell(1, 1, "sample");

Related item

DeleteRow , InsertColumn , DeleteColumn methods


CSVDocument.Load method

Explanation

Read CSV data from the Reader object.

The data before executing the Load method will be lost.

When reading CSV data from a web server or file, you can use the Get method, but the Load method has more flexibility, such as being able to select the line to load.

Call format

csvdoc.Load( reader [, cond1 [, cond2 ,…]])

Return value

None

argument

Object reader

Reader object to read from (object that can use ReadLine method)

String cond

Search condition that specifies the line to read

Specify in the following format.

column [mode] operator value

column

Specify the search key column with a column number starting from 0

mode

Specify "n" to compare the search key as a number (if omitted, compare as a character string)

operator

Specify the following comparison operators

operator | Explanation
== | Match value
!= | Mismatch with value
> | Greater than value
>== | value or more
< | Less than value
<= | less than or equal to value

value

Specify the value to be compared

If you want to compare with another column in the same row, specify the column number with [].

Example

"0 == A" The first column matches the row of A.
"1n> 100" Matches rows where the second column is greater than 100.
"2 == [3]" Columns 3 and 4 match the same row.

You can specify as many search conditions as there are columns at the maximum, and if you specify more than one, they will be combined by AND.

exception

CSV-8

No valid Read object specified

CSV-9

Does not support the ReadLine() method

Example of use

var csvdoc = new CSVDocument;
var res = session.Get("/test/sample.csv");
csvdoc.Load(res, "1n>100", "2 == [3]");

Related item

Save , Get , Parse methods


CSVDocument.Merge method

Explanation

Combines two CSV data.

The number of columns in the two combined CSV data will be adjusted to the larger one.

Call format

var csvdoc3 = csvdoc2.Merge ( csvdoc )

Return value

A new CSVDocument object that combines two CSVDocuments

argument

CSVDocument csvdoc

CSVDocument object to combine

exception

CSV-15

The argument is not a valid CSVDocument object

Example of use

var csvdoc1 = new CSVDocument;
var csvdoc2 = new CSVDocument;
csvdoc1.Get("http://server/data1.csv");
csvdoc2.Get("http://server/data2.csv");
var csvdoc3 = csvdoc1.Merge(csvdoc2);
csvdoc3.Save(file);

Related item

Splice method


CSVDocument.Parse method

Explanation

Read CSV data from a character string.

The data before executing the Parse method will be lost.

The Parse method has the same loading function as the Load method, but you can specify a String object as an argument.

Call format

csvdoc.Parse( str [, cond1 [, cond2 ,…]])

Return value

None

argument

String str

CSV string

String cond

Search condition that specifies the line to read

Specify in the same format as the Load method.

You can specify as many search conditions as there are columns at the maximum, and if you specify more than one, they will be combined by AND.

exception

None

Example of use

var csvdoc = new CSVDocument;
var str = "aaa, bbb, ccc";
csvdoc.Parse(str);

Related item

Save , Get , Load methods


CSVDocument.Replace method

Explanation

Replaces data in multiple cells in a specified column at once.

You can specify search criteria to select cells to replace.

Call format

var ret = csvdoc.Replace ( row , col , val [, cond1 [, cond2 ,…]])

Return value

Number of updated cells

argument

integer row

Line number starting with 0 on the line that starts the replacement

The row after the row specified by row will be replaced.

integer col

0-based column number of the column to replace

String val

Character string to set

You can specify the string directly or specify the value of another column in the following format.

"[Column index]"

Example

"[3]"

In this example, the cells that match the criteria are replaced with the values ​​in the fourth column of the same row.

If the replacement string starts with "[", escape it with "\ [". Note that \ is an escape character in the CRS language, so if you specify it as a string constant in a CRS script, you must specify \ twice.

Example

"\\ [12 \\]"

String cond

Search criteria for cells to replace

Specify in the same format as the Load method.

You can specify as many search conditions as there are columns at the maximum, and if you specify more than one, they will be combined by AND.

exception

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc.Get("http://server/data1.csv");

/* Update the first column of every row to "new data" */
csvdoc.Replace(0, 0, "new data");

/* Update the 2nd column of all rows to the same value as the 3rd column */
csvdoc.Replace(0, 1, "[2]");

/* Update the 5th column of the row where the 4th column is "1" to the same value as the 3rd column */
csvdoc.Replace(0, 4, "[2]", "3 == 1");

/* Update 6th column to the same row as 7th column and 8th column to the same value as 3rd column */
csvdoc.Replace(0, 7, "[2]", "5 == [6]");

Related item

Load , Find method


CSVDocument.Save method

Explanation

Save the CSV data in the Writer object.

The internal character code is UTF-8.

Call format

csvdoc.Save ( writer [, cond1 [, cond2 ,…]])

Or

csvdoc.Save ( writer [, delimiter [, cond1 [, cond2 ,…]]])

Return value

None

argument

Object writer

Writer object to save to

String delimiter

Change the delimiter character on output from the default comma (,).

Specify with "d = [delimiter character]". Only one character can be specified as the delimiter.

For tab delimiter, specify as "d = \ t".

If you change the delimiter, quoting is not performed.

If the second argument is not regarded as a delimiter specification, it is regarded as a search condition specification.

String cond

Search condition that specifies the line to save

Specify in the same format as the Load method.

You can specify as many search conditions as there are columns at the maximum, and if you specify more than one, they will be combined by AND.

exception

CSV-11

No valid Write object specified

CSV-12

Does not support the WriteString(string) method

Example of use

var csvdoc = new CSVDocument;
var res = session.Get("http://server/sample.csv");
csvdoc.Load(res);
var fs = new FileSystem;
var fp = fs.Open("sample.csv", FileSystem.OPEN_WRITE);
csvdoc.Save(fp);
fp.Close();

Related item

Load method


CSVDocument.SetCell method

Explanation

Set the cell data by specifying the rows and columns.

Call format

csvdoc.SetCell ( row , column , text )

Return value

None

argument

integer row

Row number starting with 0 in the cell to be set

integer column

Column number starting with 0 in the cell to be set

String text

Character string to set in the cell

exception

CSV-13

Line position is incorrect

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc.InsertColumn(0);
csvdoc.InsertRow(0);
csvdoc.SetCell(0, 0, "sample");

Related item

GetCell , SetCells , SetCellByName methods


CSVDocument.SetCellByName method

Explanation

Set the cell data by specifying the column name and row number.

The column name is set by the SetColumnName method or CSV constant .

Call format

csvdoc.SetCellByName ( row , columnName , text )

Return value

None

argument

integer row

Line number starting with 0 on the line to be set

String columnName

The name of the column to set

String text

Character string to set in the cell

exception

CSV-13

Line position is incorrect

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc.InsertColumn(0);
csvdoc.InsertRow(0);
csvdoc.SetColumnName(0, "Data");
csvdoc.SetCellByName(0, "Data", "sample");

Related item

GetCellByName , SetCell , GetColumnName , SetColumnName methods


CSVDocument.SetCells method

Explanation

Batch updates the data in multiple columns of the specified row.

Call format

csvdoc.SetCells ( row , column [, data1 [, data2 ...]] )

Return value

None

argument

integer row

Line number starting with 0 on the line to update

integer col

0-based column number of the column to start updating

The columns specified by col are updated in column order as data1 , data2 , ....

String data

Character string to set in the cell

exception

CSV-13

Line position is incorrect

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc.Load(robj);

/* Set "a" in the 3rd column of the 2nd row, "b" in the 4th column, and "c" in the 5th column */
csvdoc.SetCells(1, 2, "a", "b", "c");

Related item

GetCells , SetCell methods


CSVDocument.SetColumnName method

Explanation

Set the name of the column.

Column names can represent object names and property names, as well as simply used as names, and can be copied when copying CSV data to an array with the [] << CSV constant operator or [] << CSVDocument operator. You can explicitly specify the destination object or property.

Call format

csvdoc.SetColumnName ( column , name )

Return value

None

argument

integer column

The 0-based column number of the column you want to name

String name

Column name

If you specify an empty string, the column name will be deleted.

exception

CSV-14

Incorrect column position

Example of use

var csvdoc = new CSVDocument;
csvdoc.Get("http://server/test.csv");
csvdoc.SetColumnName(0, "c1");
csvdoc.SetColumnName(1, "c2");
csvdoc.SetColumnName(2, "c3");

var csvdoc = new CSVDocument;
csvdoc.Get("http://server/test2.csv");
csvdoc.SetColumnName(0, ".Title");
csvdoc.SetColumnName(1, ".Value");
ListBox1.ListItem1 << csvdoc;

Related item

GetColumnName , ClearColumnName , GetCellByName , SetCellByName methods

[] << CSV constant , [] << CSVDocument operator


CSVDocument.Splice method

Explanation

Divides CSV data according to the specified conditions.

Rows that match the criteria are removed from the CSVDocument object and stored in a new CSVDocument object.

Call format

var csvdoc2 = csvdoc.Splice ( row [, cond1 [, cond2 ,…]])

Return value

A new CSVDocument object consisting of only matching rows

argument

integer row

Line number starting with 0 on the line that starts the split

The row after the row specified by row is the target of division.

String cond

Search conditions that specify the lines to split

Specify in the same format as the Load method.

You can specify as many search conditions as there are columns at the maximum, and if you specify more than one, they will be combined by AND.

exception

None

Example of use

/* Rows where the first column is numeric and greater than 2001 and the second column is blank are stored in csvdoc2. */
/* Other lines remain in csvdoc1. */
var csvdoc1 = new CSVDocument;
csvdoc1.Get("http://server/data1.csv");
var csvdoc2 = csvdoc1.Splice(0, "0n> 2001", "1 ==");

Related item

Merge , Load method


CSVDocument.Sort method

Explanation

Sort CSV data.

The sort order can be arbitrarily specified by the key specification character string.

Call format

csvdoc.Sort ( key1 [, key2 [, key3 ,…]])

Return value

None

argument

String key

Keyed string that specifies the sort order

You can specify at least one and at most as many columns as you can, and if you specify more than one, they will be prioritized in the specified order.

Specify in the following format.

column [mode] [arrangement]

column | Specify the column that will be the sort key with a column number starting from 0
mode | Specify "n" to compare the sort key as a number (if omitted, compare as a string)
arrangement | Specify "d" to sort in descending order (ascending if omitted)

Example

"0d" First column in descending order by string comparison
"3nd" 4th column in descending order by numerical comparison
"1" Second column in ascending order by string comparison

exception

None

Example of use

var csvdoc = new CSVDocument;
csvdoc << Form1.Spread1.row;
csvdoc.Sort("0d", "3nd", "1");
Form1.Spread1.row << csvdoc;

Related item


CSVDocument.Truncate method

Explanation

Delete multiple lines at once. The column is maintained.

Call format

csvdoc.Truncate([ row ])

Return value

None

argument

integer row

Line number starting with 0 on the line to start deleting

The rows after the row specified by row are deleted. If omitted, all rows are deleted.

exception

CSV-13

Line position is incorrect

Example of use

var csvdoc = new CSVDocument;
var res = session.Get("/test/sample.csv");
csvdoc.Load(res);
csvdoc.Truncate(5);

Related item

Clear method


CSVDocument event

API version 4

Event

iOS Android Windows

The following events are defined in the CSVDocument class.

Events defined in the CSVDocument class occur in the process of assigning CSV data to an array object by the [] << CSV constant operator or [] << CSVDocument operator.

Events defined in the CSVDocument class occur regardless of the type of object to which they are assigned. Since they are not defined by the object to which they are assigned, these events are displayed in the event view of Biz/Designer. It is not. Write the event handler that handles the event of CSVDocument class directly in the script editor.

API | name | Explanation
4 | LoadBreak | Occurs when all CSV data assignments are complete

Class overview

Base class event


CSVDocument.LoadBreak event

Occurs for the object to which it is assigned when the CSV data for the array object has finished loading.


CSVDocument operator

API version 4

operator

iOS Android Windows

The CSVDocument class defines the following operators that support CSV constants and arrays.

API | operator | Explanation
4 | [] << CSV constant | Load the CSV constant on the right side into the array object on the left side
4 | [] << CSVDocument | Load the data of CSVDocument on the right side into the array object on the left side
4 | CSVDocument << CSVDocument | Load the data of the CSVDocument object on the right side into the CSVDocument object on the left side
4 | CSVDocument << [] | Load the data of the array object on the right side into the CSVDocument object on the left side
4 | CSVDocument << CSV constant | Load the CSV constant on the right side into the CSVDocument object on the left side

Class overview


[] << CSV constant operator

Loads the CSV constants on the right side of the array object on the left side . By using the Record array, ListItem, etc. on the left side, you can efficiently initialize the object using CSV data.

ListBox initialization example

ListBox ListBox1 {
    ListItem ListItem1[];
    ListItem1 << CSV(.Title, .Value) {
    1st Sales Department,10021
    2nd Sales Department,10022
    Manufacturing Control Department,20030
    };
}

Object structure that can load CSV data

The array object that can be specified on the left side must have the following structure.

type

Example

Explanation

One-dimensional array

String data[];

The number of elements in the array corresponds to the number of rows in the CSV data.

The number of columns is one, and the data itself corresponds to the column.

Two-dimensional equivalent array

Record rec[]{
    String data1;
    String data2;
}

The number of elements in the array corresponds to the number of rows in the CSV data.

The number of columns is the number of child objects, and data1 and data2 correspond to columns.

Row-wise behavior when loading CSV data

If the object on the left side does not explicitly define the number of elements in the array, the number of elements in the array will be the same as the number of rows in the CSV data regardless of the number of elements before assignment.

Record rec[]{
    Number SURYO;
    Number TANKA;
}
rec << CSV{
1,100
2,200
2,200
1,100
};

→

 | SURYO | TANKA
[0] | 1 | 100
[1] | 2 | 200
[2] | 2 | 200
[3] | 1 | 100

If the object on the left side is explicitly defined by the number of elements in the array, it will be treated as a fixed-length array in CSV data assignment. The number of elements in the array does not change regardless of the number of rows in the CSV data.

If there are more CSV data rows than there are elements, the CSV data rows that exceed the number of elements will be truncated. If the number of rows in the CSV data is small, the values ​​of subsequent array elements are unchanged and retain the values ​​before loading the CSV data.

Number of elements in the array <For CSV data rows

Record rec[4]{
    Number SURYO;
    Number TANKA;
}
rec << CSV{
1,100
2,200
2,200
1,100
3,300 ← truncated
4,400 ← truncated
};

→

 | SURYO | TANKA
[0] | 1 | 100
[1] | 2 | 200
[2] | 2 | 200
[3] | 1 | 100

Number of elements in array> Number of rows of CSV data

Record rec[6]{
    Number SURYO;
    Number TANKA;
}
    ::
rec << CSV{
1,100
2,200
2,200
1,100
};

→

 | SURYO | TANKA |
[0] | 1 | 100 |
[1] | 2 | 200 |
[2] | 2 | 200 |
[3] | 1 | 100 |
[4] | 6 | 600 | ← does not change
[5] | 7 | 700 | ← does not change

Even an array with an explicit number of elements may have different numbers of elements depending on the execution of the Insert method and Delete method. In this case, loading the CSV data will extend the array to the specified number of elements, but it may be expanded beyond the specified number of elements or deleted elements that already exceed the specified number of elements. There is none.

Record rec[4]{
    Number SURYO;
    Number TANKA;
}
rec[3].Delete();

rec << CSV{
1,100
2,200
2,200
1,100
3,300 ← truncated
};

→

 | SURYO | TANKA |
[0] | 1 | 100 |
[1] | 2 | 200 |
[2] | 2 | 200 |
[3] | 1 | 100 | ← Expanded

Record rec[4]{
    Number SURYO;
    Number TANKA;
}
rec.Insert();
    ::
rec << CSV{
1,100
2,200
2,200
1,100
};

→

 | SURYO | TANKA |
[0] | 1 | 100 |
[1] | 2 | 200 |
[2] | 2 | 200 |
[3] | 1 | 100 |
[4] | 6 | 600 | ← Not deleted

If CSV data is loaded with more elements than the number of elements already specified, CSV data will be assigned up to the current number of elements regardless of the number of specified elements.

Record rec[4]{
    Number SURYO;
    Number TANKA;
}
rec.Insert(2);

rec << CSV{
1,100
2,200
2,200
1,100
3,300
4,400
};

→

 | SURYO | TANKA
[0] | 1 | 100
[1] | 2 | 200
[2] | 2 | 200
[3] | 1 | 100
[4] | 3 | 300
[5] | 4 | 400

Column-wise behavior when loading CSV data

The CSV data columns are assigned in the order in which the objects to be assigned are defined.

If there are more objects to be assigned than the number of columns in the CSV data, the objects that exceed the number of columns in the CSV data will not change.

Also, if there are more columns in the CSV data, the columns that do not correspond to the assignment destination object will be truncated.

Record rec[4]{
    Number SURYO;
    Number TANKA;
    Number KINGAKU;
}
rec << CSV{
1,100,100
2,200,400
2,200,400
1,100,100
};

→

 | SURYO | TANKA | KINGAKU
[0] | 1 | 100 | 100
[1] | 2 | 200 | 400
[2] | 2 | 200 | 400
[3] | 1 | 100 | 100

Use column names as object names and property names

When loading CSV data with column names into an array object, the column name determines the object or property to which it is assigned. The order of the columns in the CSV data has no meaning.

The column name is set with the SetColumnName method or CSV constant .

Example to use as an object name

Record rec[]{
    String SURYO;
    String TANKA;
    String KINGAKU;
}
var csvdoc = new CSVDocument;
csvdoc << CSV{
100,1,100
200,2,400
300,3,900
};
csvdoc.SetColumnName(0, "TANKA");
csvdoc.SetColumnName(1, "SURYO");
csvdoc.SetColumnName(2, "KINGAKU");
rec << csvdoc;

→

 | SURYO | TANKA | KINGAKU
[0] | 1 | 100 | 100
[1] | 2 | 200 | 400
[2] | 3 | 300 | 900

In this example, the object name is specified for the column name. As a result, each column is assigned to an object with the same name.

If no object that matches the name of a column is found in the object tree to which it is assigned, the column is truncated and does not affect the result of the assignment.

Example to use as a property name

ListBox lbData{
    ListItem item[];
}
lbData.item << CSV(item.Title, item.Value) {
Choice1, value1
Option2, value2
Choice3, value3
};

→

 | item.Title | item.Value
[0] | Option 1 | Value 1
[1] | Option 2 | Value 2
[2] | Option 3 | Value 3

In this example, the column names are object names and property names. Separate the object name and property name with a period.

As a result, the first column is assigned to the Title property of the ListItem class and the second column is assigned to the Value property of the ListItem class.

Note
-Multiple periods cannot be used. Strings after the second period are ignored.
-If the object name is omitted (column name such as ".Title" or ".Value"), it is regarded as a property of the assignment destination object.
-If the name after the period matches the name of the child object, the default property of that child object is targeted.

Example of setting to the property of the child object of the assignment destination

Form Spread1{
    Form row[]{
        Label c1;
        Label c2;
        Label c3;
    }
    row << CSV(c1.Value, c2.Value, c3.Value) {
    100,1,100
    200,2,400
    300,3,900
    };
}

→

 | c1.Value | c2.Value | c3.Value
[0] | 100 | 1 | 100
[1] | 200 | 2 | 400
[2] | 300 | 3 | 900

In this example, the child object name and property name are specified. As a result, the first column is assigned to the value property of c1 (Label class), the second column is assigned to c2, and the third column is assigned to the Value property of c3.


[] << CSVDocument Operator

Loads the CSVDocument data on the right side of the array object on the left side.

The behavior when loading CSV data is the same as [] << CSV constant operator. See [] << CSV Constant Operator Description for more information.


CSVDocument << CSVDocument operator

Loads the data of the CSVDocument object on the right side against the CSVDocument object on the left side.


CSVDocument << [] Operator

Loads the data of the array object on the right side to the CSVDocument object on the left side.

The array object that can be specified on the right side must have the following structure.

type

Example

Explanation

One-dimensional array

String data[];

The number of elements in the array corresponds to the number of rows in the CSV data.

The number of columns is one, and the data itself corresponds to the column.

Two-dimensional equivalent array

Record rec[] {
    String data1;
    String data2;
}

The number of elements in the array corresponds to the number of rows in the CSV data.

The number of columns is the number of child objects, and data1 and data2 correspond to columns.


CSVDocument << CSV constant operator

Loads the CSV constants on the right side of the CSVDocument object on the left side .


CSV constant

The CSVDocument class defines CSV constants. CSV constants can be used to set data by the [] << CSV constant operator and CSVDocument << CSV constant operator.

Inside the CSV constant block, there is no grammatical relevance to the CRS script, so CRS grammar (such as enclosing strings in ""), constants (such as $RED), operators (such as + and-), and functions. Etc. cannot be used. You must follow the format as CSV.

The CSV format is as follows.

1. The number of columns must be constant. However, if the number of columns does not match other than the first row, it will be complemented so that the number of columns is the same as the first row.

2. Columns are separated by commas that are not escaped.

3. Lines are separated by unescaped line breaks.

4. If the data contains commas or line breaks, use "(double quotation marks) to enclose and escape the data.

5. If you want to include "(double quotation marks)" in the data enclosed in "(double quotation marks), describe two consecutive data like" ".

Example of use

var csvdata = new CSVDocument;
csvdata << CSV {
A, 1200,3000,100,C,XX1
A, 1200,3000,100,C,XX1
A, 1200,3000,100,C,XX1
    ::
};

You can write CSV data directly in the CRS script in the following format.

CSV {
Column1,Column2,Column3
Column1,Column2,Column3
Column1,Column2,Column3
Column1,Column2,Column3
    ::
};

CSV constants can be named for columns.

Named CSV constant

CSV(name1, name2, name3) {
Column1,Column2,Column3
Column1,Column2,Column3
Column1,Column2,Column3
Column1,Column2,Column3
    ::
};

The added column name can be obtained by the GetColumnName method and can be changed by the SetColumnName method.

In addition to simply using the column name as a name, it can represent an object name or property name. [] << When copying to an array with the CSV constant operator, explicitly specify the destination object or property. I can do it.


XML package

This is a package for handling XML format data.

The XML package is a subset of DOM (Document Object Model) Level 2 defined by the W3C (World Wide Web Consortium), excluding some functions.

SVG (Scalable Vector Graphics) operations are realized by manipulating the XML nodes that make up SVG with this XML package.

class

API | name | Explanation
4 | XmlAttr | Defines an Attr node
4 | XmlCDATASection | Defines a CDATASection node
4 | XmlCharacterData | Base class for nodes that store strings
4 | XmlComment | Defines a Comment node
4 | XmlDocument | Defines the root node (Document node) of the DOM tree
4 | XmlDocumentFragment | A class that maintains document fragments
4 | XmlDOMException | Defines a DOM exception
4 | XmlDOMImplementation | Defines the DOM implementation
4 | XmlElement | Defines an Element node
4 | XmlNamedNodeMap | Manage a set of nodes with a named map
4 | XmlNode | Base class for all nodes
4 | XmlNodeList | Manage a set of nodes with a node list
4 | XmlProcessingInstruction | Define a processing instruction node (ProcessingInstruction node)
4 | XmlText | Defines a Text node

The XML package conforms to the W3C DOM Level2 Core Specification, and each class consists of the following inheritance relationships.

Compatibility with W3C DOM Level 2

The XML package built into Biz/Browser is designed for use as a business data expression for displaying or printing XML on the screen. Therefore, of the specifications defined by DOM Level 2, functions that are not normally required for this purpose and specifications that significantly impair execution performance have been deleted. It also has useful features not defined in the W3C DOM, such as XML text loading and saving features and the SelectNodes method.

Support for W3C DOM Level 3

Supports some of the features of the Document Object Model (DOM) Level 3 Core Specification Version 1.0 W3C Working Draft 26 February 2003 published by the W3C.

Unsupported object

The following objects included in W3C DOM Level 2 are not supported by Biz/Browser and cannot be used.

DocumentType

Notation

Entity

EntityReference

DTD

Do not interpret the DTD. Therefore, it does not validate the structure when parsing XML text or when generating or modifying an XML DOM tree with the DOM API.

Also, the default value and access control defined by the DTD are invalid.

External reference resolution

External references are not resolved except for the SVG <image> element.

Character code

The characters contained in the DOM tree are converted to the UTF-8 character code and constructed in consideration of compatibility with CRS scripts. UTF-8 is the only encoding that can be saved with the XmlDocument.Save method.


XmlAttr class

Object
 | XmlNode
 |  | XmlAttr

A class that defines an Attr node. Because Attr nodes do not belong to the DOM tree, the XmlAttr class is derived from the XmlNode class, but the ParentNode , PreviousSibling , NextSibling, and other properties are null.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlAttr property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlAttr class.

API | name | access | Type | Explanation
4 | Name | R | String | Attr node attribute name
4 | OwnerElement | R | XmlElement | Element node to which Attr node belongs
4 | Specified | R | Boolean | Whether the value of the Attr node is explicitly set
4 | Value | RW | String | Attr node value

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


XmlAttr.Name property

Attr node attribute name.

This property is read-only and cannot be changed.


XmlAttr.OwnerElement property

The XmlElement object to which the Attr node belongs . It will be null if it does not belong to any Element node.

This property is read-only and cannot be changed.


XmlAttr.Specified property

$TRUE if the Attr node value is explicitly set, $FALSE otherwise. Biz/Browser does not support DTD, so the Specified property will always be $FALSE.

This property is read-only and cannot be changed.


XmlAttr.Value property

The value of the Attr node.

When setting the Value property, an XmlDOMException exception ( NO_MODIFICATION_ALLOWED_ERR ) may be thrown.


XmlAttr method

API version 4

Method

iOS Android Windows

There are no methods defined in the XmlAttr class.

Class overview

Base class methods


XmlAttr Event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlAttr class.

Class overview

Base class events


XmlCDATASection class

Object |  |  |  |
 | XmlNode
 |  | XmlCharacterData
 |  |  | XmlText
 |  |  |  | XmlCDATASection

Class that defines a CDATASection node. The XmlCDATASection class is derived from the XmlText class and inherits the properties and methods of the XmlText class.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlCDATASection Property

API version 4

Property

iOS Android Windows

There are no properties defined in the XmlCDATASection class.

Class overview

Base class properties


XmlCDATASection method

API version 4

Method

iOS Android Windows

There are no methods defined in the XmlCDATASection class.

Class overview

Base class methods


XmlCDATASection event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlCDATASection class.

Class overview

Base class events


XmlCharacterData class

Object
 | XmlNode
 |  | XmlCharacterData

Base class for nodes that store strings. It has the basic functionality of a node that stores a string.

The XmlCharacterData class is a virtual class and cannot instantiate itself.

The XmlCharacterData class is derived from the XmlNode class and the properties and methods of the XmlNode class are also available. Similarly, a class derived from the XmlCharacterData class can inherit the properties and methods defined in the XmlCharacterData class and the properties and methods defined in the XmlNode class and be used in the same way.

For classes that derive from XmlCharacterData,

XmlText

XmlComment

XmlCDATASection

there is.


XmlCharacterData property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlCharacterData class.

API | name | access | Type | Explanation
4 | Data | CRW | String | String data
4 | Length | R | integer | Length of character string data

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


XmlCharacterData.Data property

Character string data.

Accessing this property may throw an XmlDOMException exception ( NO_MODIFICATION_ALLOWED_ERR , DOMSTRING_SIZE_ERR).


XmlCharacterData.Length property

The length of the string data. It is counted in character units (1 byte character and 1 byte both 2 byte characters).

This property is read-only and cannot be changed.


XmlCharacterData method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlCharacterData class.

API | name | Explanation
4 | AppendData | Add a string
4 | DeleteData | Remove the string
4 | InsertData | Insert a string
4 | ReplaceData | Replaces a string
4 | SubstringData | Take out a part of the string

Class overview

Base class methods


XmlCharacterData.AppendData method

Explanation

Add a string.

Call format

cd.AppendData( text )

Return value

None

argument

String text

The string to add

exception

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var text = elm.FirstChild;
text.AppendData("abcdefg");

Related item

XmlText class


XmlCharacterData.DeleteData method

Explanation

Delete the string.

Call format

cd.DeleteData( offset , count )

Return value

None

argument

integer offset

Position to delete (specified by the number of characters)

integer count

Length to be deleted (specified in number of characters)

exception

DOM-1

INDEX_SIZE_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var text = elm.FirstChild;
text.DeleteData(10, 3);

Related item

XmlText class


XmlCharacterData.InsertData method

Explanation

Insert a string.

Call format

cd.InsertData( offset , text ).

Return value

None

argument

integer offset

Position to add (specified by the number of characters)

String text

The string to add

exception

DOM-1

INDEX_SIZE_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var text = elm.FirstChild;
text.InsertData(10, "abcdefg");

Related item

XmlText class


XmlCharacterData.ReplaceData method

Explanation

Replace the string.

Call format

cd.ReplaceData( offset , count , text )

Return value

None

argument

integer offset

Replacement position (specified by the number of characters)

integer count

Replacement length (specified in number of characters)

String text

New string

exception

DOM-1

INDEX_SIZE_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var text = elm.FirstChild;
text.ReplaceData(10, 3, "new text");

Related item

XmlText class


XmlCharacterData.SubstringData method

Explanation

Extract a part of a character string.

Call format

var s = cd.SubstringData( offset , count )

Return value

The retrieved string

argument

integer offset

Position to take out (specified by the number of characters)

integer count

Extraction length (specified by the number of characters)

exception

DOM-1

INDEX_SIZE_ERR

DOM-2

DOMSTRING_SIZE_ERR

Example of use

var text = elm.FirstChild;
var s = text.SubstringData(2, 10);

Related item

XmlText class


XmlCharacterData event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlCharacterData class.

Class overview

Base class events


XmlComment class

Object
 | XmlNode
 |  | XmlCharacterData
 |  |  | XmlComment

This class defines a Comment node. The XmlComment class is derived from the XmlCharacterData class and inherits the properties and methods of the XmlCharacterData class.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlComment property

API version 4

Property

iOS Android Windows

There are no properties defined in the XmlComment class.

Class overview

Base class properties


XmlComment method

API version 4

Method

iOS Android Windows

There are no methods defined in the XmlComment class.

Class overview

Base class methods


XmlComment event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlComment class.

Class overview

Base class events


XmlDocument class

Object
 | XmlNode
 |  | XmlDocument

This class defines the root node (Document node) of the DOM tree.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlDocument property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlDocument class.

API | name | access | Type | Explanation
4 | DocType | R | XmlDocumentType | DocumentType node
4 | DocumentElement | R | XmlElement | First Element node of document
4 | DocumentURI | CRW | String | URL from which CRS is obtained
4 | Implementation | R | XmlDOMImplementation | The XmlDOMImplementation object that created this Document node
4 | IndexAttributeName | CRW | String | The name of the ID attribute used by the GetElementById method

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


XmlDocument.DocType Property

DocumentType node. DocumentType is not supported by Biz/Browser. This property is always null.

This property is read-only and cannot be changed.


XmlDocument.DocumentElement property

The XmlElement object for the first Element node in the document .

This property is read-only and cannot be changed.


XmlDocument.DocumentURI property

Reference information.

The URL from which the CRS is obtained is set when the XmlDocument object is constructed.


XmlDocument.Implementation Property

The XmlDOMImplementation object that created this Document node .

This property is read-only and cannot be changed.


XmlDocument.IndexAttributeName property

Sets the name of the ID attribute used by the GetElementById method.

If not set, the name of the ID attribute will be "ID".

For example, if you want the lowercase "id" to be the name of the ID attribute, set "id".


XmlDocument method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlDocument class.

API | name | Explanation
4 | CreateAttribute | Create an Attr node
4 | CreateAttributeNS | Create Attr node with namespace URI
4 | CreateCDATASection | Create a CDATASection node
4 | CreateComment | Create a Comment node
4 | CreateDocumentFragment | Create a DocumentFragment node
4 | CreateElement | Create an Element node
4 | CreateElementNS | Create an Element node by specifying the namespace URI
4 | CreateProsessingInstruction | Create a ProcessingInstruction node
4 | CreateTextNode | Create a Text node
4 | GetElementById | Find Element node by ID attribute
4 | GetElementsByTagName | Find Element node by tag name
4 | GetElementsByTagNameNS | Find Element node by namespace URI and tag name
4 | ImportNode | Import node
4 | Save | Save the XML in a Writer object

Class overview

Base class methods


XmlDocument.CreateAttribute method

Explanation

Create an Attr node.

Call format

var attr = xmldoc.CreateAttribute( name )

Return value

XmlAttr object

argument

String name

Attribute name

exception

DOM-5

INVALID_CHARACTER_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.CreateElement("rect");
var attr = xmldoc.CreateAttribute("x");
attr.Value = "10";
elm.SetAttributeNode(attr);

Related item

XmlAttr class

CreateAttributeNS method


XmlDocument.CreateAttributeNS method

Explanation

Create an Attr node given the namespace URI.

Call format

var attr = xmldoc.CreateAttributeNS( namespaceURI , qualifiedName )

Return value

XmlAttr object

argument

String namespaceURI

Namespace URI of the Attr node to create

String qualifiedName

Attribute name of Attr node to be created

exception

DOM-5

INVALID_CHARACTER_ERR

DOM-14

NAMESPACE_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.CreateElement("rect");
var attr = xmldoc.CreateAttributeNS("http://www.w3.org/2000/svg", "svg:x");
attr.Value = "10";
elm.SetAttributeNodeNS(attr);

Related item

XmlAttr class

CreateAttribute method


XmlDocument.CreateCDATASection method

Explanation

Create a CDATASection node.

Call format

var cd = xmldoc.CreateCDATASection( data )

Return value

XmlCDATASection object

argument

String data

Character string that is the initial value of the CDATASection node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var cd = xmldoc.CreateCDATASectione("ABC");
xmldoc.DocumentElement.AppendChild(cd);

Related item

XmlCDATASection class


XmlDocument.CreateComment method

Explanation

Create a Comment node.

Call format

var comment = xmldoc.CreateComment( data )

Return value

XmlComment object

argument

String data

Character string that becomes the initial value of Comment node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var comment = xmldoc.CreateComment("ABC");
xmldoc.DocumentElement.AppendChild(comment);

Related item

XmlComment class


XmlDocument.CreateDocumentFragment method

Explanation

Create a DocumentFragment node.

Call format

var df = xmldoc.CreateDocumentFragment()

Return value

XmlDocumentFragment object

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domImpl.Load(res);
var df = xmldoc.CreateDocumentFragment();

Related item

XmlDocumentFragment class


XmlDocument.CreateElement method

Explanation

Create an Element node.

Call format

var elm = xmldoc.CreateElement( tagName )

Return value

XmlElement object

argument

String tagName

Tag name of the Element node to be created

exception

DOM-5

INVALID_CHARACTER_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.CreateElement("TAG1");

Related item

XmlElement class

CreateElementNS method


XmlDocument.CreateElementNS method

Explanation

Generate an Element node by specifying the namespace URI.

Call format

var elm = xmldoc.CreateElementNS( namespaceURI , qualifiedName )

Return value

XmlElement object

argument

String namespaceURI

Namespace URI of the Element node to create

String qualifiedName

Tag name of the Element node to be created

exception

DOM-5

INVALID_CHARACTER_ERR

DOM-14

NAMESPACE_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.CreateElementNS("http://www.w3.org/2000/svg", "svg:rect");

Related item

XmlElement class

CreateElement method


XmlDocument.CreateProcessingInstruction method

Explanation

Create a ProcessingInstruction node.

Call format

var pi = xmldoc.CreateProcessingInstruction( target , data )

Return value

XmlProcessingInstruction object

argument

String target

Target part of processing instruction

String data

Data part of processing instruction

exception

DOM-5

INVALID_CHARACTER_ERR

DOM-9

NOT_SUPPORTED_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var pi = xmldoc.CreateProcessingInstruction("xml", "version=\"1.0\"");
xmldoc.AppendChild(pi);

Related item

XmlProcessingInstruction class


XmlDocument.CreateTextNode method

Explanation

Create a Text node.

Call format

var text = xmldoc.CreateTextNode( data )

Return value

XmlText object

argument

String data

Text string that is the initial value of the Text node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var text = xmldoc.CreateTextNode("ABC");
xmldoc.DocumentElement.AppendChild(text);

Related item

XmlText class


XmlDocument.GetElementById method

Explanation

Find the Element node from the ID attribute.

The name of the ID attribute to be searched can be changed with the IndexAttributeName property.

When the IndexAttributeName property is not set, the attribute with the name "ID" (case sensitive) is searched as the ID attribute.

Call format

var elm = xmldoc.GetElementById( elementId )

Return value

An XmlElement object with the specified ID attribute

If not found, null is returned.

argument

String elementId

Value specified in the ID attribute to be searched

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
xmldoc.IndexAttributeName = "id";
var elm = xmldoc.GetElementById("1001");

Related item

XmlElement class

IndexAttributeName property

GetElementsByTagName , GetElementsByTagNameNS method


XmlDocument.GetElementsByTagName method

Explanation

Search the Element node by tag name and get a list of matching Element nodes.

Call format

var list = xmldoc.GetElementsByTagName( tagName ).

Return value

An XmlNodeList object that contains Element nodes with tag names that match the conditions

Returns an empty XmlNodeList object if not found.

argument

String tagName

Tag name to search

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.GetElementsByTagName("rect");

Related item

XmlNodeList , XmlElement classes

GetElementsByTagNameNS , GetElementById method


XmlDocument.GetElementsByTagNameNS method

Explanation

Search the Element node by namespace URI and tag name to get a list of matching Element nodes.

Call format

var list = xmldoc.GetElementsByTagNameNS( namespaceURI , qualifiedName )

Return value

An XmlNodeList object that contains the Element nodes that match the conditions

Returns an empty XmlNodeList object if not found.

argument

String namespaceURI

Namespace URI to search

String qualifiedName

Tag name to search

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.GetElementsByTagNameNS("http://www.w3.org/2000/svg", "rect");

Related item

XmlNodeList , XmlElement classes

GetElementsByTagName , GetElementById methods


XmlDocument.ImportNode method

Explanation

Import a node from another DOM tree.

Call format

var cnode = xmldoc.ImportNode( node , deep )

Return value

The imported XmlNode object

This node is not yet connected to the document tree and has no parent.

argument

XmlNode node

The node to import

boolean deep

$TRUE to import recursively, $FALSE otherwise

exception

DOM-9

NOT_SUPPORTED_ERR

Example of use

var orgnode = xmldocA.DocumentElement.FirstChild;
var copynode = xmldocB.ImportNode(orgnode, $TRUE);
xmldocB.DocumentElement.FirstChild.AppendChild(copynode);

Related item

XmlDocument , XmlNode class


XmlDocument.Save method

Explanation

Save the XML in a Writer object.

Call format

xmldoc.Save( writer [, encoding ])

Return value

None

argument

Object writer

Writer object of the save destination (object that can use WriteString method)

String encoding

Encoding method

Only "UTF-8" can be specified as the character string, and even if omitted, it will be "UTF-8".

exception

XML-4

No valid Write object specified

XML-5

Does not support WriteString (string) method

XML-18

encoding is not supported

XML-19

encoding failed

Example of use

var session = findHttpSession("http://host");
var req = session.CreateRequest("path");
xmldoc.Save(req);

Related item


XmlDocument event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlDocument class.

Class overview

Base class events


XmlDocument operator

API version 4

operator

iOS Android Windows

The following operators are defined in the XmlDocument class.

API | operator | Explanation
4 | XmlDocument << XML constant | Load XML constants into XmlDocument
4 | XmlDocument << XmlDocument | Copy XmlDocument to another XmlDocument

Class overview


XmlDocument << XML Constant Operator

This operator loads the XmlDocument object on the left side with the XML constants on the right side .

Example of use

var x = new XmlDocument();
x << xml <<-
<?xml version="1.0" encoding="SHIFT_JIS"?>
<data>
    <record title = "record 1">
        <item1>Item1</item1>
        <item2>Item1</item2>
        <item3>Item1</item3>
    </record>
</data>
->>;


XmlDocument << XmlDocument operator

This operator copies the XmlDocument on the right side to the XmlDocument object on the left side.

Example of use

var impl = new XmlDOMImplementation;
var res = GetHttpSession().Get("sample.xml");
var xml1 = impl.Load(res);

var xml2 = new XmlDocument();
xml2 << xml1;


XML constant

The XML package defines XML constants. XML constants can be used to populate the XmlDocument object with the << operator .

The XML constant block has no grammatical relationship with the CRS script, so the CRS grammar (such as enclosing a character string in ""), constants (such as $ RED), operators (such as + and-), and functions Cannot be used. Must be formatted as XML.

XML data can be directly described in the CRS script in the following format.

xml <<-
(XML data)
->>;

Example of use

var x = new XmlDocument ();
x << xml <<-
<? xml version = "1.0" encoding = "SHIFT_JIS"?>
<data>
    <record title = "record 1">
        <item1> Item 1 </ item1>
        <item2> Item 1 </ item2>
        <item3> Item 1 </ item3>
    </ record>
</ data>
->>;


XmlDocumentFragment class

Object
 | XmlNode
 |  | XmlDocumentFragment

A class that maintains document fragments.

Although the DOM tree is built under the Document node, it is efficient to temporarily build the tree at a place other than the Document node when the tree structure is changed significantly. The XmlDocumentFragment class can serve as the root element of the DOM tree in these cases instead of the XmlDocument class.

The XmlDocumentFragment class itself only functions as a placeholder and does not hold XML data like other nodes. Therefore, you cannot reference or set the data for the XmlDocumentFragment object.

The XmlDocumentFragment class inherits all properties and methods from the XmlNode class. Although the unique property and method are not defined, the property and method that refer to or operate the XML data are invalid for the above reasons.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlDocumentFragment property

API version 4

Property

iOS Android Windows

There are no properties defined in the XmlDocumentFragment class.

Class overview

Base class properties


XmlDocumentFragment method

API version 4

Method

iOS Android Windows

There are no methods defined in the XmlDocumentFragment class.

Class overview

Base class methods


XmlDocumentFragment event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlDocumentFragment class.

Class overview

Base class events


XmlDOMException class

Object
 | Exception
 |  | XmlDOMException

A class that defines a DOM exception.

Default property and ValueType

The default property is Message . The ValueType specification is invalid.


XmlDOMException property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlDOMException class.

API | name | access | Type | Explanation
4 | Code | R | integer | Exception type
4 | Message | R | String | Description that indicates the content of the exception
4 | Method | R | String | The function that caused the exception

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


XmlDOMException.Code property

The type of exception. It will be the following value.

constant | value | Explanation
XmlDOMException.INDEX_SIZE_ERR | 1 | Index or size is negative or greater than the allowed value
XmlDOMException.DOMSTRING_SIZE_ERR | 2 | If the specified range of text does not fit in the DOMString
XmlDOMException.HIERARCHY_REQUEST_ERR | 3 | If any node is inserted in a place that does not belong
XmlDOMException.WRONG_DOCUMENT_ERR | 4 | If the node is used in an unsupported document other than the one you created
XmlDOMException.INVALID_CHARACTER_ERR | 5 | When invalid or invalid characters are specified in the name etc.
XmlDOMException.NO_DATA_ALLOWED_ERR | 6 | If data is specified in a node that does not support data
XmlDOMException.NO_MODIFICATION_ALLOWED_ERR | 7 | If you try to modify an object in a place where modification is not allowed
XmlDOMException.NOT_FOUND_ERR | 8 | If you try to reference a node in a context that does not exist
XmlDOMException.NOT_SUPPORTED_ERR | 9 | If the implementation does not support the requested type of object or operation
XmlDOMException.INUSE_ATTRIBUTE_ERR | 10 | If you try to add an attribute that is already used elsewhere
XmlDOMException.INVALID_STATE_ERR | 11 | If you try to use an object that no longer exists or is unused
XmlDOMException.SYNTAX_ERR | 12 | When an invalid or invalid character string is specified
XmlDOMException.INVALID_MODIFICATION_ERR | 13 | If you try to change the type of the base object
XmlDOMException.NAMESPACE_ERR | 14 | Attempting to create or modify an object in a namespace-bad way
XmlDOMException.INVALID_ACCESS_ERR | 15 | If the parameter or operation is not supported by the base object

This property is read-only and cannot be changed.


XmlDOMException.Message property

A text description that describes the exception.

This property is read-only and cannot be changed.


XmlDOMException.Method property

iOSAndroidWindows

Identifies the function that caused the exception. It will always be "DOM".

This property is read-only and cannot be modified.


XmlDOMException method

API version 4

Method

iOS Android Windows

There are no methods defined in the XmlDOMException class.

Class overview

Base class methods


XmlDOMException event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlDOMException class.

Class overview

Base class events


XmlDOMImplementation class

Object
 | XmlDOMImplementation

A class that defines the DOM implementation.

It manages the generation of XmlDocument object which is the root node of DOM tree and the corresponding version of DOM API.

Default property and ValueType

The default property is Value . ValueType can be specified as String, Number or Date.


XmlDOMImplementation Property

API version 4

Property

iOS Android Windows

The following properties are defined for the XmlDOMImplementation class.

API | name | access | Type | Explanation
4 | Value | CRW | String Number Date | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


XmlDOMImplementation.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


XmlDOMImplementation method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlDOMImplementation class.

API | name | Explanation
4 | ( Constructor ) | Initializes an XmlDOMImplementation object
4 | CreateDocument | Creates a Document node
4 | CreateDocumentType | Generate DocumnetType node
4 | DecodeXML | Convert XML escaped string back to original string
4 | EncodeXML | XML escape the string
4 | HasFeature | Used to check the DOM compatible version
4 | Load | Read XML from Reader object
4 | Parse | Read XML string data

Class overview

Base class methods


XmlDOMImplementation Constructor

Explanation

Initializes the XmlDOMImplementation object.

Call format

var domimpl = new XmlDOMImplementation()

Return value

XmlDOMImplementation object

argument

integer enc

It remains for compatibility.

The specification will be ignored.

exception

None

Example of use

var domimpl = new XmlDOMImplementation();
var xmldoc = domimpl.CreateDocument(NULL, "data", NULL);

Related item

XmlDocument class

CreateDocument , Parse , Load methods


XmlDOMImplementation.CreateDocument method

Explanation

Create a Document node.

Call format

var xmldoc = domimpl.CreateDocument ( namespaceURI , qualifiedName , doctype )

Return value

XmlDocument object

argument

String namespaceURI

Namespace URI of the Document node to create

String qualifiedName

Tag name of the first Element node

XmlDocumentType doctype

Reserved for future expansion. Please specify null.

exception

DOM-5

INVALID_CHARACTER_ERR

DOM-14

NAMESPACE_ERR

DOM-4

WRONG_DOCUMENT_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var xmldoc = domimpl.CreateDocument("http://www.w3.org/2000/svg", "svg", null);

Related item

XmlDocument class

CreateDocumentType method


XmlDOMImplementation.CreateDocumentType method

Reserved for future expansion, cannot be called.


XmlDOMImplementation.DecodeXML method

Explanation

Converts the XML-escaped string back to the original string.

Call format

var s = domimpl.DecodeXML( str )

Return value

String without XML escape

argument

String str

XML escaped string

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var enc = domimpl.EncodeXML("a >= 1 && b <= 1 || c == \"abc\"");
print(enc, "\n");
var dec = domimpl.DecodeXML(enc);
print(dec, "\n");

Related item

EncodeXML method


XmlDOMImplementation.EncodeXML method

Explanation

XML escape the string.

Call format

var s = domimpl.EncodeXML( str )

Return value

XML escaped string

argument

String str

XML escaped string

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var enc = domimpl.EncodeXML("a >= 1 && b <= 1 || c == \"abc\"");
print(enc, "\n");
var dec = domimpl.DecodeXML(enc);
print(dec, "\n");

Related item

DecodeXML method


XmlDOMImplementation.HasFeature method

Explanation

Check if the feature specified by feature corresponds to the version specified by version.

Call format

var ret = domImpl.HasFeature ( feature , version )

Return value

$TRUE if the specified version is supported, $FALSE if it is not supported

argument

String feature

Ability to check version

Corresponds to "xml" and "dom".

String version

Corresponding version (specify in "1.0" format)

exception

None

Example of use

if(!domimpl.HasFeature("dom", "2.0")){
    print("DOM Level 2 not supported \n");
}

Related item

CreateDocument method


XmlDOMImplementation.Load method

Explanation

Reads XML from the Reader object.

It is used when loading an XML file from a WEB server or file.

Call format

var xmldoc = domimpl.Load( reader )

Return value

XmlDocument object

argument

Object reader

Reader object of the reading source (object that can use ReadLine method)

exception

XML-1

XML parsing error

XML-2

No valid Read object specified

XML-3

Does not support ReadLine() method

XML-13

Input XML is empty

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);

Related item

XmlDocument class

Parse method


XmlDOMImplementation.Parse method

Explanation

Reads XML string data.

Call format

var xmldoc = domimpl.Parse( xmltext )

Return value

XmlDocument object

argument

String xmltext

XML string data

exception

XML-1

XML parsing error

XML-13

Input XML is empty

Example of use

var src = "<?xml version=\"1.0\"…";
var domimpl = new XmlDOMImplementation;
var xmldoc = domimpl.Parse(src);

Related item

XmlDocument class

Load method


XmlDOMImplementation event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlDOMImplementation class.

Class overview

Base class events


XmlElement class

Object
 | XmlNode
 |  | XmlElement

A class that defines an Element node.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlElement property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlElement class.

API | name | access | Type | Explanation
4 | TagName | R | String | Element node tag name

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


XmlElement.TagName property

The tag name of the Element node.

This property is read-only and cannot be changed.


XmlElement method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlElement class.

API | name | Explanation
4 | GetAttribute | Gets the value of the Attr node with the specified attribute name
4 | GetAttributeNS | Gets the value of the Attr node with the specified namespace URI and attribute name
4 | GetAttributeNode | Get Attr node by specifying attribute name
4 | GetAttributeNodeNS | Get Attr node given namespace URI and attribute name
4 | GetElementsByTagName | Find Element node by tag name
4 | GetElementsByTagNameNS | Find Element node by namespace URI and tag name
4 | HasAttribute | Check whether there is an Attr node with the specified attribute name
4 | HasAttributeNS | Check if there is an Attr node with the specified namespace URI and attribute name
4 | RemoveAttribute | Delete Attr node by specifying attribute name
4 | RemoveAttributeNS | Delete Attr node given namespace URI and attribute name
4 | RemoveAttributeNode | Delete the Attr node by specifying the XmlAttr object
4 | SetAttribute | Set the Attr node value by specifying the attribute name
4 | SetAttributeNS | Set the Attr node value by specifying the namespace URI and the attribute name
4 | SetAttributeNode | Set an Attr node by specifying an XmlAttr object
4 | SetAttributeNodeNS | Set an Attr node by specifying an XmlAttr object

Class overview

Base class methods


XmlElement.GetAttribute method

Explanation

Gets the value of the Attr node with the specified attribute name.

Call format

var s = elm.GetAttribute( name )

Return value

Attr node value string

If no Attr node is found, returns an empty string.

argument

String name

Attribute name of Attr node whose value is to be retrieved

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var s = elm.GetAttribute("width");
print(s, "\n");

Related item

XmlAttr class

SetAttribute , RemoveAttribute , HasAttribute , GetAttributeNode , GetAttributeNS , GetAttributeNodeNS Methods


XmlElement.GetAttributeNS method

Explanation

Gets the value of the Attr node with the specified namespace URI and attribute name.

Call format

var s = elm.GetAttributeNS( namespaceURI , name )

Return value

Attr node value string

If no Attr node is found, returns an empty string.

argument

String namespaceURI

Namespace URI of the Attr node whose value you want to retrieve

String name

Attribute name of Attr node whose value is to be retrieved

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var s = elm.GetAttributeNS("http://www.w3.org/2000/svg", "width");
print(s, "\n");

Related item

XmlAttr class

SetAttributeNS , RemoveAttributeNS , HasAttributeNS , GetAttribute , GetAttributeNode , GetAttributeNodeNS Methods


XmlElement.GetAttributeNode method

Explanation

Get the Attr node by specifying the attribute name.

Call format

var attr = elm.GetAttributeNode( name )

Return value

XmlAttr object

Returns null if not found.

argument

String name

Attr node attribute name

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var attr = elm.GetAttributeNode("width");
print(attr.Value, "\n");

Related item

XmlAttr class

SetAttributeNode , RemoveAttributeNode , HasAttribute , GetAttribute , GetAttributeNS , GetAttributeNodeNS Methods


XmlElement.GetAttributeNodeNS method

Explanation

Get Attr node given namespace URI and attribute name.

Call format

var attr = elm.GetAttributeNodeNS( namespaceURI , name )

Return value

XmlAttr object

Returns null if not found.

argument

String namespaceURI

Attr node namespace URI

String name

Attr node attribute name

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var attr = elm.GetAttributeNodeNS("http://www.w3.org/2000/svg", "width");
print(attr.Value, "\n");

Related item

XmlAttr class

SetAttributeNodeNS , HasAttributeNS , GetAttribute , GetAttributeNode , GetAttributeNS Methods


XmlElement.GetElementsByTagName method

Explanation

Search the Element node by tag name and get a list of matching Element nodes.

Call format

var list = elm.GetElementsByTagName( tagName )

Return value

An XmlNodeList object that contains Element nodes with tag names that match the conditions

Returns an empty XmlNodeList object if not found.

argument

String tagName

Tag name to search

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var list = elm.GetElementsByTagName("rect");

Related item

XmlNodeList , XmlElement classes

GetElementsByTagNameNS method


XmlElement.GetElementsByTagNameNS method

Explanation

Search the Element node by namespace URI and tag name to get a list of matching Element nodes.

Call format

var list = elm.GetElementByTagNameNS( namespaceURI , tagName )

Return value

An XmlNodeList object that contains the Element nodes that match the conditions

Returns an empty XmlNodeList object if not found.

argument

String namespaceURI

Namespace URI to search

String tagName

Tag name to search

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var list = elm.GetElementByTagNameNS("http://www.w3.org/2000/svg", "rect");

Related item

XmlNodeList , XmlElement classes

GetElementsByTagName method


XmlElement.HasAttribute method

Explanation

Check whether there is an Attr node with the specified attribute name.

Call format

var ret = elm.HasAttribute( name )

Return value

$TRUE if Attr node exists, $FALSE if not

argument

String name

Attribute name

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var ret = elm.HasAttribute("style");

Related item

HasAttributeNS , GetAttribute , SetAttribute , RemoveAttribute , GetAttributeNode methods


XmlElement.HasAttributeNS method

Explanation

Checks if there is an Attr node with the specified namespace URI and attribute name.

Call format

var ret = elm.HasAttributeNS( namespaceURI , name )

Return value

$TRUE if Attr node exists, $FALSE if not

argument

String namespaceURI

Namespace URI

String name

Attribute name

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var ret = elm.HasAttributeNS("http://www.w3.org/2000/svg", "style");

Related item

HasAttribute , GetAttributeNS , SetAttributeNS , RemoveAttributeNS , GetAttributeNodeNS methods


XmlElement.RemoveAttribute method

Explanation

Delete the Attr node by specifying the attribute name.

Call format

elm.RemoveAttribute( name )

Return value

None

argument

String name

Attr node attribute name

exception

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
elm.RemoveAttribute("style");

Related item

XmlAttr class

GetAttribute , SetAttribute , HasAttribute , RemoveAttributeNode , RemoveAttributeNS methods


XmlElement.RemoveAttributeNS method

Explanation

Delete the Attr node given the namespace URI and attribute name.

Call format

elm.RemoveAttributeNS( namespaceURI , name )

Return value

None

argument

String namespaceURI

Attr node namespace URI

String name

Attr node attribute name

exception

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
elm.RemoveAttributeNS("http://www.w3.org/2000/svg", "style");

Related item

XmlAttr class

GetAttributeNS , SetAttributeNS , HasAttributeNS , RemoveAttribute , RemoveAttributeNode methods


XmlElement.RemoveAttributeNode method

Explanation

Delete the Attr node by specifying the XmlAttr object.

Call format

var attr2 = elm.RemoveAttributeNode( attr )

Return value

The deleted XmlAttr object

Returns null if not deleted.

argument

XmlAttr attr

The XmlAttr object to remove

exception

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-8

NOT_FOUND_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var attr = elm.GetAttributeNode("width");
elm.RemoveAttributeNode(attr);

Related item

XmlAttr class

GetAttributeNode , SetAttributeNode , RemoveAttribute , RemoveAttributeNS methods


XmlElement.SetAttribute method

Explanation

Set the Attr node value by specifying the attribute name.

Call format

elm.SetAttribute( name , value )

Return value

None

argument

String name

Attribute name of Attr node whose value is to be set

String value

Value to set

exception

DOM-5

INVALID_CHARACTER_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
elm.SetAttribute("width", "100");

Related item

XmlAttr class

GetAttribute , RemoveAttribute , HasAttribute , SetAttributeNode , SetAttributeNS , SetAttributeNodeNS Methods


XmlElement.SetAttributeNS method

Explanation

Set the Attr node value by specifying the namespace URI and the attribute name.

Call format

elm.SetAttributeNS( namespaceURI , name , value )

Return value

None

argument

String namespaceURI

Namespace URI of the Attr node whose value you want to set

String name

Attribute name of Attr node whose value is to be set

String value

Value to set

exception

DOM-5

INVALID_CHARACTER_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-14

NAMESPACE_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
elm.SetAttributeNS("http://www.w3.org/2000/svg", "width", "100");

Related item

XmlAttr class

GetAttributeNS , RemoveAttributeNS , HasAttributeNS , SetAttribute , SetAttributeNode , SetAttributeNodeNS Methods


XmlElement.SetAttributeNode method

Explanation

Set the Attr node by specifying an XmlAttr object.

If there is an Attr node with the same attribute name as the specified XmlAttr object, replace the Attr node.

Call format

var attr2 = elm.SetAttributeNode( attr )

Return value

The replaced XmlAttr object

Returns null if there was no replacement.

argument

XmlAttr attr

The XmlAttr object to set

You cannot specify an Attr node that is already set to another Element node.

exception

DOM-4

WRONG_DOCUMENT_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-10

INUSE_ATTRIBUTE_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var attr = elm.GetAttributeNode("width");
var attr2 = attr.CloneNode(true);
elm.SetAttributeNode(attr2);

Related item

XmlAttr class

GetAttributeNode , RemoveAttributeNode , SetAttribute , SetAttributeNS , SetAttributeNodeNS methods


XmlElement.SetAttributeNodeNS method

Explanation

Set the Attr node by specifying an XmlAttr object.

If there is an Attr node with the same namespace URI and attribute name as the specified XmlAttr object, replace the Attr node.

Call format

var attr2 = elm.SetAttributeNodeNS( attr )

Return value

The replaced XmlAttr object

Returns null if there was no replacement.

argument

XmlAttr attr

The XmlAttr object to set

You cannot specify an Attr node that is already set to another Element node.

exception

DOM-4

WRONG_DOCUMENT_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-10

INUSE_ATTRIBUTE_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var elm = xmldoc.DocumentElement;
var attr = elm.GetAttributeNodeNS("http://www.w3.org/2000/svg", "width");
var attr2 = attr.CloneNode($TRUE);
elm.SetAttributeNodeNS(attr2);

Related item

XmlAttr class

GetAttributeNodeNS , SetAttribute , SetAttributeNode , SetAttributeNS methods


XmlElement event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlElement class.

Class overview

Base class events


XmlNamedNodeMap class

Object
 | XmlNamedNodeMap

This class manages a set of nodes with a named map. The node map has multiple nodes inside, but only one node has the same name.

Default property and ValueType

There are no default properties. The ValueType specification is invalid.


XmlNamedNodeMap Property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlNamedNodeMap class.

API | name | access | Type | Explanation
4 | Length | R | integer | The number of nodes in the node map

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


XmlNamedNodeMap.Length property

Represents the number of nodes contained in the node map.

This property is read-only and cannot be changed.


XmlNamedNodeMap method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlNamedNodeMap class.

API | name | Explanation
4 | GetNamedItem | Retrieve a node by name
4 | GetNamedItemNS | Retrieves a node given its namespace URI and name
4 | Item | Retrieves a node by index
4 | NextNode | Fetch next node
4 | RemoveNamedItem | Remove a node by name
4 | RemoveNamedItemNS | Removes a node given its namespace URI and name
4 | Reset | Resets the fetch position of the NextNode method
4 | SetNamedItem | Set the node by specifying the XmlNode object
4 | SetNamedItemNS | Set the node by specifying the XmlNode object

Class overview

Base class methods


XmlNamedNodeMap.GetNamedItem method

Explanation

Retrieve a node by name.

Call format

var node = map.GetNamedItem( name )

Return value

XmlNode object

If no node is found, returns null.

argument

String name

The name of the node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
print(map.GetNameItem("width").NodeValue, "\n");

Related item

XmlNode class

SetNamedItem , RemoveNamedItem , GetNamedItemNS methods

[] Operator


XmlNamedNodeMap.GetNamedItemNS method

Explanation

Retrieves a node given its namespace URI and name.

Call format

var node = map.GetNamedItemNS( namespaceURI , localName )

Return value

XmlNode object

If no node is found, returns null.

argument

String namespaceURI

Namespace URI of node

String localName

The name of the node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
var attr = map.GetNamedItemNS("http://www.w3.org/2000/svg", "x");
print(attr.NodeValue, "\n");

Related item

XmlNode class

SetNamedItemNS , RemoveNamedItemNS , GetNamedItem methods


XmlNamedNodeMap.Item method

Explanation

Retrieves a node by index.

Call format

var node = map.Item( index )

Return value

XmlNode object

If the corresponding node is not found, such as specifying an index that is greater than or equal to the Length property, null is returned.

argument

integer index

Position of the node to extract (specify with an index starting from 0)

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
for(var n=0; n<map.Length; n++){
    print(map.Item(n).NodeName, "\n");
}

Related item

XmlNode class

Length property


XmlNamedNodeMap.NextNode method

Explanation

Fetch the next node.

Call format

var node = map.NextNode()

Return value

XmlNode object

Returns null if no more nodes are found.

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
while(var n = map.NextNode()){
    print(n.NodeName, "\n");
}

Related item

XmlNode class

Reset method


XmlNamedNodeMap.RemoveNamedItem method

Explanation

Delete the node by name.

Call format

var node = map.RemoveNamedItem( name )

Return value

The removed XmlNode object

If no node is found, returns null.

argument

String name

The name of the node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
map.RemoveNamedItem("width");

Related item

XmlNode class

GetNamedItem , SetNamedItem , RemoveNamedItemNS methods


XmlNamedNodeMap.RemoveNamedItemNS method

Explanation

Deletes the node given its namespace URI and name.

Call format

var node = map.RemoveNamedItemNS( namespaceURI , name )

Return value

The removed XmlNode object

If no node is found, returns null.

argument

String namespaceURI

Namespace URI of node

String name

The name of the node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
map.RemoveNamedItemNS("http://www.w3.org/2000/svg", "width");

Related item

XmlNode class

GetNamedItemNS , SetNamedItemNS , RemoveNamedItem methods


XmlNamedNodeMap.Reset method

Explanation

Resets the fetch position of the NextNode method.

Call format

map.Reset()

Return value

None

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
while(var n = map.NextNode()){
    print(n.NodeName, "\n");
}
map.Reset ();

Related item

NextNode method


XmlNamedNodeMap.SetNamedItem method

Explanation

Specify the XmlNode object to set the node.

If the node map already contains a node with the same name as the specified node, that node is replaced.

Call format

var node = map.SetNamedItem( newNode )

Return value

The replaced XmlNode object

Returns null if no replacement occurred.

argument

XmlNode newNode

Node to set

exception

DOM-4

WRONG_DOCUMENT_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-10

INUSE_ATTRIBUTE_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
var attr = xmldoc.CreateAttribute("width");
attr.Value = "10";
map.SetNamedItem(attr);

Related item

XmlNode class

GetNamedItem , RemoveNamedItem , SetNamedItemNS methods

[] Operator


XmlNamedNodeMap.SetNamedItemNS method

Explanation

Specify the XmlNode object to set the node.

If the node map already contains a node with the same namespace URI and name as the specified node, that node will be replaced.

Call format

var node = map.SetNamedItemNS( newNode )

Return value

The replaced XmlNode object

Returns null if no replacement occurred.

argument

XmlNode newNode

Node to set

exception

DOM-4

WRONG_DOCUMENT_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-10

INUSE_ATTRIBUTE_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
var attr = dom.CreateAttributeNS("http://www.w3.org/2000/svg", "width");
attr.Value = "10";
map.SetNamedItemNS(attr);

Related item

XmlNode class

GetNamedItemNS , RemoveNamedItemNS , SetNamedItem methods


XmlNamedNodeMap event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlNamedNodeMap class.

Class overview

Base class events


XmlNamedNodeMap operator

API version 4

operator

iOS Android Windows

The XmlNamedNodeMap class defines an operator to retrieve the nodes contained in the node map in array format (like map ["name"]) and an operator to iterate using a for in loop.

operator | Explanation
XmlNamedNodeMap [] | Retrieves nodes in array format
XmlNamedNodeMap Iterate | Take out nodes continuously

Class overview


XmlNamedNodeMap [] operator

Explanation

Get the nodes in array format.

Call format

map [ name ]

Return value

XmlNode object

If no node is found, returns null.

argument

String name

The name of the node to retrieve

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
print(map["width"].NodeName, "\n");
map["width"].NodeValue = "100";

Related item

XmlNode class

GetNamedItem , SetNamedItem method


XmlNamedNodeMap Iterate operator

Explanation

The nodes are taken out successively.

Unlike the normal operator, the Iterate operator is used to continuously access the data contained in the object inside the execution engine. Objects that have Iterates can perform the same operations as arrayed objects, such as for in loop and sum function.

Call format

You cannot call the Iterate operator directly.

Return value

Iterate object

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var map = xmldoc.DocumentElement.Attributes;
for(var n in map){
    print(map[n].NodeName, "\n");
}

Related item

XmlNode class


XmlNode class

Object
 | XmlNode

Base class for all nodes. It has the basic functionality of the nodes that make up the DOM tree.

The XmlNode class is a virtual class and cannot instantiate itself.

Classes derived from the XmlNode class can inherit the properties and methods defined in the XmlNode class and use them in the same way.

For classes that derive from XmlNode

XmlDocumentFragment

XmlDocument

XmlAttr

XmlElement

XmlCharacterData

XmlText

XmlCDATASection

XmlComment

XmlProcessingInstruction

there is.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlNode property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlNode class.

API | name | access | Type | Explanation
4 | Attributes | R | XmlNamedNodeMap | Attr node that belongs to the node
4 | ChildNodes | R | XmlNodeList | Child node
4 | FirstChild | R | XmlNode | First child node
4 | LastChild | R | XmlNode | Last child node
4 | LocalName | R | String | Local name of the node
4 | NamespaceURI | R | String | Namespace URI of node
4 | NextSibling | R | XmlNode | Next node
4 | NodeName | R | String | The name of the node
4 | NodeType | R | Intger | Node type
4 | NodeValue | CRW | String | The value of the node
4 | OwnerDocument | R | XmlDocument | Document node that is the top of the DOM tree to which the node belongs
4 | ParentNode | R | XmlNode | Parent node
4 | Prefix | CRW | String | Node namespace URI prefix
4 | PreviousSibling | R | XmlNode | Previous node
4 | Text | R | String | Text that aggregates child nodes
4 | Xml | R | String | XML text that represents the node

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


XmlNode.Attributes property

An XmlNamedNodeMap object that contains Attr nodes that belong to the node .

This property is read-only and cannot be changed.


XmlNode.ChildNodes Property

An XmlNodeList object that represents the child nodes . If it has no child nodes, it will be an empty XmlNodeList object.

This property is read-only and cannot be changed.


XmlNode.FirstChild property

The first child node. It will be null if it has no child nodes.

This property is read-only and cannot be changed.


XmlNode.LastChild property

The last child node. It will be null if it has no child nodes.

This property is read-only and cannot be changed.


XmlNode.LocalName property

The local name of the node.

This property is read-only and cannot be changed.


XmlNode.NamespaceURI property

The namespace URI of the node.

This property is read-only and cannot be changed.


XmlNode.NextSibling Property

The next node. It will be null if it has no next node.

This property is read-only and cannot be changed.


XmlNode.NodeName property

The name of the node.

This property is read-only and cannot be changed.


XmlNode.NodeType Property

The type of node. There are the following types.

constant | value | Explanation
XmlNode.ELEMENT_NODE | 1 | Element node
XmlNode.ATTRIBUTE_NODE | 2 | Attr node
XmlNode.TEXT_NODE | 3 | Text node
XmlNode.CDATA_SECTION_NODE | 4 | CDATASection node
XmlNode.ENTITY_REFERENCE_NODE | 5 | EntityReference node
XmlNode.ENTITY_NODE | 6 | Entity node
XmlNode.PROCESSING_INSTRUCTION_NODE | 7 | ProcessingInstruction node
XmlNode.COMMENT_NODE | 8 | Comment node
XmlNode.DOCUMENT_NODE | 9 | Document node
XmlNode.DOCUMENT_TYPE_NODE | 10 | DocumentType node
XmlNode.DOCUMENT_FRAGMENT_NODE | 11 | DocumentFragment node
XmlNode.NOTATION_NODE | 12 | Notation node

This property is read-only and cannot be changed.


XmlNode.NodeValue property

The value of the node.

The behavior of this property depends on the value of the NodeType property.

NodeType Property

Explanation

ATTRIBUTE_NODE

It will be a string that concatenates the values ​​of the child nodes that will be the values ​​of the attributes.

Changing this value will remove the child node once and create a single Text node with the value you want to set.

COMMENT_NODE

It becomes the character string which shows the contents. You can also set the value.

TEXT_NODE

CDATA_SECTION_NODE

PROCESSING_INSTRUCTION_NODE

DOCUMENT_NODE

It can be written and read, but it does not affect the DOM tree or XML document.

DOCUMENT_TYPE_NODE

DOCUMENT_FRAGMENT_NODE

ELEMENT_NODE

ENTITY_NODE

ENTITY_REFERENCE_NODE

NOTATION_NODE


XmlNode.OwnerDocument property

An XmlDocument object that is the top of the DOM tree to which the node belongs .

This property is read-only and cannot be changed.


XmlNode.ParentNode Property

The parent node. If the node has no parent, it will be null.

This property is read-only and cannot be changed.


XmlNode.Prefix property

The prefix for the namespace URI of the node.


XmlNode.PreviousSibling property

The previous node. It will be null if it has no previous node.

This property is read-only and cannot be changed.


XmlNode.Text Property

Text that aggregates child nodes.

This property is read-only and cannot be changed.


XmlNode.Xml property

XML text that represents the node.

This property is read-only and cannot be changed.


XmlNode method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlNode class.

API | name | Explanation
4 | AppendChild | Add child nodes to the end
4 | CloneNode | Make a duplicate of the node
4 | HasAttributes | Check for the presence of Attr nodes
4 | HasChildNodes | Check for child nodes
4 | InsertBefore | Add a node at the specified position
4 | IsSupported | Check feature implementation
4 | LookupNamespaceURI | Gets the namespace URI corresponding to the specified prefix
4 | LookupPrefix | Gets the prefix corresponding to the specified namespace URI
4 | Normalize | Normalizes the Text node
4 | RemoveChild | Detach a child node from the node tree
4 | ReplaceChild | Swap child nodes
4 | SelectNodes | Find node by XPath
4 | SelectSingleNode | Find a single node with XPath

Class overview

Base class methods


XmlNode.AppendChild method

Explanation

Add child nodes to the end.

Call format

var node2 = node.AppendChild( child )

Return value

The added XmlNode object

argument

XmlNode child

Node to add

exception

DOM-3

HIERARCHY_REQUEST_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-8

NOT_FOUND_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var parent = xmldoc.DocumentElement;
var child = xmldoc.CreateElement("C3");
parent.AppendChild(child);

Related item

InsertBefore , ReplaceChild , RemoveChild methods


XmlNode.CloneNode method

Explanation

Create a duplicate of the node.

This method is not available in the XmlDocument class.

Call format

var node2 = node.CloneNode( deep )

Return value

The cloned XmlNode object

argument

boolean deep

$TRUE to recursively copy child nodes of the node, $FALSE otherwise

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var parent = xmldoc.DocumentElement;
var list = parent.ChildNodes;
for(var n in list){
    var node = list.Item(n);
    if(node.NodeName == "C1"){
        var node2 = node1.CloneNode(true);
        parent.AppendChild(node2);
        break;
    }
}

Related item

XmlDocument class


XmlNode.HasAttributes method

Explanation

Check for the presence of Attr nodes.

Call format

var ret = node.HasAttributes()

Return value

$TRUE if the node has an Attr node, $FALSE otherwise

argument

None

exception

None

Example of use

if(node.HasAttributes()){
    return;
}

Related item

Attributes property


XmlNode.HasChildNodes method

Explanation

Check for the presence of child nodes.

Call format

var ret = node.HasChildNodes()

Return value

$TRUE if there are child nodes, $FALSE otherwise

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var parent = xmldoc.DocumentElement;
if(parent.HasChildNodes()){
    var list = parent.ChildNodes;
    for(var n in list){
        print(list.Item(n).NodeName, "\n");
    }
}

Related item

ChildNodes property


XmlNode.InsertBefore method

Explanation

Adds a node at the specified position.

Call format

Node2 = Node.InsertBefore ( NewChild , RefChild )

Return value

Added XmlNode object

argument

XmlNode newChild

Node to add

If newChild is an XmlDocumentFragment object, thenall child nodes of newChild are added in the same order. If newChild is attached to another tree, it will be added after it is detached from the tree.

XmlNode refChild

Child node indicating the position to add

If refChild is null, newChild is added last.

exception

DOM-3

HIERARCHY_REQUEST_ERR

DOM-4

WRONG_DOCUMENT_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-8

NOT_FOUND_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var parent = xmldoc.DocumentElement;
var list = parent.ChildNodes;
for(var n in list){
    var refChild = list.Item(n);
    if(refChild.NodeName == "C2"){
        var newChild = xmldoc.CreateElement("C1");
        parent.InsertBefore(newChild, refChild);
        break;
    }
}

Related item

XmlDocumentFragment class

ReplaceChild , RemoveChild , AppendChild methods


XmlNode.IsSupported method

Explanation

Check the implementation of the feature.

Call format

var ret = node.IsSupported( feature , version )

Return value

If the feature specified by feature is supported by the version specified by version, $TRUE; otherwise, $FALSE.

argument

String feature

Function to check

The function is specified by the following character string.

"Core"

"XML"

"HTML"

"Views"

"CSS"

String version

Version to check

The version is a string like this:

"1.0"

"2.0"

exception

None

Example of use

if(node.IsSupported("XML", "2.0")){
    return;
}

Related item


XmlNode.LookupNamespaceURI method

Explanation

Gets the namespace URI corresponding to the specified prefix.

Call format

var namespaceURI = node.LookupNamespaceURI( prefix )

Return value

The corresponding namespace URI

Returns null if not found.

argument

String prefix

Namespace URI prefix

exception

None

Example of use

var namespaceURI = node.LookupNamespaceURI("svg");

Related item

NamespaceURI , Prefix property

LookupPrefix method


XmlNode.LookupPrefix method

Explanation

Gets the prefix that corresponds to the namespace URI.

Call format

var prefix = node.LookupPrefix( namespaceURI )

Return value

Corresponding prefix

Returns null if not found.

argument

String namespaceURI

Namespace URI

exception

None

Example of use

var prefix = node.LookupPrefix("http://www.w3.org/2000/svg");

Related item

NamespaceURI , Prefix property

LookupNamespaceURI method


XmlNode.Normalize method

Explanation

Normalizes the Text node.

The empty Text node is deleted and adjacent Text nodes are concatenated into one Text node.

Call format

node.Normalize()

Return value

None

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var parent = xmldoc.DocumentElement;
parent.AppendChild(xmldoc.CreateTextNode("aaaaa\n"));
parent.AppendChild(xmldoc.CreateTextNode("bbbbb\n"));
parent.AppendChild(xmldoc.CreateTextNode("ccccc\n"));
parent.Normalize();
xmldoc.Save(file);

Related item

XmlText class


XmlNode.RemoveChild method

Explanation

Detaches the child node from the node tree.

Call format

var node2 = node.RemoveChild( child )

Return value

Detached XmlNode object

argument

XmlNode child

Node to detach

exception

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-8

NOT_FOUND_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var parent = xmldoc.DocumentElement;
var list = parent.ChildNodes;
for(var n in list){
    var child = list.Item(n);
    if (child.NodeName == "C2"){
        parent.RemoveChild(child);
        break;
    }
}

Related item

InsertBefore , ReplaceChild , AppendChild methods


XmlNode.ReplaceChild method

Explanation

Swap child nodes.

Call format

var node2 = node.ReplaceChild( newChild , oldChild )

Return value

The swapped XmlNode object

argument

XmlNode newChild

New node

If newChild is an XmlDocumentFragment object, thenall child nodes of newChild are added in the same order. If newChild is connected to another tree, it will be inserted after being detached from the tree.

XmlNode oldChild

Original child node

exception

DOM-3

HIERARCHY_REQUEST_ERR

DOM-4

WRONG_DOCUMENT_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

DOM-8

NOT_FOUND_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var parent = xmldoc.DocumentElement;
var list = parent.ChildNodes;
for(var n in list){
    var oldChild = list.Item(n);
    if(oldChild.NodeName == "C2"){
        var newChild = xmldoc.CreateElement("C1");
        parent.ReplaceChild(newChild, oldChild);
        break;
    }
}

Related item

XmlDocumentFragment class

InsertBefore , RemoveChild , AppendChild methods


XmlNode.SelectNodes method

Explanation

Finds nodes that match the criteria specified in XPath.

Call format

var list = node.SelectNodes( xpath )

Return value

An XmlNodeList object that contains all the nodes that match the conditions

argument

String xpath

Specify the search condition in XPath format.

The following elements can be specified in XPath.

/name | Select the first name element.
//name | Select the name element from the current child and descendant elements.
../name | Selects the element with name from the children of the current parent element.
name/* | Selects all child elements of the name element from the current child elements.
name@id | Select the id attribute of the name element from the current child elements.
name[.="data"] | Selects the name element with value data from the current child elements.
name[@id="data"] | Select the name element with the id attribute data from the current child elements.
name[2] | Select the third name element from the current child elements.

Added support for searching by specifying NodeType such as #text.

exception

None

Example of use

/*
SelectNodes("//CODE");
    Find the CODE element in the entire DOM tree.
SelectNodes("/DATA/USER_REC/USERNAME[.="Tanaka"]");
    In/DATA/USER_REC/USERNAME, search for the element whose value is tanaka.
SelectNodes("//CODE/USER_REC[0]");
    Find the CODE element in the entire DOM tree and select the beginning of its child USER_REC.
*/

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.DocumentElement.SelectNodes("//CODE");
for(var n in list){
    print(list.Item(n).NodeName, "\n");
}

Related item

XmlNodeList class

SelectSingleNode method


XmlNode.SelectSingleNode method

Explanation

Finds nodes that match the criteria specified in XPath.

Call format

var node2 = node.SelectSingleNode( xpath )

Return value

Of the nodes that match the search conditions, the first XmlNode object found

Returns null if no matching node is found.

argument

String xpath

Specify the search condition in XPath format.

The XPath format follows the SelectNodes method.

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var node = xmldoc.DocumentElement.SelectSingleNode("//CODE");
if(node! = null){
    print(node.NodeName, "\n");
}

Related item

SelectNodes method


XmlNode event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlNode class.

Class overview

Base class events


XmlNodeList class

Object
 | XmlNodeList

This class manages a set of nodes with a node list.

Default property and ValueType

There are no default properties. The ValueType specification is invalid.


XmlNodeList property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlNodeList class.

API | name | access | Type | Explanation
4 | Length | R | integer | The number of nodes in the node list

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


XmlNodeList.Length property

Represents the number of nodes in the node list.

This property is read-only and cannot be changed.


XmlNodeList method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlNodeList class.

API | name | Explanation
4 | Item | Retrieves a node by index
4 | NextNode | Fetch next node
4 | Reset | Resets the fetch position of the NextNode method

Class overview

Base class methods


XmlNodeList.Item method

Explanation

Retrieves a node by index.

Call format

var node = list.Item( index )

Return value

XmlNode object

If the corresponding node is not found, such as specifying an index that is greater than or equal to the Length property, null is returned.

argument

integer index

Position of the node to extract (specify with an index starting from 0)

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.DocumentElement.ChildNodes;
for (var n=0; n<list.Length; n++) {
    print(list.Item(n) .NodeName, "\n");
}

Related item

XmlNode class

Length property

[] Operator


XmlNodeList.NextNode method

Explanation

Fetch the next node.

Call format

var node = list.NextNode()

Return value

XmlNode object

Returns null if no more nodes are found.

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.DocumentElement.ChildNodes;
while(var n = list.NextNode()){
    print(n.NodeName, "\n");
}

Related item

XmlNode class

Reset method


XmlNodeList.Reset method

Explanation

Resets the fetch position of the NextNode method.

Call format

list.Reset()

Return value

None

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.DocumentElement.ChildNodes;
while(var n = list.NextNode()){
    print(n.NodeName, "\n");
}
list.Reset();

Related item

NextNode method


XmlNodeList event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlNodeList class.

Class overview

Base class events


XmlNodeList operator

API version 4

operator

iOS Android Windows

The XmlNodeList class defines an operator for fetching the nodes contained in the node list in array format (like list [n]) and an operator for iterating with a for in loop.

operator | Explanation
XmlNodeList [] | Retrieves nodes in array format
XmlNodeList Iterate | Take out nodes continuously

Class overview


XmlNodeList [] operator

Explanation

Get the nodes in array format.

Call format

list [ index ]

Return value

XmlNode object

Returns null if index is not in the valid range.

argument

Integer index

The position to retrieve the node

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.DocumentElement.ChildNodes;
for (var n=0; n<list.Length; n++){
    print(list[n] .NodeName, "\n");
}

Related item

XmlNode class

Item method


XmlNodeList Iterate operator

Explanation

The nodes are taken out successively.

Unlike the normal operator, the Iterate operator is used to continuously access the data contained in the object inside the execution engine. An object of a class that has Iterate can perform the same operation as an arrayed object by using a for in loop or sum function.

Call format

You cannot call the Iterate operator directly.

Return value

Iterate object

argument

None

exception

None

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var list = xmldoc.DocumentElement.ChildNodes;
for(var n in list){
    print(nodeList[n] .nodeName, "\n");
}

Related item

XmlNode class


XmlProcessingInstruction class

Object
 | XmlNode
 |  | XmlProcessingInstruction

This class defines a processing instruction node (ProcessingInstruction node).

The XML prologue (the part of <? Xml version = "1.0"?>) Is also a processing instruction in XML syntax, but since it is specially processed, the corresponding ProcessingInstruction node is not generated. If you refer to the XML source with the XmlNode.Xml property, which is a Biz/Browser-specific specification , the prologue will be added automatically. Therefore, when outputting XML to a file etc., it is not necessary to add a ProcessingInstruction node for prologue.

If you want to include your own processing instructions as part of the DOM tree, create an XmlProcessingInstruction object with the XmlDocument.CreateProcessingInstruction method and connect to the DOM tree with methods such as XmlNode.AppendChild , XmlNode.InsertBefore , XmlNode.ReplaceChild .

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlProcessingInstruction Property

API version 4

Property

iOS Android Windows

The following properties are defined in the XmlProcessingInstruction class.

API | name | access | Type | Explanation
4 | Data | CRW | String | Data part of processing instruction
4 | Target | R | String | Target part of processing instruction

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


XmlProcessingInstruction.Data property

This is the data part of the processing instruction.


XmlProcessingInstruction.Target property

The target part of the processing instruction.

This property is read-only and cannot be changed.


XmlProcessingInstruction method

API version 4

Method

iOS Android Windows

There are no methods defined in the XmlProcessingInstruction class.

Class overview

Base class methods


XmlProcessingInstruction Event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlProcessingInstruction class.

Class overview

Base class events


XmlText class

Object
 | XmlNode
 |  | XmlCharacterData
 |  |  | XmlText

A class that defines a Text node. The XmlText class is derived from the XmlCharacterData class and inherits the properties and methods of the XmlCharacterData class.

Default property and ValueType

The default property is NodeName . The ValueType specification is invalid.


XmlText property

API version 4

Property

iOS Android Windows

There are no properties defined in the XmlText class.

Class overview

Base class properties


XmlText method

API version 4

Method

iOS Android Windows

The following methods are defined in the XmlText class.

API | name | Explanation
4 | SplitText | Split the Text node into two Text nodes

Class overview

Base class methods


XmlText.SplitText method

Explanation

Splits the Text node into two Text nodes at the specified position.

Call format

var text2 = text.SplitText( offset ).

Return value

An XmlText object containing the split second half text

argument

integer offset

Split position (specified by the number of characters)

exception

DOM-1

INDEX_SIZE_ERR

DOM-7

NO_MODIFICATION_ALLOWED_ERR

Example of use

var domimpl = new XmlDOMImplementation;
var res = session.Get("/test/sample.xml");
var xmldoc = domimpl.Load(res);
var text1 = xmldoc.DocumentElement.FirstChild;
var text2 = text1.SplitText(20);
print(text1.Data, "\n");
print(text2.Data, "\n");

Related item


XmlText event

API version 4

Event

iOS Android Windows

There are no events defined in the XmlText class.

Class overview

Base class events


DB package

It is a package for operating the database.

class

API | name | Explanation
9 | LocalDB | A class that operates a lightweight database (SQLite)
9 | LocalDBStatement | It is a class that operates queries of lightweight database (SQLite)


LocalDB class

Object
 | LocalDB

It is a class that is the main body of the local DB and provides the function to operate the SQLite3 database.
Data types, type conversion rules, syntax, and other concepts follow SQLite3.

Specify the mode when opening, and if the file does not exist when it is writable, it will be automatically created.
Throws an exception if the file cannot be opened because it cannot be created, is locked, etc.
Please be sure to close the LocalDB object by calling the close method after use, as it may cause problems such as changes to the database not being reflected.

By default, the database operates with autocommit mode turned on. That is, database modification operations are immediately reflected and persisted. This operation cannot be rolled back.
If you want to make a transaction, use the begin, commit and rollback methods.
If LocalDB object is deleted during the transaction, it will be rolled back automatically if it is uncommitted.

About data types

Values ​​of each CRS type are converted appropriately depending on the database type.
The SQLite3 database type and the CRS type are related and converted as shown below.

CRS type | SQLite type
integer | INT
String | TEXT
Number | REAL
null | NULL
ByteArray | BLOB

Since SQLite3 does not have a database type corresponding to the datetime type, date and time must be converted according to either type.
Generally, the following method is selected and the date or time type is expressed in the database.

  • Express as a character string in ISO8601 format (Example: 2014-10-10T13: 50: 40 + 09: 00)
  • Expressed as a UNIX timestamp type integer
  • Floating point representation of Julian daylight day, starting from November 24, 4714 BC in the Gregorian calendar, with 1.0 as one day

In addition to the types available in the database, SQLite3 allows you to specify the types available in other database management systems. In that case, the specified type is used by replacing it with one of SQLite3 types.
For example, if you specify varchar (255) as the type, TEXT type is assumed to be specified.
In that case, you can specify more than 256 characters for a column of that type.

When Date object is directly specified in LocalDBStatement.bind method, it is treated as Date object converted into a character string in CRS.
Please note that this string is not in ISO 8601 format.

Notes

SQLite can store data of a type different from the column type by its nature. Therefore, be aware that the data retrieved from a column of a certain type is not always the value of that type.

About database file encryption

The LocalDB class can open and manipulate encrypted database files and create new ones.
This allows you to access the database more securely and prevent data tampering and eavesdropping.
Note that it is not possible to cancel the encryption or, on the contrary, newly encrypt an unencrypted database file.

To open an encrypted database file or create a new one, specify the encryption key in the constructor argument.
In the following case, the encrypted database file will be opened with the encryption key "1234". If the database file does not exist, create a new database file.

var db = new LocalDB(new FileSystem(), "testdb.sqlite", LocalDB.OPEN_READWRITE, "1234");

Notes

The database file is compatible with Biz/Browser HT, Biz/Browser SmartDevice (iOS, Android, Windows) as well as various software that supports SQLite3 and can be opened mutually.
However, please note that encrypted database files will not be compatible and cannot be opened with software other than those that support wxSQLite (AES-128) version encryption.

Typical usage

Several reference methods of each data are prepared, and an operator to acquire all records in CSV format by using LocalDBStatement class is also prepared.
As a result, if all the records are acquired under the specified conditions and the data can be displayed in a table format, it can be acquired with a very simple operation.
It can be described simply if no special control is required.

var st = db.createStatement("select * from testtable");
var records = new CSVDocument();
^ .FlexView1 << records << st; /* FlexView ← CSVDocument ← All data */


LocalDB Property

API version 9

Property

iOS Android Windows

The following properties are defined in the LocalDB class.

API | name | access | Type | Explanation
9 | FileName | R | String | file name

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


LocalDB.FileName property

Indicates the file name for database connection.

The file name specified in the constructor is copied to this property .


LocalDB method

API version 9

Method

iOS Android Windows

The following methods are defined in the LocalDB class.

API | name | Explanation
9 | ( Constructor ) | Initializes the LocalDB object
9 | Begin | Start a transaction
9 | Close | Closes the connection to the database
9 | Commit | Commit
9 | CreateStatement | Create a statement for query execution
9 | Exec | Run the query
9 | IsTableExists | Checks if the table exists
9 | Rollback | Roll back

Class overview

Base class methods


LocalDB constructor

Explanation

Initialize LocalDB.

Open the database file and initialize the object. Attempts to create the database file if it does not exist.

Call format

var db = new LocalDB ( filesystem , filename [, mode [, key ]])

Return value

LocalDB object

argument

FileSystem filesystem

a FileSystem object that is the basis of the path resolved by filename

String filename

Database file name to open

integer mode

The
values ​​that can be specified for the connection mode are as follows.

constant | value | Explanation
LocalDB.OPEN_READ | 0 | Read only
LocalDB.OPEN_READWRITE | 1 | Create database file if read / write (default) file does not exist

String key

It is
used to read and write the key of an encrypted SQLite database file and is also used as the key when creating the database.

exception

DB-1

An error occurred during database operation

DB-2

Cannot open database file

DB-3

Too few constructor arguments

CRS-16

Invalid argument

Example of use

var db = new LocalDB (new FileSystem (), "testdb.sqlite", LocalDB.OPEN_READWRITE, "1234");

Related item


LocalDB.Begin method

Explanation

Start a transaction.

Auto-commit is turned off during the transaction and the changes are not persisted until the commit method is called.
This operation is equivalent to submitting the following query.

begin

Call format

db.begin()

Return value

None

argument

None

exception

DB-1

An error occurred during database operation

DB-4

Database is not open

DB-5

Cannot be executed during a transaction

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
try{
    db.begin();
    db.exec("create table test (id integer primary key, value text)");
    db.exec("insert into test values ​(0, 'tanaka')");
    db.exec("insert into test values ​(1, 'yamada')");
    db.exec("insert into test values ​(2, 'suzuki')");
    db.commit();
}catch(e){
    db.rollback();
    //.MessageBox("Database error: "+ Str(e.message));
}
db.close();

Related item

Commit method

Rollback method


LocalDB.Close method

Explanation

Explicitly closes the connection to this database.

Anything that is uncommitted during the transaction is rolled back.
If you close it, you can no longer perform database operations on LocalDB.
Normally, this method should be called when you are finished using the LocalDB object.

Call format

db.Close()

Return value

None

argument

None

exception

DB-4

Database is not open

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
/* Various operations */
db.close();

Related item


LocalDB.Commit method

Explanation

Commit the change operation to the database.

It also ends the transaction.
This operation is equivalent to submitting the following query.

commit

Call format

db.Commit()

Return value

None

argument

None

exception

DB-1

An error occurred during database operation

DB-4

Database is not open

DB-6

Not in a transaction

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
try{
    db.begin();
    db.exec("create table test (id integer primary key, value text)");
    db.exec("insert into test values ​(0, 'tanaka')");
    db.exec("insert into test values ​(1, 'yamada')");
    db.exec("insert into test values ​(2, 'suzuki')");
    db.commit();
}catch(e){
    db.rollback();
    //.MessageBox("Database error: "+ Str(e.message));
}
db.close();

Related item

Begin method

Rollback method


LocalDB.CreateStatement method

Explanation

Create a statement.

Compared with the Exec method, you can get the execution result of the query such as select statement and perform advanced control.
You can specify a bind variable in the query string of the argument with the symbol "?".
You can set the value of the bind variable by using the bind method of the created LocalDBStatement object.

Call format

var st = db.CreateStatement( query )

Return value

LocalDBStatement object

argument

String query

Query string (bind variables can be used)

exception

DB-1

An error occurred during database operation

DB-4

Database is not open

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
var st = db.createStatement("select * from test where id <?");
st.bind(0, 42);

Related item

Exec method


LocalDB.Exec method

Explanation

Run the query.
This method should be used when it is sufficient to simply execute the query.
It is suitable for insert statements and update statements, but not for select statements.

For more advanced operations, execute the CreateStatement method to work with the statement.

Call format

var result = db.Exec( query )

Return value

Number of record rows changed as a result of execution

argument

String query

Query string

exception

DB-1

An error occurred during database operation

DB-4

Database is not open

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
try{
    db.begin();
    db.exec("create table test (id integer primary key, value text)");
    db.exec("insert into test values ​(0, 'tanaka')");
    db.exec("insert into test values ​(1, 'yamada')");
    db.exec("insert into test values ​(2, 'suzuki')");
    db.commit();
}catch(e){
    db.rollback();
    //.MessageBox("Database error: "+ Str(e.message));
}
db.close();

Related item

CreateStatement method


LocalDB.IsTableExists method

Explanation

Check if the table exists.

Call format

var res = db.IsTableExists( name )

Return value

Returns true if it exists, false otherwise.

argument

String name

table name

exception

DB-1

An error occurred during database operation

DB-4

Database is not open

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
if(db.isTableExists("test")){
    /* Processing when there is a table */
}

Related item


LocalDB.Rollback method

Explanation

Rolls back modification operations to the database.

It also ends the transaction.
This operation is equivalent to submitting the following query.

rollback

Call format

db.Rollback()

Return value

None

argument

None

exception

DB-1

An error occurred during database operation

DB-4

Database is not open

DB-6

Not in a transaction

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
try{
    db.begin();
    db.exec("create table test (id integer primary key, value text)");
    db.exec("insert into test values ​(0, 'tanaka')");
    db.exec("insert into test values ​(1, 'yamada')");
    db.exec("insert into test values ​(2, 'suzuki')");
    db.commit();
}catch(e){
    db.rollback();
    //.MessageBox("Database error: "+ Str (e.message));
}
db.close();

Related item

Begin method

Commit method


LocalDB event

API version 9

Event

iOS Android Windows

There are no events defined in the LocalDB class.

Class overview

Base class event


LocalDBStatement class

Object
 | LocalDBStatement

It is a class that operates the query of local DB. You can use bind variable processing and escape processing.
You can also send a query to get the result data.

LocalDBStatement object is created by LocalDB.CreateStatement method.


LocalDBStatement property

API version 9

Property

iOS Android Windows

The following properties are defined in the LocalDBStatement class.

API | name | access | Type | Explanation
9 | Query | R | String | Query statement

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


LocalDBStatement.Query property

Get the query statement at initialization. The value set in the bind variable is not expanded.

This property is read only. It cannot be changed later.


LocalDBStatement method

API version 9

Method

iOS Android Windows

The following methods are defined in the LocalDBStatement class.

API | name | Explanation
9 | Bind | Set the value to the bind variable
9 | Exec | Executes the query set in the statement
9 | GetColumn | Gets the data in the specified column at the current cursor position
9 | GetColumns | Gets the number of columns in the query execution result
9 | GetRow | Gets the data of all columns at the current cursor position in a batch
9 | GetRows | Gets the number of rows of the query execution result
9 | Next | Execute the query and advance the cursor position one line
29 | ToArray | Outputs an associative array with the specified column value as key and value

Class overview

Base class methods


LocalDBStatement.Bind method

Explanation

Set the value in the bind variable.

Bind variables are represented by the "?" Symbol in the query statement, and correspond to indexes 0, 1, 2 ... in order from the beginning.
If you try to set a value for an index that exceeds the number of bind variables in the query statement, an exception will occur.
The value specified in the Bind method is automatically escaped.
The value to be set can specify any type and will be converted according to the database type. Please refer to LocalDB class for type conversion rules with CRS type .

Call format

var st = st.Bind( index , value )

Return value

It always returns a reference to its LocalDBStatement object.

argument

Integer index

Bind variable index

Object value

Value to set in bind variable

exception

DB-7

Value that cannot be specified in bind variable

DB-8

Invalid statement

DB-9

The parameter is out of the specifiable range

Example of use

st.bind(0,"hoge").bind(1,"huga").bind(2,"piyo");

Related item


LocalDBStatement.Exec method

Explanation

Executes the query set in the statement.
The value set in the bind variable is reflected.

Call format

var result = st.Exec ()

Return value

Number of record rows changed as a result of execution

argument

None

exception

DB-1

An error occurred during database operation

DB-8

Invalid statement

Example of use

var result = st.Exec ();

Related item


LocalDBStatement.GetColumn method

Explanation

Gets the specified column data at the current cursor position pointed to by the statement. It can be called only after executing the
next method.

* There is an exec method that is very similar to the next method, but it cannot be called after executing the exec method.

Call format

var data = st.GetColumn( index or name )

Return value

The data in the specified column

argument

Integer index

The column index

String name

Column name

exception

DB-1

An error occurred during database operation

DB-8

Invalid statement

DB-9

The parameter is out of the specifiable range

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
var st = db.createStatement("select * from test where value like?");
try{
    st.bind(0, "%Android%");
    while(st.next()){
        print(st.getColumn(0), ":", st.getColumn(1));
    }
}catch(e){
    //.MessageBox("Database operation failed. ");
    return;
}

Related item

Next method


LocalDBStatement.GetColumns method

Explanation

Gets the number of columns in the query execution result.
Returns the number of columns when there are rows even if the number of rows in the execution result is 0.

Call format

var num = st.GetColumns()

Return value

Returns the number of columns in the query execution result.

argument

None

exception

DB-1

An error occurred during database operation

DB-8

Invalid statement

Example of use

var num = st.getColumns();

Related item


LocalDBStatement.GetRow method

Explanation

Gets all the columns of the current cursor row as an Array object in a batch.

The data type of each retrieved column is determined based on the database type according to the type conversion rules. It can be called only after executing the
next method.

* There is an exec method that is very similar to the next method, but it cannot be called after executing the exec method.

Call format

var datas = st.GetRow()

Return value

Returns an associative array with all column data array element names for the current cursor row as column names and values ​​corresponding to the column data.

argument

None

exception

DB-1

An error occurred during database operation

DB-8

Invalid statement

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
var st = db.createStatement("select * from test where value like?");
try{
    st.bind(0, "%Android%");
    while(st.next()){
        var ar = st.getRow();
        print(ar["id"], ":", ar["value"]);
    }
}catch(e){
    //.MessageBox("Database operation failed. ");
    return;
}

Related item


LocalDBStatement.GetRows method

Explanation

Gets the number of rows that are the result of executing a query.

If the cursor position has been moved by the next method by that time, it will be returned to the beginning.
Also, after execution, the next cursor is returned to the initial state with the next method.

Call format

var num = st.GetRows()

Return value

Returns the number of rows that are the result of executing a query.

argument

None

exception

DB-1

An error occurred during database operation

DB-8

Invalid statement

Example of use

var num = st.getRows();

Related item


LocalDBStatement.Next method

Explanation

Executes the query and advances the cursor position one line.

Note that some other methods return the initial cursor position to the advanced state after execution.

Call format

var res = st.next()

Return value

Returns true if the next line exists, false otherwise.

argument

None

exception

DB-1

An error occurred during database operation

DB-8

Invalid statement

Example of use

var db = new LocalDB(new FileSystem(), "testdb.sqlite");
var st = db.createStatement("select * from test where value like?");
try{
    st.bind(0, "%Android%");
    while(st.next()){
        print(st.getColumn(0), ":", st.getColumn(1));
    }
}catch(e){
    //.MessageBox("Database operation failed. ");
    return;
}

Related item


LocalDBStatement.ToArray method

iOSAndroidWindows

Explanation

Outputs an associative array with the specified column value as key and value.

If the cursor position has been moved by the next method up to that point, return it to the beginning and execute it.

Also, after execution, the next cursor is returned to the initial state with the next method.

If there are duplicate values in the column specified by keyCol, the value of the row found later will be adopted.

Call format

var arr = st.ToArray( keyCol, valueCol )

Return value

Returns an associative array.

The relationship between query results and associative array structure is as follows.

Number of rows | columun a | columun b | columun c | ...
1 | value 1-a | value 1-b | value 1-c | ...
2 | value 2-a | value 2-b | value 2-c | ...
3 | value 3-a | value 3-b | value 3-c | ...
4 | value 3-a | value 4-b | value 4-c | ...
⋮ | ⋮ | ⋮ | ⋮ | ...

↓

The structure of the return value Array if you specify the column name of column a for keyCol and the column name of column b for valueCol in the ToArray method

arr[value 1-a]=value 1-b
arr[value 2-a]=value 2-b
arr[value 3-a]=value 4-b
⋮

In the above example, the values in the 3rd and 4th rows of column a are duplicates, so the value 4-b is adopted.

argument

string keyCol

Specifies the name of the column to be the subscript of the associative array.

If an empty string is specified, the line number starting from 0 becomes the subscript.

string valueCol

Specifies the name of the column to be the value of the associative array.

例外

DB-1

An error occurred during database operation

DB-8

Invalid statement

Example of use

var fs = new FileSystem();
var db = new LocalDB(fs, "sample.sqlite3");
try {
    db.begin();
    db.exec("create table test (id integer primary key, color text, value integer, nullablevalue)");
    var ret = db.exec("insert into test values (1, 'Red', 100, null)");
    ret = db.exec("insert into test values (2, 'Red', 110, null)");
    ret = db.exec("insert into test values (3, 'Blue', 200, null)");
    db.commit();

    var st = db.CreateStatement("select * from test");
    var arr = st.ToArray("id", "color");
} catch ( e ) {
    db.rollback();
    return;
}

Related item


LocalDBStatement event

API version 9

Event

iOS Android Windows

There are no events defined in the LocalDBStatement class.

Class overview

Base class event


LocalDBStatement operator

API version 9

operator

iOS Android Windows

The following operators are defined in the LocalDBStatement class.

API | operator | Explanation
29 | Array << LocalDBStatement | Output all data to Array
9 | CSVDocument << LocalDBStatement | Output all data to CSV Document

Class overview


Array << LocalDBStatement operator

iOSAndroidWindows

This operator outputs all the result data obtained by executing the query of LocalDBStatement to Array on the left side.

The existing data is deleted and replaced with the data in the CSVDocument object.

If the cursor position has been moved by the next method up to that point, return it to the beginning and execute it.
Also, after execution, the next cursor is returned to the initial state with the next method.

The relationship between the query result and the structure of the output Array is as follows:

query result

Number of rows | columun a | columun b | columun c | ...
1 | value 1-a | value 1-b | value 1-c | ...
2 | value 2-a | value 2-b | value 2-c | ...
3 | value 3-a | value 3-b | value 3-c | ...
⋮ | ⋮ | ⋮ | ⋮ | ...

↓

Array structure

/* Row No. 1 */
arr[0][Column name of a]=value 1-a
arr[0][Column name of b]=value 1-b
arr[0][Column name of c]=value 1-c
arr[0][Column name of d]=value 1-d
⋮
/* Row No. 2 */
arr[1][Column name of a]=value 2-a
arr[1][Column name of b]=value 2-b
arr[1][Column name of c]=value 2-c
arr[1][Column name of d]=value 2-d
⋮
/* Row No. 3 */
arr[2][Column name of a]=value 3-a
arr[2][Column name of b]=value 3-b
arr[2][Column name of c]=value 3-c
arr[2][Column name of d]=value 3-d
⋮

Example of use

var st = db.createStatement("select * from testtable");
var arr  = new Array();
arr << st;　　/* Array  ← All data */


CSVDocument << LocalDBStatement operator

This operator outputs all the result data obtained by executing the query of LocalDBStatement to CSVDocument on the left side.

The existing data is deleted and replaced with the data in the CSVDocument object.

If the cursor position has been moved by the next method up to that point, return it to the beginning and execute it.
Also, after execution, the next cursor is returned to the initial state with the next method.

All data retrieved from the database will be converted to strings.
Data that is not a string may differ slightly from the data obtained from getRow or getColumn converted to a string.

Example of use

var st = db.createStatement("select * from testtable");
var records = new CSVDocument();
^.FlexView1 << records << st; /* FlexView ← CSVDocument ← All data */


HTTP package

This is a package for communicating with a WEB server.

class

API | name | Explanation
4 | HttpAsyncSession | Manage background asynchronous communication sessions
4 | HttpRequest | Holds HTTP requests
4 | HttpResponse | Holds HTTP response
4 | HttpSession | Holds HTTP session information
20 | WebSocket | Performs bidirectional communication using WebSocket protocol


HttpAsyncSession class

Object
 | HttpAsyncSession

A class that manages background asynchronous communication.

This class can generate and manage multiple communications by ID, and communications are performed simultaneously and asynchronously in a thread separate from the CRS execution engine. After the communication is completed, the reception result will be notified together with the ID as an event.

As with the HttpSession class, simple communication using the Get and Post methods , as well as advanced communication using the HttpRequest class is possible.

Instances of this class must be retained at all times during communication. When the instance disappears, all communicating sessions are forcibly disconnected.

Default properties and ValueType

The default property is Sessions . The value type specification is invalid.


HttpAsyncSession property

API version 4

Property

iOS Android Windows

The following properties are defined in the HttpAsyncSession class.

API | name | access | Type | Explanation
4 | Sessions | R | Integer | Number of sessions held

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


HttpAsyncSession.Sessions property

Gets the number of sessions currently held by the HttpAsyncSession object. This number of sessions includes both active and inactive.

If you want to see only the active session , use the IsBusy method.

This property is read-only and cannot be changed.


HttpAsyncSession method

API version 4

Method

The following methods are defined in the HttpAsyncSession class.

API | name | Explanation
4 | Abort | Force termination of communication.
24 | AddCookie | Adds cookies from the client side
4 | CreateRequest | Create HttpRequest object
4 | Get | Initiate an asynchronous GET request
4 | IsBusy | Get whether communication is in progress or not.
4 | Post | Initiate an asynchronous POST request
24 | RemoveCookie | Remove cookies added with the AddCookie method

Class overview

Base class methods


HttpAsyncSession.Abort method

Explanation

Forcibly disconnect the communication session.

If no argument is given, all sessions will be disconnected.

Call format

session.Abort ( [ id ] )

Return value

None

argument

String id

Specify the session ID to disconnect.

exception

HTTP-101

There is no session with the specified ID

Example of use

httpAsyncSession session{
    Function OnSessionEnd(e){
        if(e.id == "Download1"){
            if(e.status == 0){
                //.MessageBox("disconnected", "ERROR", $OK);
            }
        }
    }
}
Button btnDownload {
    Function OnTouch(e){
        ^.session.Get("Download1", "/test/prog1?Code=1283&name=biz");
    }
}
Button btnAbort {
    Function OnTouch(e){
        ^.session.Abort("Download1");
    }
}

Related item


HttpAsyncSession.AddCookie method

iOSAndroidWindows

Explanation

Add cookies from the client side.

Cookies are added to the request header only when the URL specified in the CreateRequest method, Get method, etc. and the path specified in the AddCookie method match.

If path is omitted, cookies are added regardless of the URL.

If name and value match a cookie already added, update the added value.

Call format

session.AddCookie( name, value [, path])

Return value

None

argument

String name

Name of cookie

String value

Value of cookie

String path

URL to which cookies are added

If omitted, cookies are added regardless of the URL specified in the CreateRequest method, Get method, etc.

exception

HTTP-11

Wrong header information

Example of use

HttpAsyncSession session {
    Function OnSessionEnd(e) {
        if (e.id == "Download1") {
            if (e.status != $HTTP_OK) {
                //.MessageBox("Communication error:" + str(e.status), "ERROR", $OK);
            }
        }
    }
}
Button btnAddCookie {
    Function OnTouch(e) {
        ^.session.AddCookie("name1", "value1", "/sample.txt");
        ^.session.AddCookie("name2", "value2", "/sample2.txt");
        ^.session.AddCookie("name3", "value3");
    }
}
Button btnDownload {
    Function OnTouch(e) {
        /* name1, value1 whose URL specified in the Get method and path specified in the AddCookie method match */
        /* and name3, value3 whose path is omitted in the AddCookie method are added as cookies */
        ^.session.Get("Download1", "/sample1");
    }
}

Related item

RemoveCookie method


HttpAsyncSession.CreateRequest method

API version 4

HttpAsyncSession.CreateRequest method Change History

iOS Android Windows

Explanation

Create a new asynchronous request. After setting the properties such as a parameter of the request, the created request is sent to the server by Post or Get method.

The HttpRequest object can only communicate once. When performing multiple communications, create separate HttpRequest objects using the CreateRequest method for each.

The HttpAsyncSession and HttpRequest objects are closely related. Get and Post can only be performed on the HttpAsyncSession object when the HttpRequest object was created.

If you don't need the parameter of the request, it's more efficient to use the form of writing the URL directly in the Get method instead of using the CreateRequest method .

Call format

var req = session.CreateRequest ( id , URL [, enc] )

Return value

Returns a reference to the HttpRequest object.

argument

String id

Specify a unique session ID. If a request has already been made with the same ID or communication is taking place, an exception will be thrown.

String URL

URL to request. You can specify either an absolute path or a relative path.

The interpretation of the path follows the general rules of CRS.

integer enc

Specifies the encoding method of POST parameters when sending POST requests. *1

Specify a combination of the following values. If omitted, the value will be HttpAsyncSession.DEFAULT_ENCODE.

constant | value | Explanation
HttpAsyncSession.DEFAULT_ENCODE | 0 | Encode according to the Mobile compatibility mode specification
HttpAsyncSession.UTF8_ENCODE | 1 | Encode to UTF-8

exception

HTTP-100

The specified ID is already in use

HTTP-102

The ID is invalid

HTTP-103

Unable to create session

Example of use

httpAsyncSession session;
var req = session.CreateRequest("Download1", "http://biz-browser.jp/test/prog1.asp");
req.AddParam("code", "0452");
req.AddParam("name", "biz");
session.Post(req);

Related item

Get , Post method

HttpRequest , HttpResponse class

Change history
* 1 Added from API version 24.


HttpAsyncSession.Get method

Explanation

Initiates an asynchronous GET request to the specified destination server. The method terminates immediately after execution.

The execution result of the HTTP layer is confirmed by the status value returned in the SessionEnd event .

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

session.Get( id , URL )

Or

session.Get( req )

Return value

None

argument

String id

Specify a unique session ID. If a request has already been made with the same ID or communication is taking place, an exception will be thrown.

String URL

URL to request. You can specify either an absolute path or a relative path. The interpretation of the path follows the general rules of CRS.

HttpRequest req

Request An HttpRequest object that represents a request . Create with the CreateRequest method.

exception

HTTP-2

The specified httpRequest has a different connection destination

HTTP-4

The request object specified for GET or POST is invalid

HTTP-100

The specified ID is already in use

HTTP-102

The ID is invalid

HTTP-103

Unable to create session

HTTP-104

Failed to create communication thread

Example of use

HttpAsyncSession session {
    Function OnSessionEnd(e){
        if(e.id == "Download1"){
            if(e.status! = $HTTP_OK){
                //.MessageBox("Communication error:" + str(e.status), "ERROR", $OK);
            }
        }
    }
}
Button btnDownload {
    Function OnTouch(e){
        ^.session.Get("Download1", "/test/prog1?Code=1283&name=biz");
    }
}

Related item

CreateRequest method

SessionEnd event

HttpRequest class


HttpAsyncSession.IsBusy method

Explanation

Checks if the session is in communication.

If no argument is specified, it will be $TRUE if there is at least one session in communication.

If you specify a session ID that does not exist in this method, no exception is raised and $FALSE is returned.

Call format

var ret = session.IsBusy ([ id ])

Return value

Returns $TRUE if the session is in communication.

Otherwise, it returns $FALSE.

argument

String id

Specify the session ID you want to look up.

exception

None

Example of use

HttpAsyncSession session;

Button btnNext {
    Function OnTouch(e){
        if(^.session.IsBusy()){
            MessageBox("Downloading", "ERROR", $OK);
            return;
        }else{
            ^.Get("frmNext.crs");
        }
    }
}

Related item


HttpAsyncSession.Post method

Explanation

Initiates an asynchronous POST request to the specified destination server. The method terminates immediately after execution.

The parameter of the request to be included in the request is set with the HttpRequest.AddParam method.

The execution result of the HTTP layer is confirmed by the status value returned in the SessionEnd event .

Call format

session.Post ( req )

Return value

None

argument

HttpRequest req

Request An HttpRequest object that represents a request . Create with the CreateRequest method.

exception

HTTP-2

The specified httpRequest has a different connection destination

HTTP-4

The request object specified for GET or POST is invalid

HTTP-103

Unable to create session

HTTP-104

Failed to create communication thread

Example of use

HttpAsyncSession session{
    Function OnSessionEnd(e){
        if(e.id == "Download2"){
            if(e.status! = $HTTP_OK){
                //.MessageBox("Communication error:" + str(e.status), "ERROR", $OK);
            }
        }
    }
}
Button btnDownload {
    Function OnTouch(e) {
        var req = ^.session.CreateRequest("Download2", "/test/prog1");
        req.AddParam("code", "0452");
        req.AddParam("name", "biz");
        ^.session.Post(req);
    }
}

Related item

CreateRequest method

SessionEnd event

HttpRequest class


HttpAsyncSession.RemoveCookie method

iOSAndroidWindows

Explanation

Remove cookie added with the AddCookie method.

Cookie that matches the specified name and path is removed.

Call format

session.RemoveCookie( name [, path] )

Return value

None

argument

String name

Name of cookie

String path

URL to which cookies are removed

When deleting cookie information omitted in the AddCookie method, the path is also omitted in the RemoveCookie method.

exception

HTTP-11

Wrong header information

Example of use

HttpAsyncSession session {
    Function OnSessionEnd(e) {
        if (e.id == "Download1") {
            if (e.status != $HTTP_OK) {
                //.MessageBox("Communication error:" + str(e.status), "ERROR", $OK);
            }
        }
    }
}
Button btnAddCookie {
    Function OnTouch(e) {
        ^.session.AddCookie("name1", "value1", "/sample.txt");
    }
}
Button btnRemoveCookie {
    Function OnTouch(e) {
        ^.session.RemoveCookie("name1", "/sample.txt");
    }
}
Button btnDownload {
    Function OnTouch(e) {
        /* After calling the RemoveCookie method, the name1 cookie is not added. */
        ^.session.Get("Download1", "/sample1");
    }
}

Related item

AddCookie method


HttpAsyncSession event

API version 4

Event

iOS Android Windows

The following events are defined in the HttpAsyncSession class.

API | name | Explanation
4 | SessionEnd | Occurs after the end of communication

Class overview

Base class event


HttpAsyncSession.SessionEnd event

Occurs every time one of the communications ends.

The following child objects are attached to the Event object.

Type | name | Explanation
String | id | The ID specified in the Get , Post , and CreateRequest methods. This ID determines which communication has ended.
Number | status | HTTP status code when communication ends normally. If the communication ends abnormally, the status will be 0.
HttpResponse | response | Holds the HttpResponse object of the communication result . This response becomes invalid when communication ends abnormally .
String | message | Holds the error message when communication ends abnormally. It is empty at the end of normal operation.

This event does not occur if the HttpAsyncSession object disappears and the connection is killed.


HttpRequest class

Object
 | HttpRequest

A class that holds HTTP requests.

HttpRequest is created by the HttpSession.CreateRequest method.

Default properties and ValueType

The default property is the URL . The value type specification is invalid.


HttpRequest property

API version 4

Property

iOS Android Windows

The following properties are defined in the HttpRequest class.

API | name | access | Type | initial value | Explanation
4 | Timeout | CRW | integer | 0 | Specify a request-specific timeout value
4 | URL | R | String |  | Represents the URL of the request

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


HttpRequest.Timeout property

Specifies a request-specific timeout value in seconds.

The initial value is the value specified in the Root.HttpTimeout property (//.HttpTimeout). //. If there is no setting in HttpTimeout, or if 0 is specified for this specified value, it will be the standard timeout time of the OS.

Example of use

var session = getHttpSession();
var req = session.CreateRequest("xxx.jsp");
req.Timeout = 180; /* Timeout for this communication 3 minutes */
try{
    res = session.Post(req);
}catch(exp){
}

Since the timeout setting specific to the communication request is specified by the HttpReqest class, it is not possible to set the specific timeout for communication that does not use this. The value set in //. HttpTimeout is always valid.

* The standard timeout value of the OS conforms to the OS specifications.


HttpRequest.URL property

Represents the URL of the request. The URL specified in the HttpSession.CreateRequest method is stored.

This property is read-only and cannot be changed.


HttpRequest method

API version 4

Method

iOS Android Windows

The following methods are defined in the HttpRequest class.

API | name | Explanation
4 | AddBody | Add a string to the message body of the request
4 | AddParam | Add the parameter of the request
21 | SetBodyFile | Set the file in the message body of the request
4 | SetHeader | Set HTTP headers for request
4 | WriteString | Add a string to the message body of the request

Class overview

Base class methods


HttpRequest.AddBody method

Explanation

Add the string to the message body of the request.

The added content is added to the message body regardless of GET, POST or DELETE as application / x-www-form-urlencoded format. If necessary, pre-encode the string you pass to the AddBody method.

Also, the Content-Type is not automatically specified in this method. if you want to add data to the HTTP request body, please specify the Content-Type explicitly.

Also, if the WriteString method and AddBody method are mixed or repeatedly executed, they are simply combined according to the execution order, and are combined with '&' before the contents specified by the AddParam method.

Call format

req.AddBody ( body )

Return value

None

argument

String body

A string to add to the message body

exception

HTTP-8

The httpRequest object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
req.AddBody("code=0452&name=Biz");
var res = session.Post(req);

Related item

AddParam , WriteString method

HttpSession class

encodeURL function


HttpRequest.AddParam method

Explanation

Add the parameter of the request. The names and values ​​specified in the parameters are automatically encoded as needed.

This parameter is encoded and added to the message body in application/x-www-form-urlencoded format regardless of GET, POST, or DELETE.

If no Content-Type is specified, the Content-Type will be application/x-www-form-urlencoded.

Also, the content written by the WriteString method and AddBody method is combined with'&' before the content specified by the AddParam method.

Call format

req.AddParam ( name , value )

Return value

None

argument

String name

Specify the name of the parameter

String value

Specify the value of the parameter

exception

HTTP-8

The httpRequest object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
req.AddParam("code", "0452");
req.AddParam("name", "Biz");
var res = session.Post(req);

Related item

AddBody , WriteString method,

HttpSession class


HttpRequest.SetBodyFile method

iOSAndroidWindows

Explanation

Set the file in the message body of the request.

This is used to upload files that cannot be handled by the HttpSession.Put method due to their large size.

Also, the Content-Type is not automatically specified in this method; if you want to add data to the HTTP request body, please specify the Content-Type explicitly.

If the AddBody method or WriteString method is called, the value specified in this method will be ignored.

Call format

req.SetBodyFile( fs , path )

Return value

なし

argument

FileSystem fs

FileSystem object to reference

String path

Path of the file

Specifies a relative path based on the root folder of the file system specified by fs.

exception

None

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
var fs = new FileSystem;
req.SetBodyFile(fs, "large_movie.mp4");
var res = session.Put(req);

Related item

AddBody, WriteString method


HttpRequest.SetHeader method

Explanation

Set the HTTP header of the request.

If a header with the same name already exists, it will be modified with the new content.

The header specified by the HTTP protocol is set automatically. Use the SetHeader method to add specially required headers.

Call format

req.SetHeader ( name, value )

Return value

None

argument

String name

Header name

It can be specified within the specification range of the header name defined in HTTP / 1.1.

String value

Header value

It can be specified within the specification range of the header value defined by HTTP / 1.1. However, you cannot specify an empty string.

exception

HTTP-8

The httpRequest object is abnormal

HTTP-11

Illegal header information

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
req.AddBody("code=0452&name=Biz");
req.SetHeader("appHeader", "1");
var res = session.Post(req);

Related item

HttpSession class


HttpRequest.WriteString method

Explanation

Add the string to the message body of the request.

It works the same as the AddBody method, but you can identify the presence or absence of an error by the return value.

Call format

var result = req.WriteString( body )

Return value

Returns $TRUE if the write was successful, $FALSE if there was an error.

argument

String body

A string to add to the message body

exception

HTTP-8

The httpRequest object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
if(req.WriteString("code=0452&name=Biz")){
    var res = session.Post(req);
}

Related item

AddBody method

HttpSession class


HttpRequest event

API version 4

Event

iOS Android Windows

There are no events defined in the HttpRequest class.

Class overview

Base class event


HttpResponse class

Object
 | HttpResponse

A class that holds HTTP responses.

HttpResponse object HttpSession.Get method or HttpSession.Post to get as a return value of the method.

Of the errors that occurred during the communication process, the errors that occurred in the HTTP layer are identified by the Status property of the HttpResponse object . Note that even if you receive an HttpResponse object as a result of the HttpSession.Get, Post method, the communication may not complete successfully.

Also, even if the Status property indicates an error such as $HTTP_NOT_FOUND, the Body property may contain a meaningless value as data such as HTML containing the error message returned by the WEB server.

Default properties and ValueType

The default property is Body . The value type specification is invalid.


HttpResponse property

API version 4

Property

iOS Android Windows

The following properties are defined in the HttpResponse class.

API | name | access | Type | Explanation
4 | Body | R | ByteArray | Response message body
4 | Status | R | integer | HTTP status code of the response
4 | URL | R | String | URL of the response

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


HttpResponse.Body property

Represents the message body of the response.

This property is read-only and cannot be changed.


HttpResponse.Status property

Represents the HTTP status code of the response. A status of 200 is normal. Typical status codes are defined by the following constants.

Status code | constant | Explanation
200 | $HTTP_OK | normal
201 | $HTTP_CREATED | Created successfully
202 | $HTTP_ACCEPTED | Accepted normally
204 | $HTTP_NO_CONTENTS | No normal response
400 | $HTTP_BAD_REQUEST | Error Request is invalid
401 | $HTTP_UNAUTHORIZED | Error Not authorized
403 | $HTTP_FORBIDDEN | Error prohibited
404 | $HTTP_NOT_FOUND | There is no error target
405 | $HTTP_METHOD_NOT_ALLOW | Error not allowed
500 | $HTTP_SERVER_ERROR | Error server error
501 | $HTTP_NOT_IMPLEMENTED | Features not implemented with errors
502 | $HTTP_BAD_GATEWAY | Error Gateway is incorrect
503 | $HTTP_SERVER_UNAVAILABLE | Error server unavailable
505 | $HTTP_VERSION_NOT_SUPPORTED | Error HTTP version not supported

See the World Wide Web Consortium (W3C) home page for additional code and more information.

This property is read-only and cannot be changed.


HttpResponse.URL property

Represents the URL of the response. Contains the same URL as the request.

This property is read-only and cannot be changed.


HttpResponse method

API version 4

Method

iOS Android Windows

The following methods are defined in the HttpResponse class.

API | name | Explanation
4 | GetHeader | Extract the HTTP header of the response message
4 | GetHeaderList | Gets all HTTP headers in the response message
4 | Read | Fetch the entire message body of the request
4 | ReadBinary | Retrieve the entire message body of the request as a ByteArray
4 | ReadLine | Extract one line from the message body of the request

Class overview

Base class methods


HttpResponse.GetHeader method

Explanation

Extracts the HTTP header of the response message.

If the specified header does not exist, it returns null.

Call format

var str = res.GetHeader ( name )

Return value

Returns a String that indicates the value of the header.

argument

String name

The name of the header to get

exception

HTTP-9

httpResponse object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var res = session.Get("/test/prog1");
var len = val(res.GetHeader("Content-Length"));

Related item

GetHeaderList method

HttpRequest.SetHeader method

HttpSession class


HttpResponse.GetHeaderList method

Explanation

Gets all HTTP headers in the response message.

Call format

var list = res.GetHeaderList()

Return value

An array of Record objects with the following child objects

Type | name | Explanation
String | headerName | Header name
String | headerValue | Header value

argument

None

exception

HTTP-9

httpResponse object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var res = session.Get("/test/prog1");
var list = res.GetHeaderList();
for(var n in list){
    print("name =", list[n].headerName);
    print("value =", list[n].headerValue, "\n");
}

Related item

GetHeader method

HttpSession class


HttpResponse.Read method

Explanation

Fetch the entire message body of the request.

Call format

var body = res.Read()

Return value

A String object that contains the message body.

Line breaks in the message are not processed, and the content received from the server is returned as it is.

argument

None

exception

HTTP-9

httpResponse object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var res = session.Get("/test/prog1");
var body = res.Read();
print(body);

Related item

ReadLine methods

HttpSession class


HttpResponse.ReadBinary method

Explanation

Extracts the entire request message body in binary format.

Call format

var body = res.ReadBinary()

Return value

A ByteArray object that contains the message body .

argument

None

exception

HTTP-9

httpResponse object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var res = session.Get("/test/prog1");
var body = res.ReadBinary();

Related item

Read and ReadLine methods

ByteArray , HttpSession class


HttpResponse.ReadLine method

Explanation

Extracts one line from the message body of the request.

You can read from the next line by calling the following ReadLine method.

Call format

var line = res.ReadLine()

Return value

A String object that contains a row. Does not include the newline character at the end of the line.

If there are no more rows, it returns null.

argument

None

exception

HTTP-9

httpResponse object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var res = session.Get("/test/prog1");
var line;
while((line = res.ReadLine())! = null){
    print(line, "\n");
}

Related item

Read methods

HttpSession class


HttpResponse event

API version 4

Event

iOS Android Windows

There are no events defined in the HttpResponse class.

Class overview

Base class event


HttpSession class

Object
 | HttpSession

A class that holds HTTP session information. Manages the connection with the WEB server.

This class supports http, https and file protocols and is implicitly generated and used at login and in Form.Get methods. It is also possible to use the HttpSession class and HttpRequest class directly for more advanced communication.

Biz/Browser maintains multiple objects of HttpSession class for each connection destination. Communication to the same destination reuses the already maintained HttpSession object.

The HttpSession object can be obtained with the static method GetSession or FindSession and the global function getHttpSession or findHttpSession .

Default properties and ValueType

The default property is Server . The value type specification is invalid.


HttpSession property

API version 4

Property

iOS Android Windows

The following properties are defined in the HttpSession class.

API | name | access | Initial value | Type | Explanation
4 | LastURL | R | String |  | URL last communicated
4 | Protocol | R | String |  | Protocol used for current connection
16 | PreventMultipleURLEncoding | CRW | boolean | $TRUE | Whether to prevent URL encoding from being done twice.
4 | Proxy | R | String |  | Proxy server used by the session
4 | Server | R | String |  | Connected server

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


HttpSession.LastURL property

Represents the last URL communicated using this session.

This property is read-only and cannot be changed.


HttpSession.Protocol property

Represents the protocol used in the current connection. It can be "http", "https", or "file".

This property is read-only and cannot be changed.


HttpSession.PreventMultipleURLEncoding property

iOSAndroidWindows

Set whether or not to prevent double URL encoding in the Get and CreateRequest methods.

If you set the PreventMultipleURLEncoding property to $FALSE and specify a URL-encoded string in the above method, the specified string will be further URL-encoded.


HttpSession.Proxy property

Represents the proxy server currently used by the session.

This property is read-only and cannot be changed.


HttpSession.Server property

Represents the currently connected server. If you request http://biz-browser.jp:82/biz/menu.crs, the Server property will be "biz-browser.jp:82".

This property is read-only and cannot be changed.


HttpSession method

API version 4

Method

iOS Android Windows

The following methods are defined in the HttpSession class.

API | name | Explanation
24 | AddCookie | Adds cookies from the client side
4 | CreateRequest | Create an HttpRequest object
4 | Dele | Delete the file on the server
4 | Get | Send a GET request to the server
4 | GetCookie | Search cookies
4 | IsLoginSession | Search for cookies
4 | Post | Send a POST request to the server
4 | Put | Create a file on the server
24 | RemoveCookie | Remove cookies added with the AddCookie method

Static method

API | name | Explanation
4 | FindSession | Finds and returns the HttpSession object that corresponds to the specified URL
4 | GetSession | Returns the session that downloaded the running CRS as an HttpSession object
4 | ToAbsoluteURL | Convert relative path URLs to absolute paths

Class overview

Base class methods


HttpSession.AddCookie method

iOSAndroidWindows

Explanation

Add cookies from the client side.

Cookies are added to the request header only when the URL specified in the CreateRequest method, Get method, etc. and the path specified in the AddCookie method match.

If path is omitted, cookies are added regardless of the URL.

If name and value match a cookie already added, update the added value.

Call format

session.AddCookie( name, value [, path])

Return value

None

argument

String name

Name of cookie

String value

Value of cookie

String path

URL to which cookies are added

If omitted, cookies are added regardless of the URL specified in the CreateRequest method, Get method, etc.

exception

HTTP-11

Wrong header information

Example of use

var session = HttpSession.GetSession();
session.AddCookie("name1", "value1", "/sample.txt");
session.AddCookie("name2", "value2", "/sample2.txt");
session.AddCookie("name3", "value3");

/* name1, value1 whose URL specified in the Get method and path specified in the AddCookie method match */
/* and name3, value3 whose path is omitted in the AddCookie method are added as cookies */
var res = session.Get("/sample.txt");
print(res.body);

Related item

RemoveCookie method


HttpSession.CreateRequest method

API version 4

HttpSession.CreateRequest method Change History

iOS Android Windows

Explanation

Make a new request to take advantage of the current connection. After setting the properties such as a parameter of the request, the created request is sent to the server by Post or Get method.

The HttpRequest object can only communicate once. When performing multiple communications, create separate HttpRequest objects using the CreateRequest method for each.

The HttpSession and HttpRequest objects are closely related. Get and Post can only be performed on the HttpSession object when the HttpReuqest object was created.

If you don't need the parameter of the request, it's more efficient to use the form of writing the URL directly in the Get method instead of using the CreateRequest method .

Call format

var req = session.CreateRequest ( URL [, enc ] )

Return value

Returns a reference to the HttpRequest object.

argument

String URL

URL to request. Specify the absolute address starting with "/". It can also include protocols, servers, and ports, but it must match the Server and Protocol properties.

integer enc

Specifies the encoding method of POST parameters when sending POST requests. *1

Specify a combination of the following values. If omitted, the value will be HttpSession.DEFAULT_ENCODE.

constant | value | Explanation
HttpSession.DEFAULT_ENCODE | 0 | Encode according to the Mobile compatibility mode specification
HttpSession.UTF8_ENCODE | 1 | Encode to UTF-8

exception

HTTP-1

Unable to generate request

HTTP-2

URL is a server different from the connection destination

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
req.AddParam("code", "0452");
req.AddParam("name", "Biz");
var res = session.Post(req);

Related item

Protocol , Server properties

Get , Post method

HttpRequest , HttpResponse class

Change history
* 1　The specification has been changed since API version 24.


HttpSession.Dele method

API version 4

HttpSession.Dele method change history

iOS Android Windows

Explanation

Delete the file on the server.

Use the HTTP 1.1 DELETE method internally. You must allow the use of the DELETE method in your server-side settings.

Returns the status code if any action occurs on the server side.

Returns 0 if communication to the server is not successful.

It is possible to add a request body by HttpRequest.AddBody method or HttpRequest.AddParam method.*2

Call format

var result = session.Dele ( uri )

Or

var result = session.Dele ( req ) * 1

Return value

Returns a reference to the HttpResponse object.

Or

HttpResponse object reference(when HttpRequest object is specified as an argument)*1

Returns.

argument

String uri

The URI to request. Specify with an absolute address starting with "/". It can also include protocols, servers, and ports, but it must match the Server and Protocol properties.

HttpRequest req

A HttpRequest object that indicates the request . Create with the CreateRequest method.

exception

HTTP-3

Unable to send request

HTTP-5

The specified request URL is different from the connection destination

HTTP-6

Request ended with error

Example of use

var session = getHttpSession();
var res = session.Dele("/upload/file.txt");

Related item

Put method

Change history
* 1 Added from API version 6.
* 2 The specification has been changed since API version 26.


HttpSession.Get method

Explanation

Send a GET request to the destination server and receive the result as a reference for the HttpResponse object.

Check the execution result of the HTTP layer in the Status property of the HttpResponse object returned in the return value .

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

var res = session.Get( URL )

Or

var res = session.Get( req )

Return value

Returns a reference to the HttpResponse object.

argument

String URL

URL to request. Specify with an absolute address starting with "/". It can also include protocols, servers, and ports, but it must match the Server and Protocol properties.

If you specify a search string that starts with?, Special characters are automatically encoded according to the HTTP specifications.

HttpRequest req

Request An HttpRequest object that represents a request . Create with the CreateRequest method.

exception

HTTP-2

The specified httpRequest has a different connection destination

HTTP-3

Unable to send request

HTTP-4

The request object specified for GET or POST is invalid

HTTP-5

The specified request URL is different from the connection destination

HTTP-6

Request ended with error

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var res = session.Get("/test/prog1?code=1283&name=Biz");
if(res.Status! = $HTTP_OK) {
    MessageBox("Communication error:" + str(res.Status), "ERROR", $OK);
    return;
}

Related item

Protocol , Server properties

CreateRequest method

HttpRequest , HttpResponse class

encodeURL function


HttpSession.GetCookie method

Explanation

Gets the cookie recorded in the session.

Cookie recording adds and records the cookie included in the response and response each time communication is performed using this session.

Call format

var res = session.GetCookie ( [ id ] )

Return value

If id is specified, the cookie value is returned as a character string.

If no id is specified, an array of Recode objects with the following child objects is returned.

Type | name | Explanation
String | cookieId | cookie name
String | cookieValue | cookie value

If no cookies are recorded, the Record array will have 0 elements.

argument

String id

Specify the name of the cookie to get.

exception

HTTP-7

httpSession object is abnormal

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
req.AddParam("code", "0452");
req.AddParam("name", "Biz");
var res = session.Post(req);
var cookie = session.GetCookie();
for(var i in cookie){
    print("id =", cookie[i].cookieId, "\n");
    print("value =", cookie[i].cookieValue, "\n");
}

Related item

HttpRequest , HttpResponse class


HttpSession.IsLoginSession method

Explanation

Check if the session was started by the Login method.

By calling the IsLoginSession method for the HttpSession object obtained by the getHttpSession function, you can know whether the session that loaded the CRS was started by the Login method or the Get method.

In the case of a session started by the Get method, CRS loaded from other server or local file may be running at the same time, and those CRS programs process the internal data of the application unintentionally. There is a possibility.

To prevent this situation, you can check if the application is loaded in the session started by the Login method.

Call format

var res = session.IsLoginSession([ SingleLogin ])

Return value

Returns $TRUE if the session object is a session initiated by the Login or SLogin methods, $FALSE otherwise.

argument

boolean SingleLogin

If you specify $TRUE, it returns $TRUE only for sessions started by the SLogin method.

Otherwise, it returns $TRUE for sessions started by the Login or SLogin methods.

exception

None

Example of use

var session = getHttpSession();
if(session.IsLoginSession()){
    Get("main.crs");
}else{
    Login("http://servser/main.crs");
}

Related item

Root.Login , Root.SLogin methods

NetObject.Get method

getHttpSession function


HttpSession.Post method

Explanation

Send a POST request to the destination server and receive the result as a reference for the HttpResponse object.

The parameter of the request to be included in the request is set with the HttpRequest.AddParam method.

Check the execution result of the HTTP layer in the Status property of the HttpResponse object returned in the return value .

Call format

var res = session.Post( req )

Return value

Returns a reference to the HttpResponse object.

argument

HttpRequest req

Request An HttpRequest object that represents a request . Create with the CreateRequest method.

exception

HTTP-2

The specified httpRequest has a different connection destination

HTTP-3

Unable to send request

HTTP-4

The request object specified for GET or POST is invalid

HTTP-5

The specified request URL is different from the connection destination

HTTP-6

Request ended with error

Example of use

var session = findHTTPSession("http://biz-browser.jp");
var req = session.CreateRequest("/test/prog1");
req.AddParam("code", "0452");
req.AddParam("name", "Biz");
var res = session.Post(req);
if(res.Status! = $HTTP_OK){
    MessageBox("Communication error:" + str(res.Status), "ERROR", $OK);
    return;
}

Related item

CreateRequest method

HttpRequest , HttpResponse class


HttpSession.RemoveCookie method

iOSAndroidWindows

Explanation

Remove cookie added with the AddCookie method.

Cookie that matches the specified name and path is removed.

Call format

session.RemoveCookie( name [, path] )

Return value

None

argument

String name

Name of cookie

String path

URL to which cookies are removed

When deleting cookie information omitted in the AddCookie method, the path is also omitted in the RemoveCookie method.

exception

HTTP-11

Wrong header information

Example of use

var session = HttpSession.GetSession();
session.AddCookie("name1", "value1", "/sample.txt");
session.RemoveCookie("name1", "/sample.txt");

/* No name1 cookies will be added. */
var res = session.Get("/sample.txt");
print(res.body);

Related item

AddCookie method


HttpSession.Put method

API version 4

HttpSession.Put method change history

iOS Android Windows

Explanation

Create a file on the server.

It uses the HTTP 1.1 PUT method internally. You must allow the use of the PUT method in your server-side settings.

The behavior when the file already exists depends on the server implementation.

Returns a status code for any action taken on the server side.

If communication to the server is not established, 0 is returned.

Call format

var result = session.Put ( uri , obj )

Or

var result = session.Put ( req ) * 1

Return value

HTTP status code (when URI is specified as an argument)

Or

Reference to HttpResponse object (when HttpRequest object is specified as an argument)* 1

Returns

argument

String uri

The URI to request. Specify with an absolute address starting with "/". It can also include protocols, servers, and ports, but it must match the Server and Protocol properties.

String obj

Object obj

Specify the file data as a String object or Reader object .

HttpRequest req

An "HttpRequest object" that represents a request.It is created by the CreateRequest method.

exception

HTTP-3

Unable to send request

HTTP-5

The specified request URL is different from the connection destination

HTTP-6

Request ended with error

EXT-7

Invalid reference

EXT-11

Read method not found

Example of use

var session = getHttpSession();
var res = session.Put("/upload/file.txt", "test");

Related item

Dele method

Change history
* 1 Added from API version 6.


HttpSession.FindSession method

Explanation

Finds and returns the HttpSession object that corresponds to the specified URL .

If the corresponding HttpSession is not found, a new HttpSession will be created.

Call format

var session = HttpSession.FindSession( URL )

Return value

HttpSession object

argument

String URL

Specify the URL to search . Among the sessions held by Biz/Browser, the sessions with the exact match of the protocol, host name and port number of the specified URL are searched.

exception

None

Example of use

var session = HttpSession.FindSession("http://biz-browser.jp");
var res = session.Get("/sample.txt");
print(res.body);

Related item

GetSession method

HttpSession , HttpRequest , HttpResponse classes


HttpSession.GetSession method

Explanation

Returns the session that downloaded the running CRS as an HttpSession object.

Call format

var session = HttpSession.GetSession()

Return value

HttpSession object

argument

None

exception

None

Example of use

var session = HttpSession.GetSession();
var res = session.Get("/sample.txt");
print(res.body);

Related item

FindSession method

HttpSession , HttpRequest , HttpResponse classes


HttpSession.ToAbsoluteURL method

Explanation

Converts relative path URLs to absolute paths.

This method is a static method. You can call it without creating an object.

Call format

var abs = HttpSession.ToAbsoluteURL ( path [, base ])

Return value

Returns the URL converted to an absolute path.

argument

String path

Specify the URL to convert. The URL of the absolute path starting with http :, https :, file: is returned as it is.

String base

Specify the path that is the base point of the relative path.

If omitted, the URL of the CRS that called the ToAbsoluteURL method will be the base point.

exception

None

Example of use

var abs_path = HttpSession.ToAbsoluteURL("data.xml");
var session = getHttpSession();
var res = session.Get(abs_path);

Related item


HttpSession event

API version 4

Event

iOS Android Windows

There are no events defined in the HttpSession class.

Class overview

Base class event


WebSocket class

iOSAndroidWindows

Object
 | WebSocket

A class for two-way communication as a WebSocket client WebSocket.

WebSocket class supports WS/WSS protocol communication, Basic authentication, Digest authentication, and authentication with client certificates.

Default properties and ValueType

The default property is the Value. The value type specification is invalid.


WebSocket property

API version 20

Property

iOSAndroidWindows

The following properties are defined in the WebSocket class.

API | name | access | Type | initial value | Explanation
20 | IsConnected | R | boolean |  | Whether the WebSocket is connected or not
20 | Port | R | integer |  | Port number to connect to
20 | Timeout | CRW | integer | 0 | Timeout values for Read and ReadLine methods
20 | Host | R | String |  | Host name or IP address of the connection destination
20 | Value | CRW | String Number Fixed Date |  | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


WebSocket.IsConnected property

iOSAndroidWindows

The value is $TRUE if the WebSocket is already connected, otherwise it is $FALSE.

This property is read-only and cannot be modified.


WebSocket.Port property

iOSAndroidWindows

The port number to witch WebSocket client is connecting is stored.

This property is read-only and cannot be changed.


WebSocket.Timeout property

iOSAndroidWindows

Specifies the timeout period in seconds for the Read、ReadLine method.

The default is 0 (do not wait for reception).


WebSocket.Host property

iOSAndroidWindows

The client-side host name of the socket being connected to is stored.

This property is read-only and cannot be modified.


WebSocket.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


WebSocket method

API version 20

Method

iOSAndroidWindows

The following methods are defined in the WebSocket.

API | name | Explanation
20 | Close | Closes the WebSocket connection.
20 | GetResponseHeader | Get the response header of the connection made by the Open method.
20 | GetResponseHeaderList | Get the list of the response header of the connection made by the Open method.
20 | GetHTTPStatusCode | Get the response code of the connection made by the Open method.
20 | Open | Open the WebSocket connection.
20 | Read | Reads data from the WebSocket.
20 | ReadLine | Reads a single line of string data from the WebSocket.
20 | Write | Write data to the WebSocket.
20 | WriteString | Writes string data to the WebSocket.

Class ovewview

Base class methods


WebSocket.Close method

iOSAndroidWindows

Explanation

Closes the WebSocket connection.

Be soue to close the WebSocket opened with the Open method, after reading or writing is completed.

Call format

websock.Close()

Return value

None

argument

None

exception

HTTP-71

Socket is not open

Example of use

var websock = new WebSocket;
websock.Open("wss://sample.com", 8000);
websock.WriteString("hello");
websock.Close();

Related item

Open method


WebSocket.GetResponseHeader method

iOSAndroidWindows

Explanation

Get the list of the response header of the connection made by the Open method.

Call format

var value = websock.GetResponseHeader( name )

Return value

Return the string of the value specified by the name.

argument

String name

The name of thr header

exception

None

Example of use

var websock = new WebSocket;
websock.Open("wss://sample.com", 8000);
print(websock.GetResponseHeader("Connection"),"\n");

Related item

GetResponseHeaderList、GetHTTPStatusCode method


WebSocket.GetResponseHeaderList method

iOSAndroidWindows

Explanation

Get the list of the response header of the connection made by the Open method.

Call format

var headers = websock.GetResponseHeaderList( )

Return value

Return an array of Record objects with the following child objects:

Type | name | Explanation
String | headerName | Name of the header
String | headerValue | Value of the header

argument

None

exception

None

Example of use

var websock = new WebSocket;
websock.Open("wss://sample.com", 8000);
var headers = websock.GetResponseHeaderList();
for (var n in headers) {
 print(headers[n].headerName, ":", headers[n].headerValue,"\n");
}

Related item

GetResponseHeader、GetHTTPStatusCode method


WebSocket.GetHTTPStatusCode method

iOSAndroidWindows

Explanation

Get the response code of the connection made by the Open method.

Call format

var statusCode = websock.GetHTTPStatusCode( )

Return value

Return the HTTP status code.

argument

None

exception

None

Example of use

var websock = new WebSocket;
websock.Open("wss://sample.com", 8000);
var statusCode = websock.GetHTTPStatusCode();
print("Status Code:", str(statusCode),"\n");

Related item

GetResponseHeader、GetResponseHeaderList method


WebSocket.Open method

iOSAndroidWindows

Explanation

Connect to a WebSocket server and open WebSocket.

Call format

websock.Open( url[, port ])

Return value

None

argument

String url

URL of the WebSocket

integer port

port number

Specify a value in the range of 1 to 65535.

If omitted, 443 (to connect with wss) or 80 (to connect with ws) will be specified.

exception

HTTP-6

Ask to terminate the error.

HTTP-68

Socket is already opened

Example of use

var websock = new WebSocket;
websock.Open("wss://sample.com", 8000);
websock.WriteString("hello");
websock.Close();

Related item

Close method


WebSocket.Read method

iOSAndroidWindows

Explanation

Read data from WebSocket.

The process will not return until the specified size of data is received or the timeout occurs.

Call format

var data= websock.Read( size )

Return value

ByteArray object containing the read data.

argument

integer size

Size to read. Specify the size in bytes.

If omitted or a negative value is specified, the value is assumed to be 4096.

exception

HTTP-71

Socket is not open

HTTP-72

Read operation did not complete

Example of use

var websock = new Socket;
websock.Open("wss://sample.com", 8000);
while (true) {
    var data = websock.Read(256);
    if (data.Length <= 0) {
        break;
    }
    print(data);
    websock.Write(data);
}
websock.Close();

Related item

ReadLine、Write method


WebSocket.ReadLine method

iOSAndroidWindows

Explanation

Reads a single line of string data WebSocket.

This function reads the string data from the current read position of the socket to the next newline character.

The process will not return until one line is received or timeout. Any error other than a timeout will result in an exception.

Call format

var data = websock.ReadLine()

Return value

Returns the read string data as a String object.

Newline characters at the end of the line are not included. If the end of the data is reached and no more can be read, an empty string is returned.

argument

None

exception

HTTP-71

Socket is not open

HTTP-72

Read operation did not complete

Example of use

var websock = new WebSocket;
websock.Open("wss://sample.com", 8000);
while (true) {
    var data = websock.ReadLine();
    if (data.length <= 0) {
        break;
    }
    print(data);
    websock.WriteString(data);
}
websock.Close();

Related item

Read、WriteString method


WebSocket.Write method

iOSAndroidWindows

Explanation

Writes data to the socket.

Automatically converts data to byte data according to the data type.

Call format

websock.Write( data )

Return value

None

argument

ByteArray data

Data to be written

exception

HTTP-71

Socket is not open

HTTP-73

Write operation did not complete

Example of use

var websock = new Socket;
websock.Open("wss://sample.com", 8000);
while (true) {
    var data = websock.Read(256);
    if (data.Length <= 0) {
        break;
    }
    print(data);
    websock.Write(data);
}
websock.Close();

Related item

WriteString、Read method

The difference in writing format for each data type

Depending on the data type of the variable specified for data, the format to be written will be as follows.

data type | example | Explanation
String | Write("abc") Write(new String("abc")); | character string data String data will be written in UTF-8.
integer | Write(10) | Integer value data It is written as 4 bytes of signed integer data.
boolean | Write(true) | bool-value data It is written as 4 bytes of signed integer data. The value is 1 if true, 0 if false.
Number | Write(1.2) Write(new Number(10)) | Numeric (floating point) data The data is written as 8 bytes of floating point data.
Date | Write(new Date()) | Date data The value of the Value property will be written as 8 bytes of floating point data.
ByteArray | Results read by the Read method, etc. | binary data Binary data will be written as is.

If you always want to write as a string, use the WriteString method.


WebSocket.WriteString method

iOSAndroidWindows

Explanation

Writes string data to the WebSockt.
Converts data to a string and sends it.

Call format

websock.WriteString( data )

Return value

argument

argument

String data

String data to be written

exception

HTTP-71

Socket is not open

HTTP-73

Write operation did not complete

Example of use

var websock = new WebSocket;
websock.Open("wss://sample.com", 8000);
while (true) {
    var data = websock.ReadLine();
    if (data.length <= 0) {
        break;
    }
    print(data);
    websock.WriteString(data);
}
websock.Close();

Related item

Write、ReadLine method


WebSocket event

API version 20

Event

iOSAndroidWindows

The following events are defined in the WebSocket class.

API | mame | Explanation
20 | Receive | Notifies the user that data is ready to be received

Class overview

Base class events


WebSocket.Receive event

iOSAndroidWindows

This event occurs when data is ready to be received.


FTP package

It is a package for communicating with an FTP server.

class

API | name | Explanation
14 | FtpSession | Holds FTP session information


FtpSession class

Object
 | FtpSession

It is a class that retains the session information of FTP. Manages the connection with the FTP server.

This class supports FTP (RFC 959) compliant FTP servers.

Please note that SFTP / FTPS / SCP protocol is not supported.

FtpSession object can be obtained by the static method Connect .

Differences in behavior depending on the FTP server

This class assumes a connection to a server that complies with RFC 959, the most popular FTP standard.

However, it should be noted that the actual behavior of the FTP server differs greatly from the standard and is extended, and the default behavior is different.

(For example, different default character code, different path hit by wildcard, different behavior at copy and rename, etc.)

When using this class to communicate with an FTP server, carefully check the behavior of the FTP server application you are using.

Default property and ValueType

The default property is Server . The ValueType specification is invalid.


FtpSession property

API version 14

Property

iOS Android Windows

The following properties are defined in the FtpSession class.

API | name | access | Type | Explanation
14 | CurrentDir | R | String | Current current directory
14 | Server | R | String | Connected server
14 | SystemName | R | String | Server system name (SYST command return value)

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FtpSession.CurrentDir property

Indicates the current current directory.

Use the ChangeDir method to change the current directory .

This property is read-only and cannot be changed.


FtpSession.Server property

Indicates the FTP server currently connected.

This property is read-only and cannot be changed.


FtpSession.SystemName property

Represents the system name of the server (SYST command return value).

This property is read-only and cannot be changed.


FtpSession method

API version 14

Method

iOS Android Windows

The following methods are defined in the FtpSession class.

API | name | Explanation
14 | Close | Disconnect from the FTP server
14 | ChangeDir | Change the current directory
14 | CreateDir | Create a directory
14 | DeleteDir | Remove directory
14 | DeleteFile | Delete files
14 | FindFiles | Specifies a list of files and directories in the directory
14 | GetSize | Get file size
14 | Get | Download file
14 | Put | Upload the file
14 | Rename | Change file name or directory name
14 | SetEncoding | Specifies the character code used to communicate with the server

Static method

API | name | Explanation
14 | Connect | Connect to FTP server

Class overview

Base class methods


FtpSession.Close method

Explanation

Disconnect from the FTP server.

Call format

var session = FtpSession.Close()

Return value

None

argument

None

exception

None

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.SetEncoding("Shift_JIS");
session.ChangeDir("/path/to/directory")
var received = new ByteArray();
session.Get("foo.txt", received);
session.Close();

Related item

Connect method


FtpSession.ChangeDir method

Explanation

Change the current directory.

If the change of current directory is successful, the CurrentDir property is updated to the new current directory.

Call format

session.ChangeDir( path )

Return value

None

argument

String path

Specify the path indicating the new current directory as a relative path or an absolute path.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.SetEncoding("Shift_JIS");
session.ChangeDir("/path/to/directory")
var received = new ByteArray();
session.Get("foo.txt", received);
session.Close();

Related item

CurrentDir property


FtpSession.Connect method

API version 14

FtpSession.Connect methodChange History

iOS Android Windows

Explanation

Connect to the FTP server.

Returns a connected FtpSession object if the connection is successful.

Call format

var session = FtpSession.Connect( hostname [, username [, password ]])

Return value

Returns a reference to an FtpSession object.

argument

String hostname

Specify the URL of the connection destination FTP server.

The port number is specified in the format "hostname:port number". *1

The range of port numbers is 1 to 65535.

String username

Specify the user name for connecting to the FTP server.

If omitted, "anonymous" is specified.

String password

Specify the password for connecting to the FTP server.

If omitted, "biz-browser @" is specified.

exception

FUNC-4

Invalid argument value

FTP-1

Failed to connect to the FTP server

Example of use

var session = FtpSession.Connect("ftp://example.com");
session.SetEncoding("Shift_JIS");
session.ChangeDir("/path/to/directory")
var received = new ByteArray();
session.Get("foo.txt", received);
session.Close();

Related item

SystemName , Server property

Close , Get , Put , SetEncoding methods

Change History
*1　The specification has been changed since API version 23.
    If a port number is specified in earlier versions, FUNC-4 exception will occur.


FtpSession.CreateDir method

Explanation

Create a directory.

Call format

session.CreateDir( path )

Return value

None

argument

String path

Specify the relative path or absolute path of the directory to be created.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.CreateDir("/path/to/new_directory");
session.Close();

Related item

DeleteDir method


FtpSession.DeleteDir method

Explanation

Delete the directory.

If the directory to be deleted is not empty, the deletion will fail. Please be careful.

Call format

session.DeleteDir( path )

Return value

None

argument

String path

Specify the relative path or absolute path of the directory to be deleted.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.DeleteDir("/path/to/delete_directory");
session.Close();

Related item

CreateDir , DeleteFile methods


FtpSession.DeleteFile method

Explanation

Delete the file.

Call format

session.DeleteFile( path )

Return value

None

argument

String path

Specify the path of the file to be deleted as a relative path or an absolute path.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.DeleteFile("/path/to/delete_file");
session.Close();

Related item

DeleteDir method


FtpSession.FindFiles method

Explanation

Get a list of files and folders in a directory.

Call format

var list = session.FindFiles([ path ])

Return value

List of found files and folders

Returns a String array containing the virtual file names.

argument

String path

Virtual file name of the folder to get the list

You can specify a wildcard with "*" or "?" As part of the file name.

Wildcards (such as "/dir/a*/data.txt") cannot be specified for the folder name.

If path is omitted, all files in the current directory will be searched.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
var list = session.FindFiles("/*.txt");
session.Close();

Related item


FtpSession.GetSize method

Explanation

Get the file size.

Call format

var size = session.GetSize( path )

Return value

Returns the file size of the specified file as an integer.

argument

String path

Specify the relative or absolute path of the file to get the file size.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
var size = session.GetSize("/path/to/exist_file");
session.Close();

Related item


FtpSession.Get method

Explanation

Download the file.

Files are transferred in binary transfer mode.

Call format

session.Get( path , writer_obj )

Return value

None

argument

String path

Specify the path of the downloaded file as a relative path or an absolute path.

Object writer_obj

Specify the Writer object that will be the output destination of the downloaded data.

ByteArray can also be specified as an input / output object.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.SetEncoding("Shift_JIS");
session.ChangeDir("/path/to/directory")
var received = new ByteArray();
session.Get("foo.txt", received);
session.Close();

Related item

Put method


FtpSession.Put method

Explanation

Upload the file.

Files are transferred in binary transfer mode.

Call format

session.Put( path , reader_obj )

Return value

None

argument

String path

Specify the path of the upload destination file as a relative path or an absolute path.

Object reader_obj

Specify the Reader object that will be the input destination of the uploaded data.

ByteArray can also be specified as an input / output object.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.SetEncoding("Shift_JIS");
session.ChangeDir("/path/to/directory")
var data = new ByteArray("abc");
session.Put("foo.txt", data);
session.Close();

Related item

Get method


FtpSession.Rename method

Explanation

Change the file name or directory name.

Call format

session.Rename( path_from , path_to )

Return value

None

argument

String path_from

Specify the relative or absolute path of the file to be changed.

String path_to

Specify the changed file path as a relative path or an absolute path.

exception

FUNC-4

Invalid argument

FTP-2

Not connected to FTP server

FTP-3

Request to FTP server failed

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.Rename("original_file.dat", "renamed_file.dat");
session.Close();

Related item


FtpSession.SetEncoding method

Explanation

Specifies the character code used to communicate with the server.

This setting affects the path and error messages received from the server. It does not affect the character code of the acquired file.

UTF-8 format is set as the default character code.

Call format

session.SetEncoding( encoding )

Return value

None

argument

String encoding

Specify the character code.

The character codes that can be specified are the same as the character codes that can be handled by the TextConverter class.

exception

FUNC-4

Invalid argument

Example of use

var session = FtpSession.Connect("ftp://example.com/");
session.SetEncoding("Shift_JIS");
session.ChangeDir("/path/to/directory")
var received = new ByteArray();
session.Get("foo.txt", received);
session.Close();

Related item


FtpSession event

API version 14

Event

iOS Android Windows

There are no events defined in the FtpSession class.

Class overview

Base class event


Runtime package

This package is a collection of classes that perform operations that depend on the execution environment.

class

API | name | Explanation
15 | BluetoothPeripheral | Access BLE (Bluetooth Low Energy) peripherals (devices)
15 | BluetoothSocket | Implement the client function of Bluetooth SPP communication.
15 | BluetoothSocketListener | Implement the server function for Bluetooth SPP communication.
19 | CodeScannerView | Show camera preview in Form and scan barcodes and 2D codes
4 | File | Manipulate local files
4 | FileSystem | Operate the file system of the client PC
4 | Runtime | A class that collects functions that depend on the execution environment.
14 | NfcTagConnection | This class manages the connection with NFC tags.
22 | SerialPort | Implement serial communication function
15 | Socket | Implement the TCP/IP client function.
15 | SocketListener | Implement TCP/IP server functions.


BluetoothPeripheral class

iOSAndroidWindows

Object
 | BluetoothPeripheral

This class is used to access BLE (Bluetooth Low Energy) peripherals (devices).

It can read and write characteristics (≒properties) of BLE peripherals, and receive changes in characteristics as events.

To connect to the BLE peripheral, call the Connect method after Bluetooth pairing.

After connecting to the BLE peripheral, read and write the characteristic with the Read and Write methods.

To fire an event when the characteristic changes, use the StartNotify method

The StopNotify method stops the event from occurring.

To disconnect from the BLE peripheral, use the Disconnect method.

Default properties and ValueType

The default property is Value.The ValueType can be String, Number, Fixed, or Date.


BluetoothPeripheral property

API version 15

Property

iOSAndroidWindows

The following properties are defined in the BluetoothPeripheral class.

API | name | access | type | Initial value | Explanation
15 | Timeout | CRW | Number | 30 | Timeout for connection, read, and write.
15 | Value | CRW | String Number Fixed Date |  | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


BluetoothPeripheral.Timeout property

iOSAndroidWindows

Specifies the timeout period for connection, read, and write.

The unit is seconds.

The default value is 30 seconds.


BluetoothPeripheral.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


BluetoothPeripheral method

API version 15

Method

iOSAndroidWindows

The following methods are defined in the BluetoothPeripheral class.

API | name | Explanation
15 | Connect | Connect to peripherals
15 | Disconnect | Disconnects from the peripheral
15 | Read | Reads a value from a characteristic
15 | Write | Writes a value to a characteristic
15 | StartNotify | Start receiving events for changes in the characteristic
15 | StopNotify | Terminate receiving events for changes in the characteristic

Class overview

Base class methods


BluetoothPeripheral.Connect method

API version 15

BluetoothPeripheral.Connect methodChange History

iOSAndroidWindows

Explanation

Connect to the BLE peripheral (device).

After connecting to a peripheral, be sure to disconnect it using the Disconnect method after reading or writing is completed.

The process will not return until the connection is complete or times out.

Call format

peripheral.Connect( deviceId )

Return value

None

argument

String deviceId

BD address of the device (the format of the BD address is the same as the MAC address)

exception

FUNC-4

Invalid argument value

RTM-123

It is already connected to the device.

RTM-83

Bluetooth is not enabled.

RTM-78

Communication with the Bluetooth device has timed out.

RTM-81

Failed to connect with Bluetooth device.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings.*1

Example of use

BluetoothPeripheral peripheral {
    Function onCharacteristicChanged(e) {
        /* event processing */
    }

}
Button btnBleConnect {
    X = 16;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE connection";

    Function OnTouch( e ) {
        //.peripheral.Connect(deviceId);
    }
};
Button btnBleDisconnect{
    X = 128;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE Disconnection";

    Function OnTouch( e ) {
        //.peripheral.Disconnect();
    }
}

Related item

Disconnect method

Change History
*1　Added in API version 26.


BluetoothPeripheral.Disconnect method

iOSAndroidWindows

Explanation

Disconnects from the BLE peripheral (device) connected by the Connect method.

Call format

peripheral.Disconnect()

Return value

None

argument

None

exception

None

Example of use

BluetoothPeripheral peripheral {
    Function onCharacteristicChanged(e) {
        /* event processing */
    }

}
Button btnBleConnect {
    X = 16;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE connection";

    Function OnTouch( e ) {
        //.peripheral.Connect(deviceId);
    }
};
Button btnBleDisconnect{
    X = 128;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE Disconnection";

    Function OnTouch( e ) {
        //.peripheral.Disconnect();
    }
}

Related item

Connect method


BluetoothPeripheral.Read method

iOSAndroidWindows

Explanation

Reads a value from a specified characteristic (≒property).

The process will not return until the data loading is complete or timeout.

Call format

ByteArray data= peripheral.Read( serviceUuid , characteristicUuid )

Return value

ByteArray object containing the read data.

argument

String serviceUuid

UUID to identify the service

String characteristicUuid

UUID to identify the characteristic

exception

FUNC-4

The value of the argument is invalid.

RTM-124

Not connected to device

RTM-83

Bluetooth is not enabled.

RTM-72

Could not complete the read operation.

RTM-78

Communication with the Bluetooth device has timed out.

RTM-79

Unknown service ID.

RTM-80

Unknown characteristic ID.

Example of use

BluetoothPeripheral peripheral {
    Function onCharacteristicChanged(e) {
        /* event processing */
    }

}
Button btnBleConnect {
    X = 16;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE connection";

    Function OnTouch( e ) {
        //.peripheral.Connect(deviceId);
    }
}
Button btnBleReadService {
    X = 16;
    Y = 624;
    Width = 104;
    Height = 40;
    Title = "BLE Read";

    Function OnTouch( e ) {
        var serviceUUID = "00000000-1111-2222-3333-4444-555555555555";
        var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
        var data = //.peripheral.Read(serviceUUID, characteristicUUID);
        //.peripheral.Write(serviceUUID, characteristicUUID, data);
    }
}

Related item

Write method


BluetoothPeripheral.Write method

iOSAndroidWindows

Explanation

Writes a value to the specified characteristic (≒property).

The process will not return until the write operation is complete or times out.

Call format

peripheral.Write( serviceUuid , characteristicUuid , data )

Return value

None

argument

String serviceUuid

UUID to identify the service

String characteristicUuid

UUID to identify the characteristic

ByteArray data

Data to be written

exception

FUNC-4

The value of the argument is invalid.

RTM-124

Not connected to device

RTM-83

Bluetooth is not enabled.

RTM-73

Could not complete the write operation.

RTM-78

Communication with the Bluetooth device has timed out.

RTM-79

Unknown service ID.

RTM-80

Unknown characteristic ID.

Example of use

BluetoothPeripheral peripheral {
    Function onCharacteristicChanged(e) {
        /* event processing */
    }

}
Button btnBleConnect {
    X = 16;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE connection";

    Function OnTouch( e ) {
        //.peripheral.Connect(deviceId);
    }
}
Button btnBleReadService {
    X = 16;
    Y = 624;
    Width = 104;
    Height = 40;
    Title = "BLE Read";

    Function OnTouch( e ) {
        var serviceUUID = "00000000-1111-2222-3333-4444-555555555555";
        var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
        var data = //.peripheral.Read(serviceUUID, characteristicUUID);
        //.peripheral.Write(serviceUUID, characteristicUUID, data);
    }
}

Related item

Read method


BluetoothPeripheral.StartNotify method

iOSAndroidWindows

Explanation

Start receiving events for changes in the specified characteristic (≒property).

It is supported when the type of the characteristic is Notify or Indicate.

When the specified characteristic changes, the CharacteristicChanged event is fired.

Call format

peripheral.StartNotify( serviceUuid , characteristicUuid )

Return value

None

argument

String serviceUuid

UUID to identify the service

String characteristicUuid

UUID to identify the characteristic

exception

FUNC-4

The value of the argument is invalid.

RTM-124

Not connected to device

RTM-83

Bluetooth is not enabled.

RTM-73

Could not complete the write operation.

RTM-78

Communication with the Bluetooth device has timed out.

RTM-79

Unknown service ID.

RTM-80

Unknown characteristic ID.

Example of use

BluetoothPeripheral peripheral {
    Function onCharacteristicChanged(e) {
        /* event processing */
    }

}
Button btnBleConnect {
    X = 16;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE connection";

    Function OnTouch( e ) {
        //.peripheral.Connect(deviceId);
    }
}
Button btnBleStartNotifyBatteryService {
    X = 128;
    Y = 624;
    Width = 104;
    Height = 40;
    Title = "BLE Start";

    Function OnTouch( e ) {
        var serviceUUID = "00000000-1111-2222-3333-4444-555555555555";
        var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
        var data = //.peripheral.StartNotify(serviceUUID, characteristicUUID);
    }
}
Button btnBleStopNotifyBatteryService {
    X = 240;
    Y = 624;
    Width = 104;
    Height = 40;
    Title = "BLE Stop";

    Function OnTouch( e ) {
        var serviceUUID = "00000000-1111-2222-3333-4444-555555555555";
        var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
        //.peripheral.StopNotify(serviceUUID, characteristicUUID);
    }
}

Related item

StopNotify method、CharacteristicChanged event


BluetoothPeripheral.StopNotify method

iOSAndroidWindows

Explanation

Terminates receiving events for changes in the specified characteristic (≒property).

Call format

peripheral.StoptNotify( serviceUuid , characteristicUuid )

Return value

None

argument

String serviceUuid

UUID to identify the service

String characteristicUuid

UUID to identify the characteristic

exception

FUNC-4

The value of the argument is invalid.

RTM-124

Not connected to device

RTM-83

Bluetooth is not enabled.

RTM-73

Could not complete the write operation.

RTM-78

Communication with the Bluetooth device has timed out.

RTM-79

Unknown service ID.

RTM-80

Unknown characteristic ID.

Example of use

BluetoothPeripheral peripheral {
    Function onCharacteristicChanged(e) {
        /* event processing */
    }

}
Button btnBleConnect {
    X = 16;
    Y = 576;
    Width = 104;
    Height = 40;
    Title = "BLE connection";

    Function OnTouch( e ) {
        //.peripheral.Connect(deviceId);
    }
}
Button btnBleStartNotifyBatteryService {
    X = 128;
    Y = 624;
    Width = 104;
    Height = 40;
    Title = "BLE Start";

    Function OnTouch( e ) {
        var serviceUUID = "00000000-1111-2222-3333-4444-555555555555";
        var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
        var data = //.peripheral.StartNotify(serviceUUID, characteristicUUID);
    }
}
Button btnBleStopNotifyBatteryService {
    X = 240;
    Y = 624;
    Width = 104;
    Height = 40;
    Title = "BLE Stop";

    Function OnTouch( e ) {
        var serviceUUID = "00000000-1111-2222-3333-4444-555555555555";
        var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
        //.peripheral.StopNotify(serviceUUID, characteristicUUID);
    }
}

Related item

StartNotify method


BluetoothPeripheral event

API version 15

Event

iOSAndroidWindows

The following events are defined in the BluetoothPeripheral class.

API | name | Explanation
15 | CharacteristicChanged | Issued when a change in the characteristic is received.

Class overview

Base class evnets


BluetoothPeripheral.CharacteristicChanged evnet

API version 15

BluetoothPeripheral.CharacteristicChanged event

iOSAndroidWindows

It is issued when a change in the characteristic specified in the StartNotify method is received.

The following child objects are attached to the Event object.

type | name | Explanation
String | ServiceUuid | UUID to identify the service
String | CharactaristicUuid | UUID to identify the characteristic
ByteArray | Data | The value of the characteristic after the change.


BluetoothSocket class

iOSAndroidWindows

Object
 | BluetoothSocket

This class is used for communication using Bluetooth SPP.

In addition to being generated by itself and used as a client, it may be automatically generated as a server socket by the BluetoothSocketListener class.

Default properties and ValueTypepe

The default property is Value.The ValueType can be String, Number, Fixed, or Date.


BluetoothSocket property

API version 15

Property

iOSAndroidWindows

The following properties are defined in the BluetoothSocket class.

API | name | access | type | Initial value | Explanation
15 | Host | R | String |  | BD address to connect to
15 | IsConnected | R | boolean |  | Whether the socket is connected or not
15 | Timeout | CRW | integer | 0 | Timeout values for Read and ReadLine methods
15 | Value | CRW | String Number Fixed Date |  | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


BluetoothSocket.Host property

iOSAndroidWindows

The BD address of the connection destination is stored. (The format of the BD address is the same as that of the MAC address.)

This property is read-only and cannot be modified.


BluetoothSocket.IsConnected property

iOSAndroidWindows

The value is $TRUE if the socket is already connected, otherwise it is $FALSE.

This property is read-only and cannot be modified.


BluetoothSocket.Timeout property

iOSAndroidWindows

Specifies the timeout period in seconds for the Read and ReadLine methods.

The default is 0 (do not wait for reception).


BluetoothSocket.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


BluetoothSocket method

API version 15

Method

iOSAndroidWindows

The following methods are defined in the BluetoothSocket class.

API | name | explanation
15 | Close | Close the socket.
15 | Open | Open the socket.
15 | Read | Reads data from the socket
15 | ReadLine | Reads a single line of string data from the socket
15 | Write | Write data to the socket
15 | WriteString | Writes string data to the socket

Class overview

Base class methods


BluetoothSocket.Close method

iOSAndroidWindows

Explanation

Close the socket and disconnect the connection.

Be sure to close the socket opened by the Open method, etc., after reading or writing is completed.

Call format

btSock.Close()

Return value

None

argument

None

exception

RTM-71

Socket is not open.

Example of use

BluetoothSocket btSock = new BluetoothSocket;
btSock.Timeout = 60;
btSock.Open("11:22:33:44:55:66");

while (true) {
    var data = btSock.Read(256);

    if (data.length <= 0) {
        break;
    }

    print(data);
    btSock.Write(data);
}
btSock.Close();

Related item

Open method


BluetoothSocket.Open method

API version 15

BluetoothSocket.Open methodChange History

iOSAndroidWindows

Explanation

Create a socket for the host Bluetooth device and connect to it.

Call format

btSock.Open( address )

Return value

None

argument

String address

BD address of the connection destination (the format of BD address is the same as MAC address)

exception

RTM-68

The socket is already open.

RTM-74

Unable to connect to the specified device

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

Example of use

BluetoothSocket btSock = new BluetoothSocket;
btSock.Timeout = 60;
btSock.Open("11:22:33:44:55:66");

while (true) {
    var data = btSock.Read(256);

    if (data.length <= 0) {
        break;
    }

    print(data);
    btSock.Write(data);
}
btSock.Close();

Related item

Close method

Change History
*1　The specification has been changed since API version 26.


BluetoothSocket.Read method

iOSAndroidWindows

Explanation

Reads data from the socket.

The process will not return until the specified size of data is received or the timeout occurs.

Call format

var data= btSock.Read( size )

Return value

ByteArray object containing the read data.

argument

integer size

Size to read. Specify the size in bytes.

If omitted, negative values are assumed to be 4096.

exception

RTM-71

Socket is not open.

RTM-72

Could not complete the read operation.

RTM-75

Connection rejected.

Example of use

BluetoothSocket btSock = new BluetoothSocket;
btSock.Timeout = 60;
btSock.Open("11:22:33:44:55:66");

while (true) {
    var data = btSock.Read(256);

    if (data.length <= 0) {
        break;
    }

    print(data);
    btSock.Write(data);
}
btSock.Close();

Related item

ReadLine、Write method


BluetoothSocket.ReadLine method

iOSAndroidWindows

Explanation

Reads a single line of string data from the socket.

This function reads the string data from the current read position of the socket to the next newline character.

The process will not return until one line is received or timeout. Any error other than a timeout will result in an exception.

Call format

var data = btSock.ReadLine()

Return value

Returns the read string data as a String object.

Newline characters at the end of the line are not included. If the end of the data is reached and no more can be read, an empty string will be returned.

argument

None

exception

RTM-71

Socket is not open.

RTM-72

Could not complete the read operation.

RTM-75

Connection rejected.

Example of use

BluetoothSocket btSock = new BluetoothSocket;
btSock.Timeout = 60;
btSock.Open("11:22:33:44:55:66");

while (true) {
    var data = btSock.ReadLine();

    if (data.length <= 0) {
        break;
    }

    print(data);
    btSock.WriteString(data);
}
btSock.Close();

Related item

Read、WriteString method


BluetoothSocket.Write method

iOSAndroidWindows

Explanation

Writes data to the socket.

Automatically converts data to byte data according to the data type.

Call format

btSock.Write( data )

Return value

None

argument

data

Data to be written

exception

RTM-10

The type of output data is unknown. The number of bytes to be output is unknown.

RTM-73

Could not complete the write operation.

RTM-75

Connection rejected.

Example of use

BluetoothSocket btSock = new BluetoothSocket;
btSock.Timeout = 60;
btSock.Open("11:22:33:44:55:66");

while (true) {
    var data = btSock.Read(256);

    if (data.length <= 0) {
        break;
    }

    print(data);
    btSock.Write(data);
}
btSock.Close();

Related item

WriteString、Read method

The difference in writing format for each data type

Depending on the data type of the variable specified for data, the format to be written will be as follows.

data type | example | Explanation
String | Write("abc") Write(new String("abc")); | character string data String data will be written in UTF-8.
integer | Write(10) | Integer value data It is written as 4 bytes of signed integer data.
boolean | Write(true) | bool-value data It is written as 4 bytes of signed integer data. The value is 1 if true, 0 if false.
Number | Write(1.2) Write(new Number(10)) | Numeric (floating point) data The data is written as 8 bytes of floating point data.
Date | Write(new Date()) | Date data The value of the Value property will be written as 8 bytes of floating point data.
ByteArray | Results read by the Read method, etc. | binary data Binary data will be written as is.

If you always want to write as a string, use the WriteString method.


BluetoothSocket.WriteString method

iOSAndroidWindows

Explanation

Writes string data to the socket.

Converts data to a string and sends it.

Call format

btSock.WriteString( data )

Return value

None

argument

String data

String data to be written

exception

RTM-71

Socket is not open.

RTM-73

Could not complete the write operation.

RTM-75

Connection rejected.

Example of use

BluetoothSocket btSock = new BluetoothSocket;
btSock.Timeout = 60;
btSock.Open("11:22:33:44:55:66");

while (true) {
    var data = btSock.ReadLine();

    if (data.length <= 0) {
        break;
    }

    print(data);
    btSock.WriteString(data);
}
btSock.Close();

Related item

Write、ReadLine method


BluetoothSocket event

API version 15

Event

iOSAndroidWindows

The following events are defined in the BluetoothSocket class.

API | name | explanation
15 | Receive | Notifies the user that data is ready to be received

Class overview

Base class events


BluetoothSocket.Receive event

iOSAndroidWindows

This event occurs when data is ready to be received.


BluetoothSocketListener class

iOSAndroidWindows

Object
 | BluetoothSocketListener

Create a server socket for Bluetooth SPP communication and wait for reception.

When a connection is made from a client, a BluetoothSocket object is created as a child object.

Create a BluetoothSocketListener object and call the Start method to wait for the socket.

Default properties and ValueType

The default property is Value.The ValueType can be String, Number, Fixed, or Date.


BluetoothSocketListener property

API version 15

Property

iOSAndroidWindows

The following properties are defined in the BluetoothSocketListener class.

API | name | access | type | Explanation
15 | IsListening | R | boolean | Whether a socket is waiting or not.
15 | Value | CRW | String Number Fixed Date | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


BluetoothSocketListener.IsListening property

iOSAndroidWindows

If the object is waiting for a socket, it is $TRUE; otherwise, it is $FALSE.

This property is read-only and cannot be modified.


BluetoothSocketListener.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


BluetoothSocketListener method

API version 15

メソッド

iOSAndroidWindows

The following methods are defined in the BluetoothSocketListener class.

API | name | Explanation
15 | Start | Start waiting for reception
15 | Stop | Stop waiting for reception

Class overview

Base class methods


BluetoothSocketListener.Start method

API version 15

BluetoothSocketListener.Start methodChange History

iOSAndroidWindows

Explanation

Start waiting for a socket to be received.

Waiting for an event is stopped by calling the Stop method.

It also stops listening for events when the BluetoothSocketListener object disappears, but the processing timing for the object's disappearance is indefinite.

Be sure to call the Stop method to stop it.

Call format

btSockListener.Start()

Return value

None

argument

None

exception

RTM-68

The socket is already open.

RTM-70

Failed to wait for reception.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

Example of use

BluetoothSocketListener  btSoclListener {
    Function OnAccept(e) {
        Stop();
    }
    Function OnReceive(e) {
        var data = e.From.ReadLine();
        print(data);
    }
    if (!$DESIGNTIME) {
        Start();
    }
}

Related item

Stop method

Change History
*1　The specification has been changed since API version 26.


BluetoothSocketListener.Stop method

iOSAndroidWindows

Explanation

Stops waiting for a socket to be received.

It also stops listening for events when the BluetoothSocketListener object disappears, but the processing timing for the object's disappearance is indefinite.

If you start the waiting process with the Start method, be sure to call the Stop method to stop it.

Call format

btSockListener.Stop()

Return value

None

argument

None

exception

None

Example of use

BluetoothSocketListener  btSoclListener {
    Function OnAccept(e) {
        Stop();
    }
    Function OnReceive(e) {
        var data = e.From.ReadLine();
        print(data);
    }
    if (!$DESIGNTIME) {
        Start();
    }
}

Related item

Start method


BluetoothSocketListener event

API version 15

Event

iOSAndroidWindows

The following events are defined in the BluetoothSocketListener class.

API | name | Explanation
15 | Accept | Occurs when a connection is made from a client socket.

Class overview

Base class events


BluetoothSocketListener.Accept event

iOSAndroidWindows

This event is fired when a connection is established from a client socket to a server socket waiting in the Start method.

The following child objects are attached to the Event object.

type | name | Explanation
String | SocketName | Stores the name of the BluetoothSocket object created by the connection.

SocketName is set to the name of the BluetoothSocket object created by the connection.

The BluetoothSocket object is automatically connected to the BluetoothSocketListener as a child object.

For example, you can get the BluetoothSocket generated by FindChild(e.SocketName).

Delete the BluetoothSocket object with the Delete method when communication is finished and it is no longer needed.

When data arrives at the generated BluetoothSocket and the Receive event occurs, the event is propagated to the parent object, BluetoothSocketListener.

It is possible to write the event handler OnReceive in the BluetoothSocketListener object, identify the BluetoothSocket object by e.From, and implement the receiving process.


CodeScannerView class

iOSAndroidWindows

Object
 | NetObject
 |  | DisplayObject
 |  |  | CodeScannerView

Class for displaying camera images on the Biz/Browser screen and reading barcodes and 2D codes reflected in the images.

(Barcode Symbols and 2D Code Symbols are referred to as "Symbols" below.)

To read a symbol, use the ShowCamera method to display the camera image, and then use the StartCodeScanner method to display the UI for reading.

The information of the read symbol is received in the CodeScanned event.

When reading symbols, the type of symbol to be read and options for reading can be specified in the same way as in the Runtime.ShowCodeScanner method.

Default properties and ValueType

The default property is Value.The ValueType can be String, Number, Fixed, or Date.


CodeScannerView property

API version 19

Property

iOSAndroidWindows

The following properties are defined in the CodeScannerView class.

API | name | access | type | Initial value | Explanation
19 | Border | CR | boolean | $FALSE | Specify the display of the frame
28 | BorderColor | CRW | integer | $STD | Border color
19 | Value | CRW | String Number Fixed Date |  | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


CodeScannerView.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


CodeScannerView method

API version 19

Method

iOSAndroidWindows

The following methods are defined in the CodeScannerView class.

API | name | Explanation
19 | HideCamera | Shut down the camera
19 | ShowCamera | Activate the camera and display the image.
19 | StartCodeScanner | Display the UI for reading and start reading
19 | StopCodeScanner | End reading

Class overview

Base class method


CodeScannerView.HideCamera method

iOSAndroidWindows

Explanation

Quits the camera started by the ShowCamera method.

If the scan was started by the StartCodeScanner method, it will also be stopped.

Call format

codeScannerView.HideCamera( )

Return value

None

argument

None

exception

RTM-46

Camera operation failed.

EXT-27

Initialization is not complete.

Example of use

CodeScannerView codeScannerView {
    X = 10;
    Y = 10;
    Width = 200;
    Height = 300;
    Function onCodeScanned(e) {
        print("Format:" + str(e.Format) + " Data:" + e.Data + "\n");
    }
}

Button btnStartScan {
    X = 10;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan start";

    Function OnTouch( e ) {
        try {
            /* Camera display */
            ^.codeScannerView.ShowCamera(Runtime.SourceTypeRearCamera, $TRUE);

            /* Reads EAN13 barcodes and QR codes only */
            var format = Runtime.CODE_FORMAT_EAN13 + Runtime.CODE_FORMAT_QR_CODE;

            /* Replaces UPC-A barcode with EAN13 barcode */
            var extraParams = new Array;
            extraParams["CONVERT_UPCA_TO_EAN13"] = true;

            /* Specifies the sound to be heard when reading */
            var rtm = new Runtime;
            Number soundId = rtm.LoadSound("sound.wav");
            extraParams["SCAN_SOUND_ID"] = soundId;

            /* Start of reading */
            ^.codeScannerView.StartCodeScanner(format, extraParams, rtm);
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Button btnStopScan{
    X = 120;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan stop";

 Function OnTouch( e ) {
        try {
            /* Scan stop */
            ^.codeScannerView.StopCodeScanner();

            /* Camera shutdown */
            ^.codeScannerView.HideCamera();
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Related item

ShowCamera method


CodeScannerView.ShowCamera method

iOSAndroidWindows

Explanation

Activate the camera and display the camera image.

To read a barcode or 2D barcode in the video, call the StartCodeScanner method.

Call format

codeScannerView.ShowCamera( sourceType [, cameraFlash ])

Return value

None

argument

integer sourceType

Specifies the target to retrieve images from.

The values that can be specified are as follows

constant | value | Explanation
Runtime.SourceTypeRearCamera | 2 | Activate the rear camera (on the back of the device) to read the data.
Runtime.SourceTypeFrontCamera | 3 | Activate the front camera (LCD side) to read the data.

boolean cameraFlash

Specifies the initial state of the camera flash (LED).

On=true, Off=false; default is false.

exception

FUNC-4

Invalid argument value

RTM-46

Camera operation failed.

EXT-27

Initialization is not complete.

Example of use

CodeScannerView codeScannerView {
    X = 10;
    Y = 10;
    Width = 200;
    Height = 300;
    Function onCodeScanned(e) {
        print("Format:" + str(e.Format) + " Data:" + e.Data + "\n");
    }
}

Button btnStartScan {
    X = 10;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan start";

    Function OnTouch( e ) {
        try {
            /* Camera display */
            ^.codeScannerView.ShowCamera(Runtime.SourceTypeRearCamera, $TRUE);

            /* Reads EAN13 barcodes and QR codes only */
            var format = Runtime.CODE_FORMAT_EAN13 + Runtime.CODE_FORMAT_QR_CODE;

            /* Replaces UPC-A barcode with EAN13 barcode */
            var extraParams = new Array;
            extraParams["CONVERT_UPCA_TO_EAN13"] = true;

            /* Specifies the sound to be heard when reading */
            var rtm = new Runtime;
            Number soundId = rtm.LoadSound("sound.wav");
            extraParams["SCAN_SOUND_ID"] = soundId;

            /* Start of reading */
            ^.codeScannerView.StartCodeScanner(format, extraParams, rtm);
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Button btnStopScan{
    X = 120;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan stop";

 Function OnTouch( e ) {
        try {
            /* Scan stop */
            ^.codeScannerView.StopCodeScanner();

            /* Camera shutdown */
            ^.codeScannerView.HideCamera();
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Related item

HideCamera、StartCodeScanner method


CodeScannerView.StartCodeScanner method

iOSAndroidWindows

Explanation

Start scanning barcodes and 2D barcodes.

By calling this method after calling the ShowCamera method, the UI for reading barcodes and 2D codes will be displayed.

Please note the following points when using the product.

(Barcode Symbols and 2D Code Symbols are referred to as "Symbols" below.)

About reading settings

・In order to prevent false positives and improve performance, it is recommended to narrow down the code type, specify the reading data length, and set the area to be excluded from reading.

Operation during reading

・When reading, move the device so that the symbol you want to read is firmly reflected in the reading area of the reading screen.

・Especially when reading two-dimensional codes (QR Code, DataMatrix, etc.), photograph the symbol from above as much as possible.

About reading accuracy and performance

・The accuracy and speed of symbol recognition depends on your device, operating environment, and the state of the symbols.

・It is not guaranteed that the symbol will always be read correctly. If necessary, add processing such as checking the read data length, verifying the check digit, and checking against the master.

・The number of symbols that can be recognized simultaneously depends on the code type and reading conditions. Especially in the case of 2D codes (QR code, DataMatrix, etc.), there is a possibility that multiple symbols cannot be recognized at the same time.

Call format

codeScannerView.StartCodeScanner( [format [, extraParams [, rtm ]]] )

Return value

None

argument

integer format

Specify a combination of barcode and 2D code types to be read.

By default, Runtime.CODE_FORMAT_ALL is specified.

constant | value | type
Runtime.CODE_FORMAT_CODE128 | 0x0001 | CODE128
Runtime.CODE_FORMAT_CODE39 | 0x0002 | CODE39
Runtime.CODE_FORMAT_CODABAR | 0x0008 | CodaBar(NW-7) * 4
Runtime.CODE_FORMAT_DATA_MATRIX | 0x0010 | DataMatrix
Runtime.CODE_FORMAT_EAN13 | 0x0020 | EAN-13 (JAN-13) * 1
Runtime.CODE_FORMAT_EAN8 | 0x0040 | EAN-8 (JAN-8)
Runtime.CODE_FORMAT_ITF | 0x0080 | ITF (Interleaved Two of Five)
Runtime.CODE_FORMAT_QR_CODE | 0x0100 | QR code * 5
Runtime.CODE_FORMAT_UPCA | 0x0200 | UPC-A * 1
Runtime.CODE_FORMAT_UPCE | 0x0400 | UPC-E
Runtime.CODE_FORMAT_PDF417 | 0x0800 | PDF417
Runtime.CODE_FORMAT_AZTEC | 0x1000 | Aztec
Runtime.CODE_FORMAT_ALL | 0xFFFF | All readable formats * 2 * 3

* 1 : Symbols that are recognized as EAN-13 but have a leading zero are treated as UPC-A.

* 2 : Do not combine it with other constants, but specify it by itself.

* 3 : If additional readable code types are added in the future, those codes will also be readable.

* 4: Only 6 or more characters (8 or more if start-stop characters are included) can be read.

* 5: QR Code Model 1 cannot be read.

Array extraParams

Specify other detailed settings.

This function stores the setting name in the key (string) of the argument Array and the setting value in the value.

Key (string)

Value type

Default value

Explanation

"ALLOW_SAME_SYMBOL"

boolean

true

Specifies the permission to read the same symbol.

Allow reading=true, Disallow reading=false

"CONTINUOUS_MODE"

boolean

false

Specifies the reading mode.

Continuous reading=true, Single reading=false

"CONVERT_UPCA_TO_EAN13"

boolean

false

Replaces the symbol recognized as UPC-A with EAN-13.

(Add 0 at the beginning of the data, and convert from 12 digits to 13 digits.)

enable reading=true, disable reading=false

"MAX_SCAN_COUNT"

integer

0

Specifies the maximum number of readings.

Specify a value of 0 (unlimited) or 1 or more. Values outside the range are assumed to be 0.

"SAME_SYMBOL_SCAN_INTERVAL"

number

1.0

Specifies the time (in seconds) until the same symbol can be read.

Any value greater than or equal to 0 can be specified. Values outside the range are assumed to be 0.

"SCAN_DATA_LENGTH"

integer

or

Array

null

Specifies the length of the data to be read (the length of the character string resulting from reading the code).

If the target data length is different from this specification, the symbol will be ignored even if it is detected.

To allow only a single data length, specify an integer as the value.

If multiple data lengths are allowed, the value should be an Array object with the data length stored as an integer.

If a null or empty Array object is specified, all data lengths will be allowed.

"SCAN_AREA_MARGIN_LEFT"

number

0

Specify the area not to be read from the left edge.

A value between 0.0 and 1.0 can be specified.

For example, if you specify 0.3, 30% of the left side of the screen will be excluded from the reading area.

"SCAN_AREA_MARGIN_TOP"

number

0

Specify the area not to be read from the top edge.

A value between 0.0 and 1.0 can be specified.

For example, if you specify 0.3, the upper 30% of the screen will be excluded from the reading area.

"SCAN_AREA_MARGIN_RIGHT"

number

0

Specify the area not to be read from the right edge.

A value between 0.0 and 1.0 can be specified.

For example, if you specify 0.3, the right 30% of the screen will be excluded from the reading area.

"SCAN_AREA_MARGIN_BOTTOM"

number

0

Specify the area not to be read from the bottom edge.

A value between 0.0 and 1.0 can be specified.

For example, if you specify 0.3, the lower 30% of the screen will be excluded from the reading area.

"SCAN_SOUND_ID"

integer

(blank)

Specifies the sound effect to be played when reading.

The value that can be specified is the sound effect Id obtained by the Runtime.LoadSound method.

If this option is specified, the Runtime object that called the LoadSound method must be specified as an argument.

The sound effect is not played when omitted, when less than 0 is specified, or when an Id that is not loaded at the time of reading is specified.

"SCAN_AREA_TOUCH_MODE"

boolean

false

Set the reading area designation by screen touch.

If "true" is specified, the symbol will be read at the position where the screen is touched.

The size of the read area is specified by SCAN_AREA_TOUCH_SIZE.

The valid time of the read area is specified by SCAN_AREA_TOUCH_TIME.

"SCAN_AREA_TOUCH_SIZE"

number

0.2

Specifies the size of the scan area when the scan area designation by screen touch is enabled.

A value between 0.0 and 1.0 can be specified.

It is a percentage of the short side of the screen.

For example, if the device is in portrait orientation and 0.3 is specified, the area of 30% of the screen width will be read, centered on the screen tap position.

"SCAN_AREA_TOUCH_TIME"

number

5.0

Specify the time in seconds that the reading area is valid when the reading area is specified by touching the screen.

If 0 is specified, the reading area will be fixed until the next time the screen is touched.

"SCAN_AREA_LINE_HORIZONTAL"

number

0.0

Draw a horizontal line on the screen and read only the symbols that overlap the line.

If 0.0 or 1.0 is specified, no horizontal line will be drawn. 0.0 to 1.0 can be specified.

For example, if you specify 0.3, a horizontal line will be drawn at 30% from the top of the screen.

If specified together with SCAN_AREA_LINE_VERTICAL, only the symbols that overlap the intersection of the lines are read.

If SCAN_AREA_TOUCH_MODE is true, it is disabled.

"SCAN_AREA_LINE_VERTICAL"

number

0.0

Draw a vertical line on the screen and read only the symbols that overlap the line.

If 0.0 or 1.0 is specified, the vertical line will not be drawn. 0.0 to 1.0 can be specified.

For example, if 0.3 is specified, a vertical line will be drawn at 30% from the left of the screen.

When specified together with SCAN_AREA_LINE_HORIZONTAL, only the symbols that overlap the intersection of the lines are read.

If SCAN_AREA_TOUCH_MODE is true, it is disabled.

"SHOW_DUPLICATED"

boolean

false

Specifies whether or not to display a mark on the read symbol when false is specified for ALLOW_SAME_SYMBOL.

The interval for judging whether a symbol is the same as a previously read symbol is the value specified in SAME_SYMBOL_SCAN_INTERVAL.

Show mark=true, Do not show mark=false

"DUPLICATED_SOUND_ID"

integer

(blank)

When false is specified for ALLOW_SAME_SYMBOL, this parameter specifies the sound effect to be played when a previously read symbol is read again.

The value that can be specified is the sound effect Id obtained by the Runtime.LoadSound method.

If this option is specified, the Runtime object that called the LoadSound method must be specified as an argument.

The sound effect is not played when omitted, when less than 0 is specified, or when an Id that is not loaded at the time of reading is specified.

The interval for judging whether a symbol is the same as a previously read symbol is the value specified in SAME_SYMBOL_SCAN_INTERVAL.

Runtime rtm

When "SCAN_SOUND_ID" or "DUPLICATED_SOUND_ID" is specified in extraParams, it specifies the Runtime object that plays the audio.

exception

RTM-46

Camera operation failed.

EXT-27

Initialization is not complete.

Example of use

CodeScannerView codeScannerView {
    X = 10;
    Y = 10;
    Width = 200;
    Height = 300;
    Function onCodeScanned(e) {
        print("Format:" + str(e.Format) + " Data:" + e.Data + "\n");
    }
}

Button btnStartScan {
    X = 10;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan start";

    Function OnTouch( e ) {
        try {
            /* Camera display */
            ^.codeScannerView.ShowCamera(Runtime.SourceTypeRearCamera, $TRUE);

            /* Reads EAN13 barcodes and QR codes only */
            var format = Runtime.CODE_FORMAT_EAN13 + Runtime.CODE_FORMAT_QR_CODE;

            /* Replaces UPC-A barcode with EAN13 barcode */
            var extraParams = new Array;
            extraParams["CONVERT_UPCA_TO_EAN13"] = true;

            /* Specifies the sound to be heard when reading */
            var rtm = new Runtime;
            Number soundId = rtm.LoadSound("sound.wav");
            extraParams["SCAN_SOUND_ID"] = soundId;

            /* Start reading */
            ^.codeScannerView.StartCodeScanner(format, extraParams, rtm);
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Button btnStopScan{
    X = 120;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan stop";

 Function OnTouch( e ) {
        try {
            /* Scan stop */
            ^.codeScannerView.StopCodeScanner();

            /* Camera shutdown */
            ^.codeScannerView.HideCamera();
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Related item

ShowCamera、StopCodeScanner method


CodeScannerView.StopCodeScanner method

iOSAndroidWindows

Explanation

Ends the scan started by the StartCodeScanner method.

Call format

codeScannerView.StopCodeScanner( )

Return value

None

argument

None

exception

RTM-46

Camera operation failed.

EXT-27

Initialization is not complete.

Example of use

CodeScannerView codeScannerView {
    X = 10;
    Y = 10;
    Width = 200;
    Height = 300;
    Function onCodeScanned(e) {
        print("Format:" + str(e.Format) + " Data:" + e.Data + "\n");
    }
}

Button btnStartScan {
    X = 10;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan start";

    Function OnTouch( e ) {
        try {
            /* Camera display */
            ^.codeScannerView.ShowCamera(Runtime.SourceTypeRearCamera, $TRUE);

            /* Reads EAN13 barcodes and QR codes only */
            var format = Runtime.CODE_FORMAT_EAN13 + Runtime.CODE_FORMAT_QR_CODE;

            /* Replaces UPC-A barcode with EAN13 barcode */
            var extraParams = new Array;
            extraParams["CONVERT_UPCA_TO_EAN13"] = true;

            /* Specifies the sound to be heard when reading */
            var rtm = new Runtime;
            Number soundId = rtm.LoadSound("sound.wav");
            extraParams["SCAN_SOUND_ID"] = soundId;

            /* Start reading */
            ^.codeScannerView.StartCodeScanner(format, extraParams, rtm);
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Button btnStopScan{
    X = 120;
    Y = 320;
    Width = 100;
    Height = 40;
    Title = "Scan stop";

 Function OnTouch( e ) {
        try {
            /* Scan stop */
            ^.codeScannerView.StopCodeScanner();

            /* Camera shutdown */
            ^.codeScannerView.HideCamera();
        } catch (e) {
            //.MessageBox(e.Method + "-" + str(e.Code));
            //.MessageBox(e.message);
        }
    }
}

Related item

StartCodeScanner method


CodeScannerView event

API version 19

Event

iOSAndroidWindows

The following events are defined in the CodeScannerView class.

API | name | Explanation
19 | CodeScanned | Issued when a barcode is scanned by the StartCodeScanner method.

Class overview

Base class event


CodeScannerView.CodeScannedイベント

iOSAndroidWindows

StartCodeScannerメソッドでバーコードをスキャンした際に発行します。

Eventオブジェクトには以下の子オブジェクトが付加されています。

type | name | Explanation
Number | Format | 読み取ったコードの種別 StartCodeScannerメソッドの引数formatに指定した種別のうちいずれかが格納されます。
String | Data | コードの読取結果の文字列


File class

Object
 | File

A class that manipulates local files.

Default properties and ValueType

The default property is FileName . The value type specification is invalid.


File property

API version 4

Property

iOS Android Windows

The following properties are defined in the File class.

API | name | access | Type | Explanation
4 | FileName | R | String | file name
4 | PathName | R | String | Physical file path

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


File.FileName property

Represents a file name.

The virtual file name specified in the argument of the Open method is stored in the file opened by the FileSystem.Open method. Other than that , the physical file path is stored like the PathName property.

This property is read-only and cannot be changed.


File.PathName property

Contains the physical file path (full path) of the opened file.

This property is read-only and cannot be changed.


File method

API version 4

Method

iOS Android Windows

The following methods are defined in the File class.

API | name | Explanation
4 | Close | Close the file
4 | Read | Read data from a file
4 | ReadBinary | Read binary data from a file
4 | ReadLine | Reads one line of string data from a file
4 | Seek | Moves the current read / write position of the file
4 | Write | Write data to a file
4 | WriteString | Write string data to a file

Class overview

Base class methods


File.Close method

Explanation

Close the file.

Be sure to close the file opened by the FileSystem.Open method etc. after reading and writing.

Call format

f.Close()

Return value

None

argument

None

exception

RTM-8

File is not open

Example of use

var fs = new FileSystem;
var f = fs.Open("hello.txt", FileSystem.OPEN_WRITE);
f.WriteString("hello");
f.Close();

Related item

FileSystem.Open , FileSystem.OpenDialog , FileSystem.SaveDialog methods


File.Read method

Explanation

Read data from a file.

Reads the specified size of data from the current read position of the file.

Call format

var data = f.Read([ size ])

Return value

Returns the read data as a ByteArray object

If there is no data to read, it returns an empty ByteArray.

argument

integer size

Size to read

Specify in bytes. If omitted or specified -1, the file is read to the end.

exception

RTM-8

File is not open

Example of use

var fs = new FileSystem;
var fr = fs.Open("hello1.txt", FileSystem.OPEN_READ);
var fw = fs.Open("hello2.txt", FileSystem.OPEN_WRITE);
while(true){
    var data = fr.Read(256);
    if(data.Length <= 0){
        break;
    }
    print(data);
    fw.Write(data);
}
fr.Close();
fw.Close();

Related item

ReadLine , Write method


File.ReadBinary method

Explanation

Read binary data from a file.

Reads the specified size of data from the current read position in the file and returns it as a ByteArray object.

Call format

var data = f.ReadBinary([ size ])

Return value

ByteArray object of read binary data

argument

integer size

Size to read

Specify in bytes. If omitted or specified as -1, the file is read to the end.

exception

RTM-8

File is not open

Example of use

var fs = new FileSystem;
var fr = fs.Open("hello1.dat", FileSystem.OPEN_READ);
var fw = fs.Open("hello2.dat", FileSystem.OPEN_WRITE);
while(true){
    var data = fr.ReadBinary(256);
    if (data.Length <= 0){
        break;
    }
    fw.Write(data);
}
fr.Close();
fw.Close();

Related item

Read , ReadLine , Write methods

ByteArray class


File.ReadLine method

Explanation

Reads one line of character string data from the file.

Reads the character string data from the current read position of the file to the next newline character.

Call format

var data = f.ReadLine()

Return value

Read character string data

It also includes a newline character at the end of the line. Returns null if the end of the file is reached and no more can be read.

argument

None

exception

RTM-8

File is not open

Example of use

var fs = new FileSystem;
var fr = fs.Open("hello1.txt", FileSystem.OPEN_READ);
var fw = fs.Open("hello2.txt", FileSystem.OPEN_WRITE);
while(true){
    var data = fr.ReadLine();
    if(data == null){
        break;
    }
    print(data);
    fw.WriteString(data);
}
fr.Close();
fw.Close();

Related item

Read , WriteString methods


File.Seek method

Explanation

Moves the current read / write position of the file.

Call format

f.Seek( offset )

Return value

None

argument

integer offset

New position

Specify in bytes.

exception

RTM-8

File is not open

Example of use

var fs = new FileSystem;
var f = fs.Open("hello.txt", FileSystem.OPEN_READ);
f.Seek(100);
var data = f.Read(10);
print(data, "\n");
f.Close();

Related item


File.Write method

Explanation

Write data to a file.

Writes the specified data to the current write position of the file.

Call format

f.Write( data )

Return value

None

argument

data

Data to write

exception

RTM-8

File is not open

Example of use

var fs = new FileSystem;
var fr = fs.Open("hello1.txt", FileSystem.OPEN_READ);
var fw = fs.Open("hello2.txt", FileSystem.OPEN_WRITE);
while(true){
    var data = fr.Read(256);
    if(data.Length <= 0){
        break;
    }
    print(data);
    fw.Write(data);
}
fr.Close();
fw.Close();

Related item

Read , ReadBinary , WriteString methods

Difference in writing format for each data type

data depending on the data type of the variable that you want to specify the format to be written as follows.

Data type | Example | Explanation
String | Write("abc") Write(new String("abc")); | String data The string data is written in UTF-8.
integer | Write(10) | Integer value data Written as 4-byte signed integer data.
Number | Write(1.2) Write(new Number(10)) | Numerical (floating point) data Written as 8-byte floating point data.
Date | Write(new Date()) | Date data The value of the Value property is written as 8-byte floating point data
ByteArray | In the ReadBinary method Results read | Binary data The binary data is written as is.

If you always want to write as a string , use the WriteString method.


File.WriteString method

Explanation

Writes the string data to the file.

Writes the specified character string data to the current write position of the file.

Call format

f.WriteString( data )

Return value

None

argument

String data

Character string data to write

exception

RTM-8

File is not open

Example of use

var fs = new FileSystem;
var fr = fs.Open("hello1.txt", FileSystem.OPEN_READ);
var fw = fs.Open("hello2.txt", FileSystem.OPEN_WRITE);
while(true){
    var data = fr.ReadLine();
    if(data == null){
        break;
    }
    print(data);
    fw.WriteString(data);
}
fr.Close();
fw.Close();

Related item

ReadLine , Write method


File event

API version 4

Event

iOS Android Windows

There are no events defined in the File class.

Class overview

Base class event


FileSystem class

API version 4

FileSystem class change history

Object
 | FileSystem

This class operates the file system of the client device.

Default property and ValueType

The default property is PathName . The ValueType specification is invalid.

Virtual file name

The FileSystem class handles the file name as a virtual file name. A virtual file name is a file name with a limited access range, which maps a specific folder as a root folder. Only files under the root folder are accessible, and not all files on your computer can be accessed directly without your permission.

Folders that map to the root folder differ depending on the attributes (public or private) specified when the FileSystem object is initialized.

The virtual file name format is similar to the Windows file system, except that the files and folders are separated by "/" (slash).

The virtual file name is treated as a relative path based on the current folder. If you specify an absolute path starting from "/", it is treated as an absolute path from the root folder regardless of the current folder. By default, the current folder points to the root folder.

You can get the current folder with the PathName property and change it with the ChangeDir method.

(Example)

(Root folder)
  ├ file1.txt ･ ･ ･ (1)
  └ folder1 ･ ･ ･ (2)
     ├ file2.txt ･ ･ ･ (3)
     └ folder2 ･ ･ ･ (4)
        └ file3.txt ･ ･ ･ (5)

 | Current folder | Relative path | Absolute path
(1) | / | file1.txt | /file1.txt
 | /folder1 | ../file1.txt
 | /folder1/folder2 | ../../file1.txt
(2) | / | folder1 | /folder1
 | /folder1 | .
 | /folder1/folder2 | ..
(3) | / | folder1/file2.txt | /folder1/file2.txt
 | /folder1 | file2.txt
 | /folder1/folder2 | ../file2.txt
(4) | / | folder1/folder2 | /folder1/folder2
 | /folder1 | folder2
 | /folder1/folder2 | .
(5) | / | folder1/folder2/file3.txt | /folder1/folder2/file3.txt
 | /folder1 | folder2/file3.txt
 | /folder1/folder2 | file3.txt

Public attribute

FileSystem object with public attribute specified in the constructor maps the following folders as root folders.

OS | Root folder
Android | /storage/emulated/0/Android/data/jp.co.opst.bizht.v1/files/FileSystem/root * 1 * 2

Folders that are mapped with public attributes are common to all CRS applications, so you can share files between multiple CRS applications, but file names can collide and file contents can be referenced incorrectly There is a possibility.

Private attribute

FileSystem object with private attribute specified in the constructor maps the following folders to the root folder.

OS | Root folder
Android OS | /data/data/jp.co.opst.bizht.v1/files/FileSystem/private_root/(server name) * 1 * 3 This directory can be accessed only from Biz / Browser HT.

Folders that are mapped with private attributes contain the name of the server that downloaded the CRS application, so you can manage files individually for each server. It cannot be accessed from a CRS program downloaded from another server.

In addition, the FileSystem object of private attribute can mount any folder that the user has permitted to the virtual file name using the Mount method.

Access outside the root folder

There are the following methods to access any file other than the root folder.

· Open a specific file selected by the user with the OpenDialog and SaveDialog methods

· Mount by the method to mount a folder that the user has permission to the virtual file name (in the case of a private attribute)

Properties | Methods | Events

Change history
* 1 Please note that the path may be different when using the multi-user function of Android OS version.
* 2 With Biz/Browser AI (API Ver.6 or earlier), it is "/sdcard/Android/data/jp.co.opst.bizai.v2/files/FileSystem/root".
* 3 With Biz/Browser AI (API Ver.6 or earlier), it is "/data/data/jp.co.opst.bizai.v2/files/FileSystem/private_root/(server name)".


FileSystem property

API version 4

Property

iOS Android Windows

The following properties are defined in the FileSystem class.

API | name | access | Type | Explanation
4 | PathName | R | String | Virtual file name of the current folder

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


FileSystem.PathName property

Represents the virtual file name of the current folder.

This property is read-only and cannot be changed.

For the handling of the current folder, refer to the section of virtual file name .


FileSystem method

API version 4

Method

iOS Android Windows

The following methods are defined in the FileSystem class.

API | name | Explanation
4 | ( Constructor ) | Initializes the FileSystem object
4 | ChangeDir | Change the current folder
4 | Copy | Copy files / folders
21 | CopyDirectoryFromExternalStorage | Copy a directory from an external storage
21 | CopyFileFromExternalStorage | Copy a file from an external storage
4 | CreateDir | Create a new folder
4 | CreateTempFile | Create a temporary file
4 | DeleteFile | Delete files / folders
4 | Exists | Check for the existence of files / folders
4 | FindFiles | Get a list of files and folders in a folder
20 | GetFileTime | Get the date information of the file
4 | GetLength | Get the file size
4 | IsDirectory | Check if the virtual file name is a folder
4 | IsFile | Check if the virtual file name is a file
4 | List | Get a list of files and folders in a folder
4 | ListFiles | Get a list of files in a folder
4 | MakePath | Create a virtual file name from a string
12 | MapContentUri | Convert virtual file name to Android OS "content: //" format URI
4 | MapPath | Convert virtual file names to physical file names
4 | Mount | Mount the folder
4 | Open | Open the file
4 | OpenDialog | Select the file to open in the dialog
4 | Rename | Rename files / folders and move files / folders
4 | SaveDialog | Select the file to save in the dialog
4 | SplitPath | Split the virtual file name into each element
4 | Suffix | Extract the extension from the file name
4 | Unmount | Unmount

Class overview

Base class methods


FileSystem constructor

API version 4

FileSystem constructor change history

iOS Android Windows

Explanation

Initialize the FileSystem object.

The FileSystem object can have public or private attributes .

Public attributes share the same root folder regardless of the application.

Private attributes have a separate root folder for each server.

Call format

var fs = new FileSystem([ attr ])

Return value

FileSystem object

argument

integer attr

FileSystem object attributes

Specify the following values.

constant | Explanation
FileSystem.PUBLIC_ROOT | Initialize with public attributes
FileSystem.PRIVATE_ROOT | Initialize with private attributes
FileSystem.REMOVABLE_PUBLIC_ROOT * 1 | Initialize the application-specific directory of removable storage such as SD card as the root folder. The actual path will vary depending on the device. External storage connected via USB is not supported.

If omitted, it will be initialized with the public attribute.

exception

RTM-28

Unable to create root folder

RTM-29

Illegal attribute

Example of use

var fs = new FileSystem(FileSystem.PRIVATE_ROOT);

Related item

Change history
* 1 Added from API version 21.


FileSystem.ChangeDir method

Explanation

Change the current folder.

For the handling of the current folder, refer to the section of virtual file name .

Call format

var f = fs.ChangeDir( path )

Return value

Returns $TRUE if the current folder can be changed, $FALSE otherwise.

argument

String path

Virtual file name of the new current folder

exception

None

Example of use

var fs = new FileSystem;
fs.ChangeDir("/app");
var size = fs.GetLength("sample.txt");
print(size, "\n");

Related item

PathName property


FileSystem.Copy method

Explanation

Copy the file or folder.

If you specify a folder name, all files and subfolders contained in the folder are also copied.

If a file or folder with the same name as the copy destination already exists, the behavior is as follows.

Original | Copy to | motion
File | File | The overwrite confirmation dialog is displayed. Select OK to overwrite the file.
File | folder | The copy source file is copied into the copy destination folder.
folder | File | The overwrite confirmation dialog is displayed. Select OK to delete the file and copy the folder.
folder | folder | The copy source folder is copied into the copy destination folder.

If you need to create a folder, a confirmation dialog will appear.

If there is an error in the file operation, a message box will be displayed.

Call format

var f = fs.Copy ( srcFile , destFile [, flag ])

Return value

Returns $TRUE if the copy completes successfully, $FALSE otherwise.

argument

String srcFile

Copy source virtual file name

String destFile

Copy destination virtual file name

integer flag

Specify the operation with the following combination

constant | Explanation
FileSystem.NOCONFIRM | Do not display confirmation dialog
FileSystem.NOERRORUI | Does not display an error

If flag is omitted

・ Display confirmation dialog

・ A message box is displayed when an error occurs.

It will be.

exception

None

Example of use

var fs = new FileSystem;
if(fs.Copy("/app1", "/app2", FileSystem.NOCONFIRM + FileSystem.NOERRORUI)) {
    MessageBox("copied");
}

Related item

DeleteFile , Rename method


FileSystem.CopyDirectoryFromExternalStorage method

iOSAndroidWindows

Explanation

Copy the directory from an external storage, such as a USB-connected storage device.

When this method is called, the directory selection screen will be displayed, and the selected directory and files/directories under the directory will be copied.

However, some directories may not be able to be selected as the copy source due to OS limitations.

Call format

fs.CopyDirectoryFromExternalStorage( path [, mode] )

Return value

None

argument

String path

Specify the path of the destination directory.

If the path of an existing directory is specified, the file will be saved under the specified directory.

integer mode

Specifies the behavior for overwrite saving.

Specify the following values:

constant | Value | Explanation
FileSystem.ALWAYS_OVERWRITE | 0 | Always overwrite.
FileSystem.NOT_COPY_FILE_EXISTS | 1 | First check if overwriting will occur, and if it does, raise exception RTM-131 or RTM-132, and do not copy.
FileSystem.STOP_COPY_FILE_EXISTS | 2 | If a file with the same name is found during copying, it raises exception RTM-131 or RTM-132 at that point, and aborts the copy.
FileSystem.NOT_OVERWRITE | 3 | If a file with the same name is found during copying, it will not be overwritten and copying will continue.

If omitted, the behavior is the same as when FileSystem.ALWAYS_OVERWRITE is specified.

exception

FUNC-4

Wrong argument value

RTM-24

Path is wrong

RTM-131

Failed to operate the file.

RTM-132

This folder already contains a file named 'xxx'.

Example of use

var fs = new FileSystem;
fs.CopyDirectoryFromExternalStorage("/temp", FileSystem.NOT_OVERWRITE);

Related item

CopyFileFromExternalStorage method


FileSystem.CopyFileFromExternalStorage method

iOSAndroidWindows

Explanation

Copy files from an external storage such as a USB-connected storage device.

When this method is called, the file selection screen will be displayed and the selected file will be copied.

However, some directories may not be able to be selected as the copy source due to OS limitations.

Call format

fs.CopyFileFromExternalStorage( path [, mimeType [,mode]])

Return value

None

argument

String path

Specifies the file path to copy to.

If the path of an existing directory is specified, the file will be saved under the specified directory.

String mimeType

Specify a MIME Type such as "image/jpeg".

Only files that correspond to the specified MIME Type will be displayed.

If omitted, the behavior is the same as when "*/*" is specified.

integer mode

Specifies the mode for overwrite saving.

Specify the following values:

constant | Value | Explanation
FileSystem.ALWAYS_OVERWRITE | 0 | Overwrite the file with the same name.
FileSystem.NOT_COPY_FILE_EXISTS | 1 | If a file with the same name exists at the copy destination, the exception RTM-132 will be raised and not copied if it occurs.
FileSystem.NOT_OVERWRITE | 3 | If a file with the same name exists at the copy destination, the process will be terminated without raising an exception.

If omitted, the behavior is the same as when FileSystem.ALWAYS_OVERWRITE is specified.

exception

FUNC-4

Wrong argument value

RTM-24

Path is wrong

RTM-131

Failed to operate the file.

RTM-132

This folder already contains a file named 'xxx'.

Example of use

var fs = new FileSystem;
fs.CopyFileFromExternalStorage("/temp/sample.jpg", "image/jpeg", FileSystem.NOT_OVERWRITE);

Related item

CopyDirectoryFromExternalStorage method


FileSystem.CreateDir method

Explanation

Create a new folder.

Call format

var f = fs.CreateDir ( path )

Return value

Returns $TRUE if the folder can be created, $FALSE otherwise.

argument

String path

Virtual file name of the folder to be created

exception

None

Example of use

var fs = new FileSystem;
if(fs.CreateDir("/newfolder")) {
    MessageBox("created a folder");
}

Related item


FileSystem.CreateTempFile method

Explanation

Create a temporary file.

Temporary files are created in the / temp folder with a name that does not duplicate an existing file name.

The CreateTempFile method not only creates the filename, but actually creates an empty file.

The created file is not deleted automatically, so delete it with the DeleteFile method when you no longer need it .

Call format

var path = fs.CreateTempFile ( prefix )

Return value

Virtual file name of temporary file

Returns null if the file cannot be created.

argument

String preix

Filename prefix for temporary files to create

Up to the first 3 characters are valid. The following characters cannot be used as prefix characters.

\ /:,; *? "<> | And .. (two consecutive periods)

exception

RTM-12

Illegal characters are specified in the file name

Example of use

var fs = new FileSystem;
var temp = fs.CreateTempFile("app");
var f = fs.Open(temp, FileSystem.OPEN_WRITE);
f.Write("Hello");
f.Close();

Related item

DeleteFile , Open method


FileSystem.DeleteFile method

Explanation

Delete the file or folder.

If you specify a folder name, all files and subfolders contained in the folder are also deleted.

A confirmation dialog is displayed before deleting the file or folder. Select OK to delete the files and folders.

If there is an error in the file operation, a message box will be displayed.

Call format

var f = fs.DeleteFile ( filename [, flag ])

Return value

Returns $TRUE if the deletion completes successfully, $FALSE otherwise.

argument

String filename

Virtual file name of the file to be deleted

integer flag

Specify the operation with the following combination

constant | Explanation
FileSystem.NOCONFIRM | Do not display confirmation dialog
FileSystem.NOERRORUI | Does not display an error

If flag is omitted

・ Display confirmation dialog

・ A message box is displayed when an error occurs.

It will be.

exception

None

Example of use

var fs = new FileSystem;
if(fs.DeleteFile("/app", FileSystem.NOCONFIRM + FileSystem.NOERRORUI)) {
    MessageBox("Deleted");
}

Related item

Rename , Copy method


FileSystem.Exists method

Explanation

Check for the existence of files or folders.

Call format

var f = fs.Exists ( filename )

Return value

Returns $TRUE if the specified file or folder exists, $FALSE otherwise.

argument

String filename

Virtual file name of the file or folder to check

exception

None

Example of use

var fs = new FileSystem;
var path = "/app";
if(fs.Exists(path)) {
    if(fs.IsDirectory(path)) {
        MessageBox(path + "is a folder");
    } else if(fs.IsFile(path)) {
        MessageBox(path + "is a file");
    }
}else{
    MessageBox(path + "does not exist");
}

Related item

IsDirectory , IsFile method


FileSystem.FindFiles method

Explanation

Get a list of files and folders in a folder.

Call format

var list = fs.FindFiles([ path [, type ]])

Return value

List of found files and folders

Returns a String array containing the virtual file names.

argument

String path

Virtual file name of the folder to get the list

You can also specify a wildcard with "*" or "?" As part of the file name.

You cannot specify wildcards for folder names (such as "/dir/a*/data.txt").

If path is omitted, all files in the current folder will be searched.

integer type

Types of files to include in the list

Specify the following values.

constant | Explanation
FileSystem.FIND_FILE | Include general files
FileSystem.FIND_FOLDER | Include folders

If you want to include both files and folders

FileSystem.FIND_FILE + FileSystem.FIND_FOLDER

Is specified.

If type is omitted, all searchable types are included.

exception

None

Example of use

var fs = new FileSystem;
var list = fs.FindFiles("/*.txt", FileSystem.FIND_FILE);
for(var f in list){
    print(list[f], "\n");
}

Related item


FileSystem.GetFileTime method

iOSAndroidWindows

Explanation

Get the date information of the file.

Call format

var times = fs.GetFileTime( path )

Call format

Returns an array of Record objects with the following child objects:

Type | name | Explanation
Date | CreationTime | File creation date
Date | LastAccessTime | Last file access date It will be updated only when it is written or read by the File class.
Date | LastWriteTime | Date of last file change

argument

String path

The virtual file name from which to retrieve date information

exception

RTM-13

Specified file 'xxxx' not found

Example of use

var fs = new FileSystem;
var dates = fs.GetFileTime("/sample.doc");
print("creation time:", dates.CreationTime.ToString(),"\n");
print("last access time:", dates.LastAccessTime.ToString(), "\n");
print("last write time:", dates.LastWriteTime.ToString(), "\n");

Related item


FileSystem.GetLength method

Explanation

Get the file size.

Call format

var size = fs.GetLength ( filename )

Return value

File size of the specified file

Returns a number in bytes. Returns -1 if the size cannot be obtained, such as for a file or folder that does not exist.

You can get the file size up to the upper limit of a signed 64-bit integer, but the value has a limit on the number of significant digits in the Number type.

argument

String filename

Virtual file name to get the file size

exception

None

Example of use

var fs = new FileSystem;
var path = "/sample.txt";
if(fs.Exists(path) && fs.IsFile(path)) {
    var len = fs.GetLength(path);
    MessageBox(strf("%1 file size is %2 bytes", path, len));
}

Related item


FileSystem.IsDirectory method

Explanation

Check if the virtual file name is a folder.

Call format

var f = fs.IsDirectory ( filename )

Return value

Returns $TRUE if the specified virtual file name is a folder, $FALSE otherwise.

argument

String filename

Virtual file name to check

exception

None

Example of use

var fs = new FileSystem;
var path = "/app";
if(fs.Exists(path)) {
    if(fs.IsDirectory(path)) {
        MessageBox(path + "is a folder");
    } else if(fs.IsFile(path)) {
        MessageBox(path + "is a file");
    }
}else{
    MessageBox(path + "does not exist");
}

Related item

Exists , IsFile method


FileSystem.IsFile method

Explanation

Checks if the virtual file name is a file.

Call format

var f = fs.IsFile ( filename )

Return value

Returns $TRUE if the specified virtual file name is a file, $FALSE otherwise.

argument

String filename

Virtual file name to check

exception

None

Example of use

var fs = new FileSystem;
var path = "/app";
if(fs.Exists(path)) {
    if(fs.IsDirectory(path)) {
        MessageBox(path + "is a folder");
    } else if(fs.IsFile(path)) {
        MessageBox(path + "is a file");
    }
}else{
    MessageBox(path + "does not exist");
}

Related item

Exists , IsDirectory method


FileSystem.List method

Explanation

Replaced by the FindFiles method.

Remained for compatibility with past versions.

Get a list of files and folders in a folder.

Call format

var list = fs.List( path )

Return value

List of found files and folders

Returns a String array containing the virtual file names.

argument

String path

Virtual file name of the folder to get the list

You can also specify wildcards with * or?.

exception

None

Example of use

var fs = new FileSystem;
var list = fs.List("/");
for(var f in list){
    print(list[f], "\n");
}

Related item

FindFiles method


FileSystem.ListFiles method

Explanation

Replaced by the FindFiles method.

Remained for compatibility with past versions.

Get a list of files in a folder. The target files are only normal files and do not include folders or special files.

Call format

var list = fs.ListFiles( path )

Return value

List of files found

Returns a String array containing the virtual file names.

argument

String path

Virtual file name of the folder to get the list

You can also specify wildcards with * or?.

exception

None

Example of use

var fs = new FileSystem;
var list = fs.ListFiles("/*.txt");
for(var f in list){
    print(list[f], "\n");
}

Related item

FindFiles method


FileSystem.MakePath method

Explanation

Create a virtual file name from a string.

Connect each specified string with the delimiter "/".

Call format

var path = fs.MakePath( path1 [, path2 [, path3 …]])

Return value

Created virtual file name

It is adjusted so that multiple "/" s are not consecutive.

argument

String path

A string representing each element

exception

None

Example of use

var fs = new FileSystem;
var path = fs.MakePath("/aaa/", "/bbb", "ccc.txt");
print(path, "\n");

Related item

SplitPath , Suffix method


FileSystem.MapContentUri method

Explanation

Converts a virtual file name to a URI of Android OS "content://" format.

If you want to share the file path to an external application with Intent class etc., you need to use the path generated by this method.

Call format

var path = fs.MapContentUri( path )

Return value

Converted "content://" format URI string

argument

String path

Virtual file name to convert

exception

RTM-1

File cannot be mapped to physical path

RTM-24

Invalid path

Example of use

var fs = new FileSystem;
var path = fs.MapContentUri("/temp/sample.doc");
print(path, "\n");

Related item

Intent.Data property, Intent.PutExtra method


FileSystem.MapPath method

Explanation

Converts virtual file names to physical file names.

Call format

var path = fs.MapPath( path )

Return value

Converted physical file name

argument

String path

Virtual file name to convert

exception

RTM-1

File cannot be mapped to physical path

Example of use

var fs = new FileSystem;
var path = fs.MapPath("/temp/sample.doc");
print(path, "\n");

Related item

Mount method


FileSystem.Mount method

Explanation

Mount any folder to the virtual file name.

For example, you will be able to access C:\temp with a virtual file name such as /app/data.

The Mount method can only be called for private attributes and raises an RTM-16 exception for public attributes .

After successful mounting, you can access the mounted folder with the virtual file name. You can unmount it with the Unmount method.

In the mounted state, only the mounted FileSystem object is valid. The mount state is not shared between multiple FileSystem objects.

Security warning dialog

When you call the Mount method, the following security warning dialog is displayed.

The mount will not succeed unless the user selects OK in this dialog. If you choose to cancel, you will get an RTM-19 exception.

The folder to be mounted is the folder selected by the user by "Select another folder". If you specify the name of the folder to be mounted, it will be the initial value for folder selection, but the user's selection will take precedence. You can check which physical folder the user actually selected with the MapPath method.

For security reasons, system attribute folders cannot be selected.

If the normal folder contains the system attribute files or folders, you can select it.

If you check "Don't show this message again" in the security warning dialog and select OK , the warning dialog will not be displayed and the same as the previous time if the conditions for recording mount information described later are met in subsequent mounts. Automatically mount to the folder.

However, if the folder has been deleted and cannot be accessed, or if the folder has changed to a state where it cannot be specified as a mount target, the security warning dialog will be displayed again.

Mount point

The mount point is the virtual file name to access the folder to mount.

You cannot specify the root folder ("/") for the mount point. You must always specify a name.

If it is already mounted on the same mount point, you will get an RTM-17 exception.

The mount point does not need to have an actual folder. For example, / app / data can be the mount point even if there are no folders other than the root folder. If the actual folder exists at the mount point, it will be hidden by the mount and inaccessible.

Recording mount information to the local computer

If the mount is successful, the information of the mounted folder and security warning dialog will be recorded on the local computer as mount information, and will be used thereafter when mounting under the same conditions.

Mount information is recorded using the following conditions as keys.

-Login user

-The name of the server that downloaded the CRS

-Mount virtual file name

For example, if you select "Don't show this message again" in the security warning dialog, mount using this recorded mount information.

The mount information is deleted when you select Cancel in the Security Warning dialog or when you specify to delete the mount record in the Unmount method.

Difference in operation depending on security level

level | Explanation
0 | No warning dialog is displayed. If the mount information is not recorded in the local computer (the first time mount, etc.), Folder will immediately mount to the folder that you specified in the.
1
2 | After selecting "Don't show message again", the warning dialog is not displayed.
3
4 | Always show a warning dialog.

If $TRUE is specified in the noConfirm parameter, the warning dialog will not be displayed and the mount will be performed.

It is also considered that you have checked "Don't show this message again" in the warning dialog.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

fs.Mount( purpose , path [, folder [, noConfirm ]] )

Return value

None

argument

String purpose

Character string displayed in the "Purpose of use" column of the mount confirmation dialog

String path

Virtual file name to be the mount point

String folder

Folder name to be mounted

If the mount information corresponding to the mount point is recorded on the local computer, it will be ignored.

boolean noConfirm

Do not show mount confirmation dialog

exception

RTM-16

No mount operations other than private file system are possible

RTM-17

The folder is already mounted on the mount point

RTM-18

Registry access error

RTM-19

Mount aborted by user

RTM-23

Cannot be mounted in root folder

RTM-24

The path is invalid

Example of use

var fs = new FileSystem(FileSystem.PRIVATE_ROOT);
var path = "/app/data";
fs.Mount("data folder", path, "c:\\temp");
var f = fs.Open(fs.MakePath(path, "sample.txt"), FileSystem.OPEN_WRITE);
f.WriteString("sample");
f.Close();
fs.Unmount(path);

Related item

FileSystem constructor

MapPath , Unmount method


FileSystem.Open method

Explanation

Open the file.

The opened file is assigned to the File object.

Call format

var f = fs.Open( fileName , mode )

Return value

File object of the opened file

argument

String fileName

Virtual file name of the file to open

integer mode

Open mode

Specify the following values.

constant | Explanation
FileSystem.OPEN_READ | Read mode Specify when reading a file.
FileSystem.OPEN_WRITE | Write mode Specify when writing to a file. If you open an existing file, discard the contents of that file and write from the beginning of the file.
FileSystem.OPEN_APPEND | Addendum mode Specify when writing to a file. If you open an existing file, add it to the contents of that file.

exception

RTM-3

Could not open file'xxx'

RTM-34

This computer does not support the execution block function

RTM-35

The volume path for file'xxx'was not found

RTM-36

Could not access volume information for volume path'xxx'

RTM-37

Volume path'xxx 'does not support execution block function

RTM-38

The zone identification file'xxx' could not be created

RTM-39

Failed to write the zone identification file'xxx'

RTM-40

File attributes can only be specified in OPEN_WRITE mode

Example of use

var fs = new FileSystem;
var f = fs.Open("/sample.txt", FileSystem.OPEN_READ);
var data = f.Read();
f.Close();

Related item

File class


FileSystem.OpenDialog method

Explanation

Select the file to open in the dialog.

Displays the file open dialog and selects the file that the user wants to open. The selected file is opened in read mode and assigned to the File object.

If cancel is selected in the dialog, a PKG-21 exception will be thrown.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

var f = fs.OpenDialog ( title , filter , suffix , fileName )

Return value

File object of the opened file

argument

String title

Title to display in the dialog

String filter

File name filter to display in dialog

Specify the display content and wildcard pair by connecting with "=".

If you specify multiple wildcards, separate them with ";". If you want to specify multiple filters, separate them with "/".

Only valid characters and wildcard characters "*" and "?" Can be specified as the file name. It cannot contain whitespace characters.

(Example)

Filter string | Contents to be displayed | Files displayed
"Text file(*.txt)=*.txt" | Text file(*.txt) | File with extension txt
"Text(*.txt,*.log)=*.txt;*.log" | Text(*.txt,*.log) | Files with extensions txt and log
"Text format=*.txt/Word processor format=*.doc" | Text format | File with extension txt
 | Word processor format | Files with the extension doc
"All files=*.*" | All files | All files

String suffix

Standard extension

If the user does not add an extension to the file name, the three characters from the left of the characters specified in the period and suffix will be adopted as the extension. Only valid characters can be specified in the suffix as the file name.

String fileName

Initial value of file name

You can specify the initial folder by specifying the file name including the absolute path.

exception

RTM-3

Unable to open file

PKG-19

The file name is invalid

PKG-20

Unable to open file selection dialog

PKG-21

File selection has been aborted by the user

Example of use

var fs = new FileSystem;
var f = fs.OpenDialog("Open file", "Text file(*.txt)=*.txt", "txt", "Readme.txt");
var data = f.Read();
f.Close();

Related item

Open , SaveDialog method

File class


FileSystem.Rename method

Explanation

Rename the file or folder.

If the parent folder is different before and after the change, the file or folder will be moved.

If a file or folder with the same name as the changed name already exists, the behavior will be as follows.

Change before | After change | motion
File | File | The overwrite confirmation dialog is displayed. Select OK to overwrite the file.
File | folder | The file before the change will be moved to the folder after the change.
folder | File | The overwrite confirmation dialog is displayed. Select OK to delete the file and move (rename) the folder.
folder | folder | The folder before the change will be moved to the folder after the change.

If you need to create a folder, a confirmation dialog will appear.

If there is an error in the file operation, a message box will be displayed.

Call format

var f = fs.Rename ( oldName , newName [, flag ])

Return value

Returns $TRUE if the renaming completes successfully, otherwise $FALSE.

argument

String oldName

Virtual file name before change

String newName

Virtual file name after change

integer flag

Specify the operation with the following combination

constant | Explanation
FileSystem.NOCONFIRM | Do not display confirmation dialog
FileSystem.NOERRORUI | Does not display an error

If flag is omitted

・ Display confirmation dialog

・ A message box is displayed when an error occurs.

It will be.

exception

None

Example of use

var fs = new FileSystem;
if(fs.Rename ("/app1", "/app2", FileSystem.NOCONFIRM + FileSystem.NOERRORUI)) {
    MessageBox("renamed");
}

Related item

DeleteFile , Copy method


FileSystem.SaveDialog method

Explanation

Select the file to save in the dialog.

Display the file save dialog and select the file to save by the user. The selected file is opened in write mode and assigned to the File object.

If cancel is selected in the dialog, a PKG-21 exception will be thrown.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

var f = fs.SaveDialog ( title , filter , suffix , fileName )

Return value

File object of the opened file

argument

String title

Title to display in the dialog

String filter

File name filter to display in dialog

Specify the display content and wildcard pair by connecting with "=".

If you specify multiple wildcards, separate them with ";". If you want to specify multiple filters, separate them with "/".

Only valid characters and wildcard characters "*" and "?" Can be specified as the file name. It cannot contain whitespace characters.

(Example)

Filter string | Contents to be displayed | Files displayed
"Text file(*.txt)=*.txt" | Text file(*.txt) | File with extension txt
"Text(*.txt,*.log)=*.txt;*.log" | Text(*.txt,*.log) | Files with extensions txt and log
"Text format=*.txt/Word processor format=*.doc" | Text format | File with extension txt
 | Word processor format | Files with the extension doc
"All files=*.*" | All files | All files

String suffix

Standard extension

If the user does not add an extension to the file name, the three characters from the left of the characters specified in the period and suffix will be adopted as the extension. Only valid characters can be specified in the suffix as the file name.

String fileName

Initial value of file name

You can specify the initial folder by specifying the file name including the absolute path.

exception

RTM-3

Unable to open file

PKG-19

The file name is invalid

PKG-20

Unable to open file selection dialog

PKG-21

File selection has been aborted by the user

RTM-34

This computer does not support the execution block function

RTM-35

The volume path for file'xxx'was not found

RTM-36

Could not access volume information for volume path'xxx'

RTM-37

Volume path'xxx 'does not support execution block function

RTM-38

The zone identification file'xxx' could not be created

RTM-39

Failed to write the zone identification file'xxx'

RTM-40

File attributes can only be specified in OPEN_WRITE mode

Example of use

var fs = new FileSystem;
var f = fs.SaveDialog("Save", "Text file(*.txt)=*.txt","txt","Readme.txt");
var data = "sample";
f.Write(data);
f.Close();

Related item

Open , OpenDialog method

File class


FileSystem.SplitPath method

Explanation

Split the virtual file name into each element with the delimiter "/".

Call format

var f = fs.SplitPath( path )

Return value

String array containing each divided element

Each element does not contain a "/".

argument

String path

Virtual file name to split

exception

None

Example of use

var fs = new FileSystem;
var n = fs.SplitPath("/aaa/bbb/ccc.txt");
for(var f = 0; f<n.Length; f++){
    print(n[f], "\n");
}

Related item

MakePath , Suffix method


FileSystem.Suffix method

Explanation

Extract the extension of the virtual file name

The string after the last period is considered as an extension.

Call format

var ex = fs.Suffix( path )

Return value

Virtual file name extension

Periods are not included.

argument

String path

Virtual file name to extract the extension

exception

None

Example of use

var fs = new FileSystem;
var ext = fs.Suffix("/aaa/bbb/ccc.txt");
print(ext, "\n");

Related item

MakePath , SplitPath methods


FileSystem.Unmount method

Explanation

Unmount.

See the Mount method for mounting .

Call format

fs.Unmount ( path [, flag ])

Return value

None

argument

String path

Virtual file name of the mount point to unmount

boolean flag

Mount record deletion flag

Specifying $TRUE deletes the mount record. Other than that, it will not be deleted.

If omitted, it will not be deleted.

See the Mount method description for mount recording .

exception

RTM-16

No mount operations other than private file system are possible

RTM-20

No folders are mounted on the mount point

Example of use

var fs = new FileSystem(FileSystem.PRIVATE_ROOT);
var path = "/app/data";
fs.Mount("data folder", path, "c:\\temp");
var f = fs.Open(fs.MakePath(path, "sample.txt"), FileSystem.OPEN_WRITE);
f.WriteString("sample");
f.Close();
fs.Unmount(path);

Related item

Mount method


FileSystem event

API version 4

Event

iOS Android Windows

There are no events defined in the FileSystem class.

Class overview

Base class event


NfcTagConnection class

API version 14

NfcTagConnection classChange History

iOS Android Windows

Object
 | NfcTagConnection

This class manages connection with NFC tags.

It will be returned as the return value of the Runtime.DiscoverNfcTag method.

Make sure to call the NfcTagConnection.Close method when you have finished interacting with the tag .

The dialog displayed by the Runtime.DiscoverNfcTag method is not closed until the NfcTagConnection.Close method is called or the NfcTagConnection is reclaimed by garbage collection . The Runtime.DiscoverNfcTag can not be called to continue the method.

About NFC tag search dialog

When you call the Runtime.DiscoverNfcTag method, the following dialog is displayed indicating that the tag is being searched.

* The screen below is for an iPhone running iOS 13. The actual display depends on the OS version and platform.

Figure 1 Display during tag search

Communication is started by holding the NFC tag over the terminal while this dialog is displayed.

Tag search can be interrupted by pressing the cancel button.

The character string displayed at the bottom of the dialog can be specified by the first argument of Runtime.DiscoverNfcTag method.

In addition, by calling the NfcTagConnection.Close method when all the processing is completed , the following dialog is displayed.

Figure 2. Indication of successful tag reading

Figure 3. Indication of tag reading failure

The message at the time of tag reading success and tag reading failure can be specified by the second argument of NfcTagConnection.Close method.

In addition, this dialog can be closed after a certain period of time or by swiping downward.

About NFC tag search dialog

Biz/Browser HT can communicate with tags compatible with Felica and Mifare Classic (*1).

Default property and ValueType

There are no default properties. The ValueType specification is invalid.

Properties | Methods | Events

Change History
*1　Added in API version 16.


NfcTagConnection property

API version 14

Property

iOS Android Windows

The following properties are defined in the NfcTagConnection class.

API | name | access | Type | Explanation
14 | IsFelicaTag | R | boolean | Whether the connected tag is the FeliCa tag or not
16 | IsMifareClassicTag | R | boolean | Whether the currently connected tag is Mifare Classic tag or not
14 | TagId | R | ByteArray | ID of connected tag

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


NfcTagConnection.IsFelicaTag Property

If the tag being connected is a FeliCa tag, $TRUE is displayed, otherwise $FALSE is displayed.

This property is read-only and cannot be changed.


NfcTagConnection.IsMifareClassicTag property

iOSAndroidWindows

Indicates $TRUE if the tag being connected is a Mifare Classic tag, otherwise $FALSE.

This property is read-only and cannot be modified.


NfcTagConnection.TagId property

The ID of the tag being connected is stored. The stored ID differs for each tag type.

If the IsFelicaTag property is $TRUE, the IDm corresponding to the default system code will be stored.

This property is read-only and cannot be changed.


NfcTagConnection method

API version 14

Method

iOS Android Windows

The following methods are defined in the NfcTagConnection class.

API | name | Explanation
14 | Close | Terminates the connection with the tag and closes the NFC tag search dialog.
14 | Felica_Polling | Issue FeliCa Polling command to NFC tag
14 | Felica_Read | Issue FeliCa Read Without Encryption command to NFC tag
14 | Felica_Write | Issue FeliCa Write Without Encryption command to NFC tag
16 | Mifare_AuthenticateSectorWithKeyA | KeyA authentication for Mifare Classic tags
16 | Mifare_AuthenticateSectorWithKeyB | KeyB authentication for Mifare Classic tags
16 | Mifare_BlockCountInSector | Get the number of blocks contained in the specified sector for Mifare Classic tag
16 | Mifare_BlockToSector | Get the index of the sector which contains the specified block of Mifare Classic tag
16 | Mifare_Decrement | Decrements the Value Block of Mifare Classic tag and writes it to a temporary buffer in the card
16 | Mifare_Increment | Increments the Value Block of the Mifare Classic tag and writes it to a temporary buffer in the card
16 | Mifare_ReadBlock | Reads the data of the specified block from Mifare Classic tag
16 | Mifare_Restore | Writes the contents of the temporary buffer in the Mifare Classic tag back to the card value
16 | Mifare_SectorCount | Get the number of sectors contained in a Mifare Classic tag
16 | Mifare_SectorToBlock | Get the index of the first block contained in the sector of Mifare Classic tag
16 | Mifare_Transfer | Writes the contents of the temporary buffer in the Mifare Classic tag to the card
16 | Mifare_WriteBlock | Write data to the specified block of Mifare Classic tag
14 | SetMessage | Set the message displayed in the NFC tag search dialog
14 | Transceive | Send arbitrary data to NFC tag and get the response data

Class overview

Base class methods


NfcTagConnection.Close method

Explanation

Close the connection with the tag and close the NFC tag search dialog.

Please be sure to close the file opened by NfcTagConnection.DiscoverNfcTag method etc. after reading and writing.

Call format

Nfc.Close ([ Succeeded [, Message ]])

Return value

None

argument

boolean succeeded

Specifies whether the interaction with the tag was successful.

This only affects the display of the NFC tag search dialog.

The default is true.

String message

Specify the character string displayed in the tag search dialog.

The default is an empty string.

exception

None

Example of use

var nfc = null;
try{
    nfc = Runtime.DiscoverNfcTag("Hold your transportation IC card over");
}catch(e){
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsFeliCaTag){
    nfc.Close(false, "A tag other than FeliCa was read");
    return;
}
try{
    nfc.SetMessage("Reading ...");
    /* Obtain IDm of system code 0x0003(Suica) */
    var targetIDm = nfc.FeliCa_Polling(0x0003) .IDm;
    /* Get 1 block from service 0x008B(card information) */
    var blockData = nfc.FeliCa_Read(targetIDm, 0x008B, 0, 1);
    var balance = blockData.ByteAt(11) + blockData.ByteAt(12) * 256;
    /* End communication with NFC */
    nfc.Close(true, "Suica balance:" + str(balance) + "yen");
}catch(e){
    nfc.Close(false, "read error");
}

Related item

Runtime.DiscoverNfcTag method


NfcTagConnection.Felica_Polling method

Explanation

Issue FeliCa Polling command to NFC tag.

For details, refer to the FeliCa card reference manual.

Call format

var result = nfc.Felica_Polling ( systemCode )

Return value

Returns a Record object with the following child objects

Record result {
    ByteArray IDm; /* Target system IDm */
    ByteArray PMm; /* PMm of target system */
}

argument

integer systemCode

Specify the target system code

exception

RTM-48

NFC reader / writer does not exist in the terminal.

RTM-49

NFC reader / writer of the terminal is not enabled.

RTM-50

Failed to access the NFC tag.

RTM-52

Failed to issue the FeliCa command.

Example of use

var nfc = null;
try{
    nfc = Runtime.DiscoverNfcTag("Hold your transportation IC card over");
}catch(e){
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsFeliCaTag){
    nfc.Close(false, "A tag other than FeliCa was read");
    return;
}
try{
    nfc.SetMessage("Reading ...");
    /* Obtain IDm of system code 0x0003 (Suica) */
    var targetIDm = nfc.FeliCa_Polling(0x0003) .IDm;
    /* Get 1 block from service 0x008B(card information) */
    var blockData = nfc.FeliCa_Read(targetIDm, 0x008B, 0, 1);
    var balance = blockData.ByteAt(11) + blockData.ByteAt(12) * 256;
    /* End communication with NFC */
    nfc.Close(true, "Suica balance:" + str(balance) + "yen");
}catch(e){
    nfc.Close(false, "read error");
}

Related item

IsFelicaTag property

Felica_Read and Felica_Write methods


NfcTagConnection.Felica_Read method

Explanation

Issue the FeliCa Read Without Encryption command to the NFC tag.

For details, refer to the FeliCa card reference manual.

Call format

var result = nfc.Felica_Read ( IDm , serviceCode , blockOffset , blockCount )

Return value

Returns the read block data as a ByteArray

argument

ByteArray IDm

Specify the target IDm

integer serviceCode

Specify the target service code

integer blockOffset

Specify the block number to start reading

integer blockCount

Specifies the number of blocks to read

exception

RTM-48

NFC reader / writer does not exist in the terminal.

RTM-49

NFC reader / writer of the terminal is not enabled.

RTM-50

Failed to access the NFC tag.

RTM-52

Failed to issue the FeliCa command.

Example of use

var nfc = null;
try{
    nfc = Runtime.DiscoverNfcTag("Hold your transportation IC card over");
}catch(e){
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsFeliCaTag){
    nfc.Close(false, "A tag other than FeliCa was read");
    return;
}
try{
    nfc.SetMessage("Reading ...");
    /* Obtain IDm of system code 0x0003 (Suica) */
    var targetIDm = nfc.FeliCa_Polling(0x0003) .IDm;
    /* Get 1 block from service 0x008B(card information) */
    var blockData = nfc.FeliCa_Read(targetIDm, 0x008B, 0, 1);
    var balance = blockData.ByteAt(11) + blockData.ByteAt(12) * 256;
    /* End communication with NFC */
    nfc.Close(true, "Suica balance:" + str(balance) + "yen");
}catch(e){
    nfc.Close(false, "read error");
}

Related item

IsFelicaTag property

Felica_Polling , Felica_Write methods


NfcTagConnection.Felica_Write method

Explanation

Issue the FeliCa Write Without Encryption command to the NFC tag.

For details, refer to the FeliCa card reference manual.

Call format

nfc.Felica_Write ( IDm , serviceCode , blockOffset , blockData )

Return value

None

argument

ByteArray IDm

Specify the target IDm.

integer serviceCode

Specify the target service code.

integer blockOffset

Specify the block number to start writing.

ByteArray blockData

Specify the data to write.

Data must be in 1 block (16 bytes) units.

exception

RTM-48

NFC reader / writer does not exist in the terminal.

RTM-49

NFC reader / writer of the terminal is not enabled.

RTM-50

Failed to access the NFC tag.

RTM-52

Failed to issue the FeliCa command.

Example of use

var nfc = null;
try{
    nfc = Runtime.DiscoverNfcTag("Please hold the FeliCa Lite-S tag");
}catch(e){
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsFeliCaTag){
    nfc.Close(false, "A tag other than FeliCa was read");
    return;
}
try{
    nfc.SetMessage("Connected");
    /* Get IDm of system code 0x88B4(FeliCa Lite-S) */
    /* (Usually unnecessary in FeliCa Lite-S, but called to determine that it is FeliCa Lite-S) */
    var targetIDm = nfc.FeliCa_Polling(0x88B4) .IDm;
    /* Write to service 0x0009(block with RW authority) */
    var blockData = new ByteArray(0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF);
    var blockOffset = 0;
    nfc.FeliCa_Write(targetIDm, 0x0009, blockOffset, blockData);
    /* End communication with NFC */
    nfc.Close(true, "End writing");
}catch(e){
    nfc.Close(false, "write error");
}

Related item

IsFelicaTag property

Felica_Polling , Felica_Read method


NfcTagConnection.Mifare_AuthenticateSectorWithKeyA method

iOSAndroidWindows

Explanation

KeyA authentication will be performed for sectors of Mifare Classic tags.

For more information, please refer to the Mifare Classic documentation.

Call format

nfc.Mifare_AuthenticateSectorWithKeyA( sectorIndex , keyType [, key ] )

Return value

None

argument

Integer sectorIndex

Specifies the index of the sector to be authenticated, starting from 0.

Integer keyType

Specify whether you want to specify your own authentication key or use a well-known key.

Specify the following values.

constant | value | Explanation
NfcTagConnection.MIFARE_KEY_USER | 0 | Authenticate using the specified key
NfcTagConnection.MIFARE_KEY_FACTORY | 1 | Authenticate with the factory key
NfcTagConnection.MIFARE_KEY_MAD | 2 | Authenticate with a key commonly used with tags formatted according to the MIFARE Application Directory (MAD) standard
NfcTagConnection.MIFARE_KEY_NFC_FORUM | 3 | Authenticate with a key commonly used for tags formatted according to NDEF on MIFARE Classic

ByteArray key

Specifies a 6-byte authentication key.

Used when keyType is MIFARE_KEY_USER.

If the size of the key is not 6 bytes, a FUNC-4 exception will be raised.

exception

FUNC-4

Invalid argument.

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Reading in progress...");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate with KeyA for the 0th sector */
    nfc.Mifare_AuthenticateSectorWithKeyA(0,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Get data from the 0th block */
    var blockData = nfc.Mifare_ReadBlock(0);
    var blockDataStr = "";

    var len = blockData.length;
    for (var i = 0; i < len; i++) {
        var b = blockData.ByteAt(i);
        blockDataStr += b.ToString(16) + str(" ");
    }

    /* End communication with NFC */
    nfc.Close(true, "block data : " + blockDataStr);

} catch(e) {
    nfc.Close(false, "read error");
}

Related item

Mifare_AuthenticateSectorWithKeyB method


NfcTagConnection.Mifare_AuthenticateSectorWithKeyB method

iOSAndroidWindows

Explanation

Authentication by KeyB will be performed for sectors of Mifare Classic tags.

For more information, please refer to the Mifare Classic documentation.

Call format

nfc.Mifare_AuthenticateSectorWithKeyB( sectorIndex , keyType [, key ] )

Return value

None

argument

Integer sectorIndex

Specifies the index of the sector to be authenticated, starting from 0.

Integer keyType

Specify whether you want to specify your own authentication key or use a well-known key.

Specify the following values.

constant | value | Explanation
NfcTagConnection.MIFARE_KEY_USER | 0 | Authenticate using the specified key
NfcTagConnection.MIFARE_KEY_FACTORY | 1 | Authenticate with the factory key
NfcTagConnection.MIFARE_KEY_MAD | 2 | Authenticate with a key commonly used with tags formatted according to the MIFARE Application Directory (MAD) standard
NfcTagConnection.MIFARE_KEY_NFC_FORUM | 3 | Authenticate with a key commonly used for tags formatted according to NDEF on MIFARE Classic

ByteArray key

Specifies a 6-byte authentication key.

Used when keyType is MIFARE_KEY_USER.

If the size of the key is not 6 bytes, a FUNC-4 exception will be raised.

exception

FUNC-4

Invalid argument.

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Reading in progress...");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate with KeyB for the 0th sector */
    nfc.Mifare_AuthenticateSectorWithKeyB(0,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Get data from the 0th block */
    var blockData = nfc.Mifare_ReadBlock(0);
    var blockDataStr = "";

    var len = blockData.length;
    for (var i = 0; i < len; i++) {
        var b = blockData.ByteAt(i);
        blockDataStr += b.ToString(16) + str(" ");
    }

    /* End communication with NFC */
    nfc.Close(true, "block data : " + blockDataStr);

} catch(e) {
    nfc.Close(false, "read error");
}

Related item

Mifare_AuthenticateSectorWithKeyA method


NfcTagConnection.Mifare_BlockCountInSector method

iOSAndroidWindows

Explanation

Gets the number of blocks contained in the specified sector for Mifare Classic tags.

For more information, please refer to the Mifare Classic documentation.

Call format

var count = nfc.Mifare_BlockCountInSector( sectorIndex )

Return value

Returns the number of blocks contained in the specified sector.

argument

Integer sectorIndex

Specifies the index of a sector starting from 0.

If you specify a negative value or a value greater than 40, the exception FUNC-4 will be raised.

exception

FUNC-4

Invalid argument.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Reading in progress...");

    var sectorCount = nfc.Mifare_SectorCount();

    for (var sector = 0; sector < sectorCount; sector++) {
        nfc.Mifare_AuthenticateSectorWithKeyA(sector, NfcTagConnection.MIFARE_KEY_FACTORY);

        /* Read the information in each block. */
        var blockCount = nfc.Mifare_BlockCountInSector(sector);
        var blockStart = nfc.Mifare_SectorToBlock(sector);
        for (var block = blockStart; block < blockStart + blockCount; block++) {
            var blockData = nfc.Mifare_ReadBlock(block);
            var blockDataStr = "Block " + str(block) + ":";

            var len = blockData.length;
            for (var i = 0; i < len; i++) {
                var b = blockData.ByteAt(i);
                blockDataStr += b.ToString(16) + str(" ");
            }
            print(blockDataStr);

        }

    }

    /* End communication with NFC */
    nfc.Close(true, "end of reading");

} catch(e) {
    nfc.Close(false, "read error");
}

Related item

Mifare_SectorCount、Mifare_SectorToBlock method


NfcTagConnection.Mifare_BlockToSector method

iOSAndroidWindows

Explanation

For Mifare Classic tags, gets the index value of the sector that contains the specified block.

For more information, please refer to the Mifare Classic documentation.

Call format

var sectorIndex = nfc.Mifare_BlockToSector( blockIndex )

Return value

Returns the index value of the sector that contains the specified block.

argument

Integer blockIndex

Specifies the index of the block starting from 0.

Specifying a negative value or a value greater than 256 will result in the exception FUNC-4.

exception

FUNC-4

Invalid argument.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Already connected");

    /* Make the fifth block a Value Block */
    var blockIndex = 5;
    var sectorIndex = nfc.Mifare_BlockToSector(blockIndex);

    nfc.Mifare_AuthenticateSectorWithKeyA(sectorIndex, NfcTagConnection.MIFARE_KEY_FACTORY);

    var valueBlock = new ByteArray(0x00, 0x00, 0x00 , 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF);
    nfc.Mifare_WriteBlock(blockIndex, valueBlock);

    /* End communication with NFC */
    nfc.Close(true, "end of writing");

} catch(e) {
    nfc.Close(false, "write error");
}

Related item


NfcTagConnection.Mifare_Decrement method

iOSAndroidWindows

Explanation

For Mifare Classic tags, the value of the specified block is decremented and stored in a temporary buffer in the card.

This operation is valid for Value Block format blocks.

The contents of the temporary buffer are reflected to the card by the Mifare_Transfer method.

For more information, please refer to the Mifare Classic documentation.

Call format

nfc.Mifare_Decrement( blockIndex , value)

Return value

None

argument

Integer blockIndex

Specifies the index of the block to be operated on, starting from 0.

Integer value

Specifies the number of decrements, which must be greater than or equal to 0.

exception

FUNC-4

Invalid argument.

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Already connected");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate the first sector with KeyA */
    nfc.Mifare_AuthenticateSectorWithKeyA(1,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Decrement the first block of the first sector */
    var blockIndex = nfc.Mifare_SectorToBlock(1);
    nfc.Mifare_Decrement(blockIndex, 2);

    /* Transfer the contents of the temporary buffer to the card */
    nfc.Mifare_Transfer(blockIndex);

    /* End communication with NFC */
    nfc.Close(true, "end of writing");

} catch(e) {
    nfc.Close(false, "write error");
}

Related item

Mifare_AuthenticateSectorWithKeyA、Mifare_AuthenticateSectorWithKeyB、

Mifare_Increment、Mifare_Transfer、Mifare_Restore method


NfcTagConnection.Mifare_Increment method

iOSAndroidWindows

Explanation

For Mifare Classic tags, the value of the specified block is incremented and stored in a temporary buffer in the card.

This operation is valid for Value Block format blocks.

The contents of the temporary buffer are reflected to the card by the Mifare_Transfer method.

For more information, please refer to the Mifare Classic documentation.

Call format

nfc.Mifare_Increment( blockIndex , value)

Return value

None

argument

Integer blockIndex

Specifies the index of the block to be operated on, starting from 0.

Integer value

Specifies the number of increments, which must be greater than or equal to 0.

exception

FUNC-4

Invalid argument.

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Already connected");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate the first sector with KeyA */
    nfc.Mifare_AuthenticateSectorWithKeyA(1,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Increment the first block of the first sector */
    var blockIndex = nfc.Mifare_SectorToBlock(1);
    nfc.Mifare_Increment(blockIndex, 2);

    /* Transfer the contents of the temporary buffer to the card */
    nfc.Mifare_Transfer(blockIndex);

    /* End communication with NFC */
    nfc.Close(true, "end of writing");

} catch(e) {
    nfc.Close(false, "Write error.");
}

Related item

Mifare_AuthenticateSectorWithKeyA、Mifare_AuthenticateSectorWithKeyB、

Mifare_Decrement、Mifare_Transfer、Mifare_Restore method


NfcTagConnection.Mifare_ReadBlock method

iOSAndroidWindows

Explanation

Reads the data of the specified block from the Mifare Classic tag.

For more information, please refer to the Mifare Classic documentation.

Call format

var blockData = nfc.Mifare_ReadBlock( blockIndex )

Return value

Returns the byte sequence received from the NFC tag as a ByteArray object.

argument

Integer blockIndex

Specifies the index of the block to be read, starting from 0.

exception

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Reading in progress...");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate with KeyA for the 0th sector */
    nfc.Mifare_AuthenticateSectorWithKeyA(0,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Get data from the 0th block */
    var blockData = nfc.Mifare_ReadBlock(0);
    var blockDataStr = "";

    var len = blockData.length;
    for (var i = 0; i < len; i++) {
        var b = blockData.ByteAt(i);
        blockDataStr += b.ToString(16) + str(" ");
    }

    /* End communication with NFC */
    nfc.Close(true, "block data : " + blockDataStr);

} catch(e) {
    nfc.Close(false, "read error");
}

Related item

Mifare_AuthenticateSectorWithKeyA、Mifare_AuthenticateSectorWithKeyB、

Mifare_WriteBlock method


NfcTagConnection.Mifare_Restore method

iOSAndroidWindows

Explanation

Writes the content of the card in the specified block to the temporary buffer written by the Mifare_Increment method or the Mifare_Decrement method.

This operation is valid for Value Block format blocks.

For more information, please refer to the Mifare Classic documentation.

Call format

nfc.Mifare_Restore( blockIndex )

Return value

None

argument

Integer blockIndex

Specifies the index of the block to be operated on, starting from 0.

exception

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Already connected");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate the first sector with KeyA */
    nfc.Mifare_AuthenticateSectorWithKeyA(1,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Increment the first block of the first sector */
    var blockIndex = nfc.Mifare_SectorToBlock(1);
    nfc.Mifare_Increment(blockIndex, 2);

    /* Transfer the contents of the temporary buffer to the contents of the card */
    nfc.Mifare_Restore(blockIndex);

    /* Transfer the contents of the temporary buffer to the card */
    /* The Mifare_Restore method is called immediately before, so the same content as the card is written. */
    nfc.Mifare_Transfer(blockIndex);

    /* End communication with NFC */
    nfc.Close(true, "end of writing");

} catch(e) {
    nfc.Close(false, "write error");
}

Related item

Mifare_AuthenticateSectorWithKeyA、Mifare_AuthenticateSectorWithKeyB、

Mifare_Increment、Mifare_Decrement、Mifare_Transfer method


NfcTagConnection.Mifare_SectorCount method

iOSAndroidWindows

Explanation

Get the number of sectors contained in a Mifare Classic tag.

For more information, please refer to the Mifare Classic documentation.

Call format

var count = nfc.Mifare_SectorCount()

Return value

Returns the number of sectors.

argument

None

exception

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Reading in progress...");

    var sectorCount = nfc.Mifare_SectorCount();

    for (var sector = 0; sector < sectorCount; sector++) {
        nfc.Mifare_AuthenticateSectorWithKeyA(sector, NfcTagConnection.MIFARE_KEY_FACTORY);

        /* Read the information in each block. */
        var blockCount = nfc.Mifare_BlockCountInSector(sector);
        var blockStart = nfc.Mifare_SectorToBlock(sector);
        for (var block = blockStart; block < blockStart + blockCount; block++) {
            var blockData = nfc.Mifare_ReadBlock(block);
            var blockDataStr = "Block " + str(block) + ":";

            var len = blockData.length;
            for (var i = 0; i < len; i++) {
                var b = blockData.ByteAt(i);
                blockDataStr += b.ToString(16) + str(" ");
            }
            print(blockDataStr);

        }

    }

    /* End communication with NFC */
    nfc.Close(true, "end of reading");

} catch(e) {
    nfc.Close(false, "read error");
}

Related item

Mifare_BlockCountInSector、Mifare_SectorToBlock method


NfcTagConnection.Mifare_SectorToBlock method

iOSAndroidWindows

Explanation

For Mifare Classic tags, gets the index value of the first block contained in the specified sector.

For more information, please refer to the Mifare Classic documentation.

Call format

var blockStart = nfc.Mifare_SectorToBlock( sectorIndex )

Return value

Returns the index value of the first block contained in the specified sector.

argument

Integer sectorIndex

Specifies the index of a sector starting from 0.

If you specify a negative value or a value greater than 40, the exception FUNC-4 will be raised.

exception

FUNC-4

Invalid argument.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Reading in progress...");

    var sectorCount = nfc.Mifare_SectorCount();

    for (var sector = 0; sector < sectorCount; sector++) {
        nfc.Mifare_AuthenticateSectorWithKeyA(sector, NfcTagConnection.MIFARE_KEY_FACTORY);

        /* Read the information in each block. */
        var blockCount = nfc.Mifare_BlockCountInSector(sector);
        var blockStart = nfc.Mifare_SectorToBlock(sector);
        for (var block = blockStart; block < blockStart + blockCount; block++) {
            var blockData = nfc.Mifare_ReadBlock(block);
            var blockDataStr = "Block " + str(block) + ":";

            var len = blockData.length;
            for (var i = 0; i < len; i++) {
                var b = blockData.ByteAt(i);
                blockDataStr += b.ToString(16) + str(" ");
            }
            print(blockDataStr);

        }

    }

    /* End communication with NFC */
    nfc.Close(true, "end of reading");

} catch(e) {
    nfc.Close(false, "read error");
}

Related item

Mifare_SectorCount、Mifare_BlockCountInSector method


NfcTagConnection.Mifare_Transfer method

iOSAndroidWindows

Explanation

Transfers the contents of the temporary buffer written by the Mifare_Increment method or Mifare_Decrement method to the card.

This operation is valid for Value Block format blocks.

For more information, please refer to the Mifare Classic documentation.

Call format

nfc.Mifare_Transfer( blockIndex )

Return value

None

argument

Integer blockIndex

Specifies the index of the block to be operated on, starting from 0.

exception

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Already connected");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate the first sector with KeyA */
    nfc.Mifare_AuthenticateSectorWithKeyA(1,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Increment the first block of the first sector */
    var blockIndex = nfc.Mifare_SectorToBlock(1);
    nfc.Mifare_Increment(blockIndex, 2);

    /* Transfer the contents of the temporary buffer to the card */
    nfc.Mifare_Transfer(blockIndex);

    /* End communication with NFC */
    nfc.Close(true, "end of writing");

} catch(e) {
    nfc.Close(false, "write error");
}

Related item

Mifare_AuthenticateSectorWithKeyA、Mifare_AuthenticateSectorWithKeyB、

Mifare_Increment、Mifare_Decrement、Mifare_Restore method


NfcTagConnection.Mifare_WriteBlock method

iOSAndroidWindows

Explanation

16 bytes of data will be written to the designated block of Mifare Classic tag.

For more information, please refer to the Mifare Classic documentation.

Call format

nfc.WriteBlock( blockIndex , blockData )

Return value

None

argument

Integer blockIndex

Specifies the index of the block to be written, starting from 0.

ByteArray blockData

Specifies the byte sequence to be written to the NFC tag.

If the size is not 16 bytes, a FUNC-4 exception will be raised.

exception

FUNC-4

Invalid argument.

RTM-50

Failed to access the NFC tag.

RTM-85

Failed to issue Mifare Classic command.

Example of use

var nfc = null;
try {
    nfc = Runtime.DiscoverNfcTag("Hold up a Mifare Classic card");
} catch(e) {
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsMifareClassicTag) {
    nfc.Close(false, "A tag other than Mifare Classic has been read");
    return;
}
try {
    nfc.SetMessage("Already connected");

    var key = new ByteArray(0,1,2,3,4,5);

    /* Authenticate the first sector with KeyA */
    nfc.Mifare_AuthenticateSectorWithKeyA(1,NfcTagConnection.MIFARE_KEY_USER,key);

    /* Make the first block of the first sector a Value Block */
    var blockIndex = nfc.Mifare_SectorToBlock(1);
    var valueBlock = new ByteArray(0x00, 0x00, 0x00 , 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF);
    nfc.Mifare_WriteBlock(blockIndex, valueBlock);

    /* End communication with NFC */
    nfc.Close(true, "end of writing");

} catch(e) {
    nfc.Close(false, "write error");
}

Related item

Mifare_AuthenticateSectorWithKeyA、Mifare_AuthenticateSectorWithKeyB、

Mifare_ReadBlock method


NfcTagConnection.SetMessage method

Explanation

Set the message displayed in the NFC tag search dialog.

Call format

nfc.SetMessage ( message )

Return value

None

argument

String message

Specify the string to be displayed

exception

None

Example of use

var nfc = null;
try{
    nfc = Runtime.DiscoverNfcTag("Hold your transportation IC card over");
}catch(e){
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsFeliCaTag){
    nfc.Close(false, "A tag other than FeliCa was read");
    return;
}
try{
    nfc.SetMessage("Reading ...");
    /* Obtain IDm of system code 0x0003 (Suica) */
    var targetIDm = nfc.FeliCa_Polling(0x0003) .IDm;
    /* Get 1 block from service 0x008B(card information) */
    var blockData = nfc.FeliCa_Read(targetIDm, 0x008B, 0, 1);
    var balance = blockData.ByteAt(11) + blockData.ByteAt(12) * 256;
    /* End communication with NFC */
    nfc.Close(true, "Suica balance:" + str(balance) + "yen");
}catch(e){
    nfc.Close(false, "read error");
}

Related item

Close method


NfcTagConnection.Transceive method

Explanation | Arbitrary data is sent to the NFC tag and the response data is acquired. For details on the format and protocol of data that can be sent, refer to the reference manual of the target NFC tag.
Call format | var receivedData = nfc.Transceive( sendData ).
Return value | Returns the byte string received from the NFC tag as a ByteArray object
argument | String sendData | Byte string to send to NFC tag.
exception | RTM-48 | NFC reader / writer does not exist in the terminal.
 | RTM-49 | NFC reader / writer of the terminal is not enabled.
 | RTM-50 | Failed to access the NFC tag.
Example of use |
Related item |


NfcTagConnection event

API version 14

Event

iOS Android Windows

There are no events defined in the NfcTagConnection class.

Class overview

Base class events


Runtime class

Object
 | Runtime

The Runtime class is a collection of functions that strongly depend on the platform environment, and is a class that serves as a contact point with the operating system of each platform.

By using the Runtime class, you can operate environment variables, start external programs, call location information acquisition, and so on.

Default properties and ValueType

The default property is Value . String, Number, Date can be specified for ValueType.


Runtime property

API version 4

Property

iOS Android Windows

The following properties are defined in the Runtime class.

API | name | access | Type | Explanation
4 | Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Runtime.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


Runtime method

API version 4

Method

The following methods are defined in the Runtime class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Runtime object
HT (10) | CallDll | It is retained for compatibility. It does not work.
4 | DeleteUUID | Delete UUID
4 | Exec | Start an external program
8 | GetCameraCaptureImage | Get still images captured by the camera
26 | GetPermittedLocationAccuracy | Get the location accuracy that the user has allowed to get
4 | GetUUID | Get UUID
7 | LoadSound | Load sound effects
7 | PlaySound | Play sound effect
8 | SetCameraOption | Make various settings for the camera
HT (10) | ShellEdit | It is retained for compatibility. It does not work.
4 | ShellLink | Execute a hyperlink
4 | ShellOpen | Open file by shell function
11 | ShowCodeScanner | Scan barcodes and 2D codes
4 | ShowImagePicker | Get images from camera or image library
8 | StartCameraCapture | Start camera capture
4 | StartLocationMeasure | Start positioning
8 | StopCameraCapture | Stop camera capture
4 | StopLocationMeasure | Stop positioning
7 | UnloadSound | Unload sound effects

Static method

API | name | Explanation
15 | CancelBluetoothScanning | Cancel the Bluetooth device scan.
14 | DiscoverNfcTag | Search for NFC tags
15 | GetBondedDeviceList | Get the list of bonded (paired) Bluetooth devices.
4 | GetMaxMemory | Gets the maximum memory size allocated to Biz / Browser This feature has been removed from API version 6.
23 | GetMemoryInfo | Get memory usage
4 | GetLastKnownLocation | Get the last position measured
14 | HasNfcFeature | Gets whether the terminal has NFC function
15 | IsBluetoothEnabled | Get whether the Bluetooth function of the device is enabled or not.
14 | IsNfcReaderEnabled | Gets whether the NFC reader / writer function of the terminal is enabled
7 | Invoke | Invokes platform-specific functions
4 | IsProviderEnabled | Get the enable / disable of the specified location provider
15 | RequestBonding | Perform bonding (pairing) with a Bluetooth device
15 | SetBluetoothEnabled | Enables or disables the Bluetooth function of the device
15 | ShowBluetoothSettings | Display the Bluetooth setting screen of the device.
4 | ShowLocationSettings | Display the location information service setting screen of the terminal
14 | ShowNfcSettings | Display the NFC setting screen of the terminal
15 | StartBluetoothScanning | Start scanning for Bluetooth devices

Class overview

Base class methods


Runtime constructor

Explanation

Initializes the Runtime object.

If you specify a FileSystem object as an argument, you can use the virtual file name of the specified FileSystem object as the file name used in the shell function ( ShellOpen method) . You can also specify a relative path by the current folder and reference files in mounted folders and folders with private attributes.

Call format

var rt = new Runtime([ refFs ])

Return value

Runtime object

argument

FileSystem refFs

The FileSystem object to reference

If omitted, it is not associated with any particular FileSystem object.

exception

RTM-100

DLL load error

Example of use

var fs = new FileSystem(FileSystem.PRIVATE_ROOT);
var rt = new Runtime(fs);
rt.ShellOpen("/data/sample.html");

Related item

ShellOpen methods

FileSystem class


Runtime.CancelBluetoothScanning method

iOSAndroidWindows

Explanation

Cancel the scan for Bluetooth devices.

When the scan is cancelled, the BluetoothScanFinished event is raised.

Call format

Runtime.CancelBluetoothScanning()

Return value

none

argument

none

exception

none

Example of use

Form form1{
    Width = 424;
    Height = 320;

    Button btnStartScanning {
        X = 16;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Start device scan";

        Function OnTouch(e){
                try {
                    /* Start scanning for Bluetooth LE devices. */
                    var params = new Array();
                    params["CONNECTABLE_DEVICE_ONLY"] = true;
                    Runtime.StartBluetoothScanning(Runtime.BLUETOOTH_LE, params);
                } catch(e) {
                    MessageBox(e.Message);
                }
        }
    }

    Button btnStopScanning {
        X = 184;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Stop device scan";

        Function OnTouch( e ) {
            Runtime.CancelBluetoothScanning();
        }
    }
}
Function OnBluetoothScanStarted(e) {
    print("Start scan\n");
}
Function OnBluetoothScanFinished(e) {
    print("Finish scan\n");
}
Function OnBluetoothDeviceFound(e) {
    print(e.DeviceID + "\n");
}

Related item

StartBluetoothScanning method


Runtime.CallDll method

This method is retained for compatibility. Nothing happens when I operate it.


Runtime.DeleteUUID method

Explanation

Delete the UUID.

Deletes the UUID recorded by the GetUUID method.

Call format

var result = rt.DeleteUUID ( key [, pass-phrase ])

Return value

Returns $TRUE if deleted correctly, $FALSE otherwise.

argument

String key

Identifier corresponding to UUID

You can specify up to 16 alphanumeric characters.

String pass-phrase

Passphrase for encrypting and recording UUIDs

exception

RTM-26

Illegal identifier

RTM-18

Registry access error

RTM-27

Unable to generate UUID

Example of use

var rt = new Runtime;
var result = rt.DeleteUUID("appkey", "pass");

Related item

GetUUID method


Runtime.DiscoverNfcTag method

API version 14

Runtime.DiscoverNfcTag method change history

iOS Android Windows

Explanation

Search for NFC tags. Block processing until the tag is found or canceled.

As of API Version 16, it is possible to handle NFC-F (JIS 6319-4, FeliCa tag, etc.) and Mifare Classic.*1

Call format

var conn = rt.DiscoverNfcTag ([ message [, showDiscoveringDialog ]])

Return value

Returns an NfcTagConnection object for interacting with NFC tags

argument

String message

Specify the character string displayed during tag search.

The default is an empty string.

boolean showDiscoveringDialog

Specify whether to display the dialog indicating that tag search is in progress.

Please refer to the explanation of NfcTagConnection class for the design of the displayed dialog .

The default is $TRUE.

exception

RTM-48

NFC reader / writer does not exist in the terminal.

RTM-49

NFC reader / writer of the terminal is not enabled.

RTM-50

Failed to access the NFC tag.

RTM-51

The search for NFC tags has been canceled.

Example of use

var nfc = null;
try{
    nfc = Runtime.DiscoverNfcTag("Hold your transportation IC card over");
}catch(e){
    MessageBox("NFC tag search failure");
    return;
}
if(!nfc.IsFeliCaTag){
    nfc.Close(false, "A tag other than FeliCa was read");
    return;
}
try{
    nfc.SetMessage("Reading ...");
    /* Obtain IDm of system code 0x0003 (Suica) */
    var targetIDm = nfc.FeliCa_Polling(0x0003).IDm;
    /* Get 1 block from service 0x008B(card information) * /
    var blockData = nfc.FeliCa_Read(targetIDm, 0x008B, 0, 1);
    var balance = blockData.ByteAt(11) + blockData.ByteAt(12) * 256;
    /* End communication with NFC * /
    nfc.Close(true, "Suica balance:" + str(balance) + "yen");
}catch(e){
    nfc.Close(false, "read error");
}

Related item

HasNfcFeature , IsNfcReaderEnabled method

NfcTagConnection class
Change history
*1　Mifare Classic tag traversal is supported since API version 16.


Runtime.Exec method

Explanation

Start an external application.

Android version The
external application to be started is specified by the package name and activity name of the application. ("Com.android.browser", ".BrowserActivity" launches the standard browser, etc.)

If it finds an application that should run successfully, it will display an application execution warning dialog to the user.
The application will only run if the user selects OK in the warning dialog.

Difference in operation depending on security level

Show Warning Dialog

level | Explanation
0 | Do not display the warning dialog, just run it.
1 | Show a warning dialog and execute if OK.
2
3
4

External application execution

level | Explanation
0 | You can run.
1
2 | It cannot be executed.
3
4

Call format

Android version
var result = rt.Exec( packageName , activityName )

Return value

Returns $TRUE if the program could be launched, $FALSE otherwise.

argument

String packageName

Specify the package name of the application to start.

Example: “com.android.browser” for the Android standard browser

String activityName

Specify the activity name of the application to be started.

Example) If it is Android standard browser, you can specify either ".BrowserActivity" or "com.android.browser.BrowserActivity"

exception

PKG-22

Program execution aborted by user

PKG-23

Could not confirm program execution

RTM-4

Could not create working file

RTM-5

Cannot generate short file name

RTM-6

Cannot find the program associated with the extension

RTM-7

Program cannot run due to security restrictions

RTM-45

Could not get information for package '%s'.

Example of use

var rt = new Runtime;
rt.Exec("html", "C:\\test.html");

Related item

ShellOpen , ShellLink methods


Runtime.GetBondedDeviceList method

API version 15

Runtime.GetBondedDeviceList methodChange History

iOSAndroidWindows

Explanation

Get the list of bonded (paired) Bluetooth devices.

Call format

var devices = Runtime.GetBondedDeviceList()

Return value

Returns an array of Record that contains device information.

The following objects are included in Record.

Type | Name | Explanation
String | DeviceId | The BD address of the target Bluetooth device is stored. (The format of the BD address is the same as the MAC address.)
String | Name | The name of the target Bluetooth device is stored.
Number | ConnectableAsBluetoothClassic | If the device can be connected as a Bluetooth Classic device, $TRUE is stored, and if not, $FALSE is stored.
Number | ConnectableAsBluetoothLE | If the device can be connected as a BLE (Bluetooth Low Energy) device, $TRUE is stored, and if it cannot be connected, $FALSE is stored.
Number | HasRssi | If the RSSI value (Received Signal Strength Indication) is present, $TRUE is stored; if not, $FALSE is stored. Some BLE devices rarely do not have RSSI values.
Number | Rssi | If HasRssi is $TRUE, the RSSI value is stored. The unit is dBm. If HasRssi is $FALSE, this object will not be added.
Number | HasTxPowerLevel | If it has a transmit output value, $TRUE is stored; if not, $FALSE is stored.
Number | TxPowerLevel | When HasTxPowerLevel is $TRUE, the transmit power value is stored. The unit is dBm. If HasTxPowerLevel is $FALSE, this object will not be added.
Array | ServiceUuidList | The list of advertised services is stored. Note that there may be some services that are not advertised but can be used.

argument

None

exception

RTM-83

Bluetooth is not enabled.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

RTM-113

Bluetooth device control is not supported.

Exmaple of use

Form form1{
    Width = 424;
    Height = 320;

    Button btnGetBondedDeviceList{
        X = 16;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Get device list";

        Function OnTouch(e){
            try {
                var devices = Runtime.GetBondedDeviceList();
                for (var i = 0; i < devices.length; i++) {
                    print(devices[i].DeviceId + "\n");
                 }
            } catch(e) {
                MessageBox(e.Message);
            }
        }
    }
}

Related item

RequestBonding method

Change History
*1　The specification has been changed since API version 26.


Runtime.GetCameraCaptureImage method

Explanation

Get the still image captured by the camera.

This method must call the StartCameraCapture method before execution .
If it is executed when the camera is not initialized or the camera is stopped, an RTM-46 exception will occur.

Call format

var img = rt.GetCameraCaptureImage()

Return value

The last image captured by the camera is returned as an Image object.

argument

None

exception

RTM-46

Camera operation failed.

Example of use

var img = ^.r.GetCameraCaptureImage();
if(img! = null && img.width>0 && img.height>0){
    /* Set the image */
}
See also the example of using StartCameraCapture .

Related item

 StartCameraCapture , SetCameraOption , StopCameraCapture methods


Runtime.GetMaxMemory method

iOS Android

This feature has been removed from API version 6.

Explanation

Gets the maximum memory size assigned to Biz/Browser.

Android version API version 3 and earlier The
maximum memory size is a device-specific value, but it is about 16 to 48MB for general devices.

Call format

var maxMem = Runtime.GetMaxMemory();

Return value

Returns the maximum memory size in MB.

argument

None

exception

None

Example of use

var maxMem = Runtime.GetMaxMemory();
//.MessageBox("Max memory size: "+ str (maxMem) +" [MB] ");

Related item


Runtime.GetMemoryInfo method

iOSAndroidWindows

Explanation

Get memory usage.

Call format

var info = Runtime.GetMemoryInfo( )

Return value

Returns a Record object that stores memory usage.

Record contains the following objects:

type | name | Explanation (Unit of memory usage: byte)
Number | JavaVMHeapSize | JavaVM heap memory allocated
Number | JavaVMHeapUsedSize | JavaVM heap memory in use
Number | JavaVMHeapFreeSizeVM | Unused JavaVM heap memory
Number | JavaVMHeapMaxSize | Heap memory available in Biz/Browser
Number | NativeHeapSize | Native heap memory allocated
Number | NativeHeapAllocatedSize | Native heap memory in use
Number | NativeHeapFreeSize | Unused Native heap memory

argument

None

exception

None

Example of use

var info =  Runtime.GetMemoryInfo();
print("Total Used Memory:" , str(info.JavaVMHeapUsedSize + info.NativeHeapAllocatedSize) , "\n");

Related item


Runtime.GetLastKnownLocation method

Explanation

Acquires the last position measured by the specified location provider.

If you want to get the current location information, use StartLocationMeasure method.

Precautions for use

Depending on some OS and models, the position information may be repositioned when this method is called, but this does not guarantee that repositioning will always be performed when this method is called. be careful.

Call format

Android version
var result = Runtime.GetLastKnownLocation ( provider )

Return value

If location information exists in the specified location provider, the location information will be returned. If not, null will be returned.

The format of location information is as follows.

Record {
    Number provider; /* Get the location provider that obtained this location information. */

       Number latitude; /* Get the latitude. The unit is degree (deg). */

    Number longitude; /* Get the latitude. The unit is degree (deg). */

    Date time; /* The time when this location information was acquired is stored */

    Number hasAccuracy; /* $TRUE is stored if the measurement accuracy can be acquired, $FALSE is stored otherwise */
                /* The following child objects exist only when hasAccuracy = $TRUE */

    Number accuracy; /* Gets the measurement accuracy. The unit is meter (m). */
}

argument

Number provider

Specify one location provider to perform positioning.

The values ​​that can be specified are as follows.

constant | value | Explanation
Runtime.LOCATION_PROV_GPS | 1 | Position using GPS (Global Positioning System)
Runtime.LOCATION_PROV_NETWORK | 2 | Positions using mobile networks and WiFi.

String unused

The argument is ignored.

exception

None

Example of use

var location = Runtime.GetLastKnownLocation(Runtime.LOCATION_PROV_GPS);

Related item

StartLocationMeasure method


Runtime.GetPermittedLocationAccuracy method

iOSAndroidWindows

Explanation

Gets the location accuracy that the user has allowed to get.

Call format

var accuracy = rt.GetPermittedLocationAccuracy( )

Return value

Returns the accuracy of location information that the user is allowed to get.

A combination of the following values.

constant | value | Explanation
Runtime.COARSE_LOCATION | 1 | Retrieval of coarse location is allowed
Runtime.FINE_LOCATION | 2 | Retrieval of fine location is allowed

argument

None

exception

None

Example of use

var rt = new Runtime;
var accuracy = rt.GetPermittedLocationAccuracy();
if (and(accuracy, Runtime.FINE_LOCATION) == Runtime.FINE_LOCATION) {
    //.MessageBox("Acquisition of fine location information is permitted.");
}

Related item


Runtime.GetUUID method

Explanation

Get the UUID.

UUID (Universal Unique ID) is a general-purpose unique identifier designed to be unique in the world, and is a 128-bit random numerical value expressed as a character string. For example, the following character string.

"DE07FFE8-A2FF-47CD-BA46-A993160F9A92"

To ensure uniqueness, creating a UUID may refer to information such as the time it was created and the MAC address of the computer that created it. The chances of duplicate UUIDs are extremely low, but we do not guarantee that they will not be completely duplicated.

In the Windows environment, it is used as an identifier for OLE objects and ActiveX objects, and as a product-specific identifier. Sometimes called a GUID (Global Unique ID).

The UUID returned by calling the GetUUID method is stored as a pair with the key for each user (except when setting common users for Windows98 and Me), and if a UUID corresponding to the key has already been generated, that UUID is returned. .. If the UUID corresponding to the key has not been generated, the newly generated UUID is recorded and returned.

The recorded UUID is valid even if you restart Biz/Browser or restart your computer, but it may be lost due to computer trouble. There is no way to recover a UUID once it has been lost, so it is recommended that you do not rely on UUID records to process unrecoverable data.

The key / UUID pair isrecorded in a namespace shared by all applications unlessthe optional parameter pass-phrase is specified. If pass-phrase is specified, the CRS that executed the GetUUID method will be recorded in the unique namespace of the downloaded server. In other words, if you call the GetUUID method with the same key specified for the CRS downloaded from Server-A and the CRS downloaded from Server-B, the same UUID will be returned if you do not specify pass-phrase , and if you specify pass-phrase , , Each is treated as a different key and a different UUID is returned.

Optional parameter pass-phrase If you do not specify a, UUID are logged in clear text, pass-phrase will be recorded is encrypted When you specify. Once pass-phrase the specified UUID, which are recorded in the same pass-phrase can not get to be called the GetUUID method with a different pass-phrase or pass-phrase exception of when you omit the RTM-27 is Occurs.

Call format

var result = rt.GetUUID ( key [, pass-phrase ])

Return value

UUID string

argument

String key

Identifier corresponding to UUID

You can specify up to 16 alphanumeric characters.

String pass-phrase

Passphrase for encrypting and recording UUIDs

exception

RTM-26

The identifier is invalid

RTM-18

Registry access error

RTM-27

Unable to generate UUID

Example of use

var rt = new Runtime;
var uuid = rt.GetUUID("appkey", "pass");

Related item

DeleteUUID method


Runtime.HasNfcFeature method

Explanation

Returns whether the terminal has NFC function.

Call format

var result = Runtime.HasNfcFeature()

Return value

Returns $TRUE if the device has NFC capability, $FALSE otherwise.

argument

None

exception

None

Example of use

/* Check if NFC function is available */
if(! Runtime.HasNfcFeature()){
    MessageBox ("This device cannot read NFC tag.");
}else if(!Runtime.IsNfcReaderEnabled()){
    MessageBox("NFC reader / writer function is off. Please set it to On.");
    Runtime.ShowNfcSettings(); /* Show settings screen */
}else{
    /* Ready to start reading NFC */
}

Related item

IsNfcReaderEnabled , DiscoverNfcTag method


Runtime.Invoke method

Explanation

Invokes platform-specific functions.

Call format

Runtime.Invoke ( vendorID , functionID [, param1 [, param2 [, ...]]])

Return value

vendorID, functionID Depends on the specified function

argument

String vendorID

Vendor ID

It is used in combination with the functionID described below.

If you specify an empty string or null value, "OpenStream" is assumed to be specified.

String functionID

Function ID

Used in combination with vendor ID.

The values ​​that can be specified depend on the platform.

exception

FUNC-4

Invalid argument

PKG-51

"vendorID" or "functionID" cannot be used

Example of use

var v = "VendorID";
var f = "FunctionID";
var rtm = new Runtime();
re = rtm.invoke(v, f);

Related item


Runtime.IsBluetoothEnabled method

iOSAndroidWindows

Explanation

Get whether the Bluetooth function of the device is enabled or not.

Call format

var result = rt.IsBluetoothEnabled()

Return value

Returns $TRUE if the Bluetooth function of the device is enabled for the function, otherwise returns $FALSE.

argument

None

exception

None

Example of use

if(!Runtime.IsBluetoothEnabled()){
    MessageBox("Turn on the Bluetooth function.");
    try {
        Runtime.SetBluetoothEnabled(true);
    } catch (e) {
        //.Message("Exception", e.Message, ". It's happening.");
    }
}else{
    /* You can use the Bluetooth function */
}

Related item

ShowBluetoothSettings、SetBluetoothEnabledメソッド


Runtime.IsNfcReaderEnabled method

Explanation

Gets whether the NFC reader / writer function of the terminal is enabled.

Call format

var result = Runtime.IsNfcReaderEnabled()

Return value

Returns $TRUE if the NFC reader / writer function of the terminal is enabled, otherwise returns $FALSE.

argument

None

exception

None

Example of use

/* Check if NFC function is available */
if(!Runtime.HasNfcFeature()){
    MessageBox("This device cannot read NFC tag.");
}else if(!Runtime.IsNfcReaderEnabled()){
    MessageBox("NFC reader / writer function is off. Please set it to On.");
    Runtime.ShowNfcSettings(); /* Show settings screen */
}else{
    /* Ready to start reading NFC */
}

Related item

HasNfcFeature , ShowNfcSettings , DiscoverNfcTag methods


Runtime.IsProviderEnabled method

Explanation

Acquires the valid / invalid of the specified location provider.

Call format

Android version
var result = Runtime.IsProviderEnabled( provider )

Return value

Returns $TRUE if the specified location provider is valid, $FALSE otherwise.

argument

Number provider

Specify one location provider to perform positioning.

The values ​​that can be specified are as follows.

constant | value | Explanation
Runtime.LOCATION_PROV_GPS | 1 | Position using GPS (Global Positioning System)
Runtime.LOCATION_PROV_NETWORK | 2 | Positions using mobile networks and WiFi.

String unused

The argument is ignored.

exception

None

Example of use

/* Displays the setting screen if GPS positioning is not enabled */
if(Runtime.IsProviderEnabled(Runtime.LOCATION_PROV_GPS)){
    Runtime.ShowLocationSettings();
}

Related item

ShowLocationSettings method


Runtime.LoadSound method

Explanation

Load the sound file for sound effects.

Please note the following points when using.

・ Be careful not to run out of memory when loading a large amount of audio data.

・ Sound effects may not be played immediately after loading or when played simultaneously at short intervals.

・ Depending on the file format, playback may not be possible even if loading is successful.

Android version
- Due to the API limitation of Android version / OS, the file of about 10 seconds or more cannot be loaded.
- Only .wav files in PCM format can be loaded.
- The maximum number of sound effects that can be loaded by one Runtime object is 256, including those that have been unloaded.

Call format

var soundID = Runtime.LoadSound( fileName ).

Return value

Returns the sound effect ID (integer 1 or greater) as a number.

argument

String fileName

File path of file to open

Specify the path based on the root folder.

The root folder is the same as the public attribute of the FileSystem class .

exception

RTM-3

Cannot open file

RTM-13

The specified file was not found

Example of use

/* In the initialization process of the screen for which you want to play a sound effect */
Runtime rtm; /* Runtime object that holds the sound effect */
Number soundId; /* Loaded sound effect ID */
if(!$DESIGNTIME){
    soundId = rtm.LoadSound("sound.wav");
}

Related item

UnloadSound method

PlaySound method


Runtime.PlaySound method

API version 7

Runtime.PlaySound methodChange History

iOS Android Windows

Explanation

Play a sound file for sound effects.

Call format

Runtime.PlaySound( soundID ).

Return value

None

argument

integer soundID

Sound effect ID

The sound effect to be played is specified by the value obtained from the return value of the LoadSound method.

exception

FUNC-4

Invalid argument

RTM-87

Failed to play audio. *1

Example of use

/* When you want to play a sound effect. sound is preloaded. */
rtm.PlaySound(soundID);

Related item

LoadSound method

UnloadSound method

Change History
*1　The specification has been changed since API version 26.


Runtime.RequestBonding method

API version 15

Runtime.RequestBonding methodChange History

iOSAndroidWindows

Explanation

Starts bonding (pairing) to the device with the specified device ID.

This method returns immediately after the bonding process is started. It does not wait for the end of the process.

The success/failure of bonding is handled using the BluetoothBondingFinished event.

Entering the PIN code required for bonding and verifying the PIN code between each other's devices requires user intervention.

The dialog will be displayed by the OS at this time.

Call format

Runtime.RequestBonding( deviceId )

Return value

None

argument

String deviceId

BD address of the device (the format of the BD address is the same as the MAC address)

exception

RTM-54

Failed to access the Bluetooth function of the device.

RTM-83

Bluetooth is not enabled.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

RTM-113

Bluetooth device control is not supported.

RTM-117

Bonding is in progress.

RTM-118

It has already been bonded.

Example of use

Function Start() {
    try {
        /* Start scanning for Bluetooth Classic devices. */
        var params = new Array();
        params["CONNECTABLE_DEVICE_ONLY"] = true;
        Runtime.StartBluetoothScanning(Runtime.BLUETOOTH_CLASSIC, params);
    } catch(e) {
        MessageBox(e.Message);
    }
}

Function OnBluetoothDeviceFound(e) {
    if (e.Name == "ExampleDeviceName") {
        try {
            Runtime.RequestBonding(e.DeviceId);
        } catch (e) {
            //.MessageBox(e.Message);
        }
    }
}

Function OnBluetoothBondingFinished(e) {
    if (e.bonded) {
        //.MessageBox("Bonding was successful.");
    } else {
        //.MessageBox("Bonding failed.");
    }
}

Related item

StartBluetoothScanning、GetBondedDeviceList method

Change History
*1　The specification has been changed since API version 26.


Runtime.SetBluetoothEnabled method

API version 15

Runtime.SetBluetoothEnabled methodChange History

iOSAndroidWindows

Explanation

Enables or disables the Bluetooth function of the device.

Android version
On devices running Biz/Browser HT 1.3.3 on later and Android 13 on later, Biz/Browser HT works as follows:
・When enabling the Bluetooth function, an OS confirmation message will be displayed.
・It is impossible to disable the Bluetooth function.

Call format

Runtime.SetBluetoothEnabled( enabled )

Return value

None

argument

boolean enabled

Specifies whether or not to enable the Bluetooth function of the device.

exception

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

RTM-113

Bluetooth device control is not supported.

RTM-114

Bluetooth could not be activated.。

RTM-115

Bluetooth could not be disabled.

Example of use

if(!Runtime.IsBluetoothEnabled()){
    MessageBox("Turn on the Bluetooth function.");
    try {
        Runtime.SetBluetoothEnabled(true);
    } catch (e) {
        //.Message("Exception", e.Message, ". It's happening.");
    }
} else {
    /* You can use the Bluetooth function */
}

Related item

IsBluetoothEnabled、ShowBluetoothSettings methods

Change History
*1　The specification has been changed since API version 26.


Runtime.SetCameraOption method

Explanation

Make various settings for the camera.

This method must call the StartCameraCapture method before execution .
If it is executed when the camera is not initialized or the camera is stopped, an RTM-46 exception will occur.

Precautions for use
Some settings may be invalid depending on the type of OS and hardware.
The number of required arguments depends on the value specified in the first argument.
Currently, the arguments used are up to param1, but in the
future, when the number of new configurable items increases, there is a possibility that the arguments after param2 will be used.

Call format

rt.SetCameraOption( type [, param1 [, param2 [, ...]]])

Return value

None

argument

int type

Specify the type of setting.
The values ​​that can be specified are as follows.

constant | value | Explanation
Runtime.CAMERA_OPTION_MODE | 0 | Camera to use (front / back)
Runtime.CAMERA_OPTION_FLASH | 1 | flash
Runtime.CAMERA_OPTION_ORIENTATION | 2 | Camera orientation
Runtime.CAMERA_OPTION_SIZE | 3 | Shooting size
Runtime.CAMERA_OPTION_ZOOM | 4 | zoom

int param1

The value specified and the number of arguments vary depending on the argument type .
The values ​​that can be specified are as follows.

Camera to use
constant | value | Explanation
Runtime.CAMERA_MODE_FRONT | 0 | Use the front camera.
Runtime.CAMERA_MODE_BACK | 1 | Use the rear camera. (initial value)

flash

Specify true to always light (torch mode), and false to not light.
The default is false.

Shooting size
constant | value | Explanation
Runtime.CAMERA_SIZE_LOW | 0 | Shoot in low resolution. The shooting size is set based on 192 [px] horizontal and 144 [px] vertical. If it is not possible to shoot at the standard size depending on the environment, the closest available resolution is automatically selected.
Runtime.CAMERA_SIZE_MEDIUM | 1 | Shoot in medium resolution. The shooting size is set based on 480 [px] horizontal and 360 [px] vertical. (Initial value) If it is not possible to shoot at the standard size due to the environment, the closest available resolution is automatically selected.
Runtime.CAMERA_SIZE_HIGH | 2 | Shoot in high resolution. The highest resolution that can be captured is automatically selected. Precautions for use Depending on the environment, the load may become extremely high and it may become inoperable.

Camera orientation
constant | value | Explanation
Runtime.CAMERA_ORIENTATION_LEFT | 0 | The left side of the terminal is up.
Runtime.CAMERA_ORIENTATION_TOP | 1 | Make it the same orientation as the terminal. (initial value)
Runtime.CAMERA_ORIENTATION_RIGHT | 2 | The right side of the terminal is up.
Runtime.CAMERA_ORIENTATION_BOTTOM | 3 | Turn the bottom of the terminal up.

zoom

Specify the zoom ratio with a value of 1.0 or more. The unit is magnification. The maximum zoom factor depends on the environment.

If you specify a value outside the range of 1.0 to maximum zoom magnification, it will be corrected to the minimum or maximum value.

The initial value is 1.0 times.

Android version
zoom ratio that can be captured is automatically converted from the zoom ratios that can be taken by the Android version of the device.

exception

RTM-46

Camera operation failed.

Example of use

/* Switch between front and back of the camera */
^.r.SetCameraOption (Runtime.CAMERA_OPTION_MODE, mode);
if(mode == Runtime.CAMERA_MODE_FRONT){
    mode = Runtime.CAMERA_MODE_BACK;
}else{
    mode = Runtime.CAMERA_MODE_FRONT;
}
See also the example of using StartCameraCapture .

Related item

 StartCameraCapture , GetCameraCaptureImage , StopCameraCapture methods


Runtime.ShellEdit method

This method is retained for compatibility. Nothing happens when I operate it.


Runtime.ShellLink method

API version 4

Runtime.ShellLink method change history

iOS Android Windows

Explanation

Follow the hyperlink.

The execution result of the ShellLink method depends on the computer environment.

If the link points to the local computer (starts with file:), there are security restrictions.

The display of the security warning dialog, the type of file that can be executed, and the difference in operation depending on the security level are the same as those of the ShellOpen method.

Call format

rt.ShellLink( URL )

Return value

None

argument

String URL

Specify the URL to link. * 1

Android version
specifying a URL with an absolute path, you can specify a scheme string that other applications can receive and interpret in addition to mailto :, http :, https :. The scheme string that can be received varies depending on the installed applications.
An error will occur if a URL that starts with a scheme character string that cannot be received is specified. * 2

exception

RTM-31

URL is invalid

RTM-11

External program cannot be executed due to security restrictions

RTM-13

The specified file was not found

RTM-32

Link operation has been canceled by the user

Example of use

var rt = new Runtime;
rt.ShellLink("http://biz-browser.jp");
rt.ShellLink("mailto:user@biz-browser.jp");

Related item

ShellOpen , Exec methods
Change history
* 1 From API version 8, if the URL is already percent-encoded, it will internally execute hyperlink to the URL without percent-encoding.
* 2 From API version 10, the specification has been changed so that a scheme string that can be received and interpreted by other applications can be specified.


Runtime.ShellOpen method

Explanation

Open the file in another application.

Android version
Open the file by the function of implicit intent.
Same as "Intent.ACTION_VIEW" in Android API, opens the file with an application that can handle the specified MIME type.

Calling the ShellOpen method will display a security warning dialog asking the user for permission to execute.

If the user chooses to cancel, an RTM-30 exception is raised.

If you check "Do not show confirmation message for this type of file in the future" in the warning dialog, the warning will not be displayed from the next time. The check status is recorded as a pair of the server name and file extension that downloaded the CRS that called the ShellOpen method. If you specify a server name or a URL whose extension cannot be specified, the check box will be disabled.

Difference in operation depending on security level

Show Warning Dialog

level | Explanation
0 | The file will be opened without displaying the warning dialog.
1 | Display a warning dialog and open the file if OK. After selecting "Do not show confirmation message", the warning dialog is not displayed.
2
3
Four | Always show a warning dialog and open the file if OK.

Call format

Android version
var result = rt.ShellOpen ( fileName , mime )

Return value

Returns $TRUE if the file was opened, $FALSE otherwise.

argument

String fileName

File path of file to open

Specify the path based on the root folder.

The root folder is the same as the public attribute of the FileSystem class .

string mime

Specify the file type to open in the MIME type format.

Example) "text/plain", "application/pdf"

exception

RTM-11

External program cannot be executed due to security restrictions

RTM-13

The specified file was not found

RTM-30

The open operation was canceled by the user

Example of use

var rt = new Runtime;
rt.ShellOpen("/files/sample.png", "image/png");

Related item

ShellLink , Exec methods


Runtime.ShowBluetoothSettings method

iOSAndroidWindows

Explanation

Display the Bluetooth setting screen of the device.

Call format

Runtime.ShowBluetoothSettings();

Return value

None

argument

None

exception

None

Example of use

Button btnShowBluetoothSettings {
    X = 10;
    Y = 10;
    Width = 150;
    Height = 24;
    Title = "Display the Bluetooth setting screen.";

    Function OnTouch(e){
        Runtime.ShowBluetoothSettings();
    }
}

Related item

IsBluetoothEnabled、SetBluetoothEnabled methods


Runtime.ShowCodeScanner method

API version 11

Runtime.ShowCodeScanner method change history

iOS Android Windows

Explanation

Scan barcodes and 2D codes.

By calling this method, the barcode and 2D code reading screen will be displayed.

Please note the following points when using.

(Hereinafter, bar code symbols and 2D code symbols are called symbols)

About scan settings

・ In order to prevent erroneous detection and improve performance, it is recommended to narrow down the code type, specify the read data length, and set the non-read target area.

Operation during scanning

・ When reading, move the terminal so that the symbol you want to read is firmly reflected in the reading area on the reading screen.

・ Especially when reading a two-dimensional code (QR code, DataMatrix, etc.), please shoot the symbol from directly above.

About reading accuracy and performance

・ Symbol recognition accuracy and recognition speed depend on the terminal, operating environment, and symbol status.

・ We do not guarantee that the symbols will always be read correctly. If necessary, add processing such as checking the read data length, verifying the check digit, and collating with the master.

・ The number of symbols that can be recognized simultaneously depends on the code type and scanning status. Especially in the case of a two-dimensional code (QR code, DataMatrix, etc.), multiple symbols may not be recognized at the same time.

Android version
use the Android version, you need to have the Google Play Developer Services app installed.
If the Google Play Developer Services app is not installed or is an older version, you will get an RTM-46 exception.

Call format

var result = Runtime.ShowCodeScanner( sourceType [, format [, extraParams ]]);

Return value

Returns a Record array with the following structure. Returns a Record array of length 0 if the reading was canceled.

Record{
    Number format; /* Type of code read. One of the types specified in the argument format is stored. */

       String data; /* The read result of the code is stored as a character string. */
}

argument

integer sourceType

Specify the target to get the image.

The values ​​that can be specified are as follows.

constant | value | Explanation
Runtime.SourceTypeRearCamera | 2 | Start the rear camera (on the back of the terminal) and scan.
Runtime.SourceTypeFrontCamera | 3 | Start the front camera (LCD side) and scan.

integer format

Specify by combining the barcode / two-dimensional code type to be scanned.

By default, Runtime.CODE_FORMAT_ALL is specified.

constant | value | Type
Runtime.CODE_FORMAT_CODE128 | 0x0001 | CODE128
Runtime.CODE_FORMAT_CODE39 | 0x0002 | CODE39
Runtime.CODE_FORMAT_CODABAR * 1 | 0x0008 | CodaBar (NW-7) * 4
Runtime.CODE_FORMAT_DATA_MATRIX * 1 | 0x0010 | DataMatrix
Runtime.CODE_FORMAT_EAN13 | 0x0020 | EAN-13 (JAN-13) * 1
Runtime.CODE_FORMAT_EAN8 | 0x0040 | EAN-8 (JAN-8)
Runtime.CODE_FORMAT_ITF | 0x0080 | ITF (Interleaved Two of Five)
Runtime.CODE_FORMAT_QR_CODE | 0x0100 | QR code * 5
Runtime.CODE_FORMAT_UPCA | 0x0200 | UPC-A * 1
Runtime.CODE_FORMAT_UPCE | 0x0400 | UPC-E
Runtime.CODE_FORMAT_PDF417 * 1 | 0x0800 | PDF417
Runtime.CODE_FORMAT_AZTEC * 1 | 0x1000 | Aztec
Runtime.CODE_FORMAT_ALL | 0xFFFF | All readable formats * 2 * 3

* 1: Among the symbols recognized as EAN-13, the one with 0 at the beginning is treated as UPC-A.

* 2: Please specify by itself without combining with other constants.

* 3: If a code type that can be read in the future is added, that code will also be read.

* 4: Only 6 or more characters (8 or more if start-stop characters are included) can be read.

* 5: QR Code Model 1 cannot be read.

Array extraParams

Specify other detailed settings.

Store the setting name in the argument Array key (character string) and the setting value in the value.

Key (string)

Value type

Default value

Explanation

"ALLOW_SAME_SYMBOL"

boolean

true

Specify the same symbol read permission.

Read allowed = true, Read prohibited = false

"CAMERA_FLASH"

boolean

false

Specify the initial state of the camera flash (LED).

ON = true, OFF = false

"CONTINUOUS_MODE"

boolean

false

Specify the reading mode.

Continuous read = true, Single scan = false

"CONVERT_UPCA_TO_EAN13"

boolean

false

Replace the symbol recognized as UPC-A with EAN-13.

(Add 0 to the beginning of data and convert from 12 digits to 13 digits)

Read enable = true, Read disable = false

"MAX_SCAN_COUNT"

integer

0

Specify the maximum number of readings.

Specify 0 (unlimited) or 1 or more. Values ​​outside the range are regarded as 0.

"SAME_SYMBOL_SCAN_INTERVAL"

number

1.0

Specify the time (in seconds) until the same symbol can be read.

You can specify a value of 0 or more. Values ​​outside the range are regarded as 0.

"SCAN_DATA_LENGTH" * 1

integer

Or

Array

null

Specify the data length to be read (the character string length of the code reading result).

If the target data length is different from this specification, the detected symbol will be ignored.

If you want to allow only a single data length, specify an integer value.

To allow multiple data lengths, specify an Array object that stores the data length as an integer.

If you specify null or an empty Array object, all data lengths are allowed.

"SCAN_AREA_MARGIN_LEFT"

number

0

Specify the area not to be scanned from the left edge.

You can specify between 0.0 and 1.0.

For example, if you specify 0.3, the left 30% of the screen will be the non-scanning area.

"SCAN_AREA_MARGIN_TOP"

number

0

Specify the area not to be scanned from the top edge.

You can specify between 0.0 and 1.0.

For example, if you specify 0.3, the upper 30% of the screen will be the non-scanning area.

"SCAN_AREA_MARGIN_RIGHT"

number

0

Specify the area not to be scanned from the right edge.

You can specify between 0.0 and 1.0.

For example, if you specify 0.3, the right 30% of the screen will be the non-scanning area.

"SCAN_AREA_MARGIN_BOTTOM"

number

0

Specify the area not to be scanned from the bottom edge.

You can specify between 0.0 and 1.0.

For example, if you specify 0.3, the lower 30% of the screen will be the non-scanning area.

"SCAN_SOUND_ID"

integer

(Empty value)

Specify the sound effect to play when scanning.

The value that can be specified is the sound effect Id acquired by the Runtime.LoadSound method.

If omitted or less than 0 is specified, or if Id that is not loaded at the time of reading is specified, no sound effect is played.

"SCAN_AREA_TOUCH_MODE" *2

boolean

false

Sets the reading area designation by touching the screen.

When "true" is specified, the symbol is read at the position where the screen is touched.

The size of the reading area is specified by SCAN_AREA_TOUCH_SIZE.

The valid time of the reading area is specified by SCAN_AREA_TOUCH_TIME.

"SCAN_AREA_TOUCH_SIZE" *2

number

0.2

Specifies the size of the scanning area when the reading area designation by screen touch is enabled.。

A value between 0.0 and 1.0 can be specified.

This is a percentage of the short side of the screen.

For example, if the device is in portrait orientation and 0.3 is specified, the scanning area will be 30% of the screen width, centered on the screen tap position.

"SCAN_AREA_TOUCH_TIME" *2

number

5.0

Specifies the time in seconds that the reading area is valid when the reading area is specified by touching the screen.

If 0 is specified, the reading area is fixed until the next time the screen is touched.

"SCAN_AREA_LINE_HORIZONTAL" *2

number

0.0

Draws a horizontal line on the screen and reads only the symbols that overlap the line.

If 0.0 or 1.0 is specified, no horizontal line will be drawn.

For example, if 0.3 is specified, the horizontal line will be drawn at 30% from the top of the screen.

If SCAN_AREA_LINE_VERTICAL is specified at the same time, only the symbols that overlap the intersection of the lines are read.

If SCAN_AREA_TOUCH_MODE is true, it is disabled.

"SCAN_AREA_LINE_VERTICAL" *2

number

0.0

Draws a vertical line on the screen and reads only the symbols that overlap the line.

If 0.0 or 1.0 is specified, no vertical line will be drawn.

For example, if 0.3 is specified, a vertical line will be drawn at 30% from the left of the screen.

If SCAN_AREA_LINE_HORIZONTAL is specified at the same time, only the symbols that overlap the intersection of the lines are read.

If SCAN_AREA_TOUCH_MODE is true, it is disabled.

"SHOW_DUPLICATED" *2

boolean

false

When false is specified for ALLOW_SAME_SYMBOL, this parameter specifies whether or not to display the mark on the read symbol.

The interval at which the mark is judged to be the same as the read symbol is the value specified in SAME_SYMBOL_SCAN_INTERVAL.

Show the mark=true Do not show the mark=false

"DUPLICATED_SOUND_ID" *2

integer

(Empty value)

When false is specified for ALLOW_SAME_SYMBOL, this function specifies the sound effect to be played when the read symbol is read again.

The value that can be specified is the sound effect Id obtained by the Runtime.LoadSound method.

If omitted, or if less than 0 is specified, or if an Id that is not loaded at the time of reading is specified, the sound effect will not be played.

The interval for judging whether or not it is the same as a symbol that has been read is the value specified for SAME_SYMBOL_SCAN_INTERVAL.

exception

FUNC-4

Invalid argument value

RTM-46

Camera operation failed.

Example of use

try{
    /* Read from rear camera */
    var sourceType = Runtime.SourceTypeRearCamera;
    /* Read EAN13 barcodes and QR codes only */
    var format = Runtime.CODE_FORMAT_EAN13 + Runtime.CODE_FORMAT_QR_CODE;
    /* Replace UPC-A barcode with EAN13 barcode */
    var extraParams = new Array;
    extraParams ["CONVERT_UPCA_TO_EAN13"] = true;
    /* Start reading */
    var rtm = new Runtime;
    var result = rtm.ShowCodeScanner(sourceType, format, extraParams);
    /* Result display */
    if(result.length> 0){
        //.MessageBox("Read result:"+ result [0] .data," Type: "+ str (result [0] .format));
    }else {
        //.MessageBox("Read canceled");
    }
}catch(e){
    //.MessageBox(e.Method + "-" + str (e.Code));
    //.MessageBox(e.message);
}

Related item

LoadSound method

Change history
* 1 Added from API version 12.
* 2 Added from API version 18.


Runtime.ShowImagePicker method

API version 4

Runtime.ShowImagePicker method change history

iOS Android Windows

Explanation

Take and capture images from your camera or image library.

Android version
This feature is retained for compatibility. Nothing happens when I operate it.

Call format

var img = rt.ShowImagePicker ( sourceType )

Return value

Returns the selected or captured image as an Image object.

argument

integer sourceType

Specify the target to get the image.

The values ​​that can be specified are as follows.

constant | value | Explanation
Runtime.SourceTypePhotoAlbum | 0 | Select from photo album
Runtime.SourceTypePhotoLibrary | 1 | Choose from photo library
Runtime.SourceTypeRearCamera | 2 | Start the rear camera (on the back of the terminal) and get the picture taken
Runtime.SourceTypeFrontCamera | 3 | Start the front camera (LCD side) and get the picture taken

exception

FUNC-4

Invalid argument value

RTM-30

The open operation was canceled by the user

RTM-45

The library cannot be accessed. %s

RTM-46 *1

Camera operation failed.

Example of use

try{
    var rt = New Runtime;
    var img = rt.ShowImagePicker(Runtime.SourceTypeRearCamera);
    ^.imgForm.ImageLabel1.SetImage(img);
}catch(e){
    //.MessageBox(e.Method + "-" + str(e.Code));
    //.MessageBox(e.message);
}

Related item

Change log
*1 Changed to generate a new exception when the setting does not allow access to the camera function. (Only for functions that require a camera)


Runtime.StartBluetoothScanning method

API version 15

Runtime.StartBluetoothScanning methodChange History

iOSAndroidWindows

Explanation

Start scanning for Bluetooth devices.

Information about devices detected by the scan is received as an event.

The BluetoothScanStarted event occurs when the Bluetooth device starts scanning.

When the scan is finished or cancelled, the BluetoothScanFinished event is raised. To cancel the scan, use the CancelBluetoothScanning method.

When a Bluetooth device is detected, the BluetoothDeviceFound event is fired. You can get the device information of the scan result from the child object of the event object.

The same device may be detected multiple times; this can be used to see changes in the RSSI value (Received Signal Strength Indication) of the BLE device.

Call format

Runtime.StartBluetoothScanning( type [, params ] )

Return value

None

argument

integer type

Specifies the type of device to scan.
The values that can be specified are as follows

Constant | Value | Explanation
Runtime.BLUETOOTH_CLASSIC | 1 | Scan for devices that support Bluetooth Classic. The search for Bluetooth Classic devices will automatically end in about 12 seconds (OS limitation).
Runtime.BLUETOOTH_LE | 2 | Scan for devices that support BLE (Bluetooth Low Energy).

Array params

Specify the search parameters as an associative array with the parameter names as keys.
The values that can be specified are as follows

Key | Explanation
CONNECTABLE_DEVICE_ONLY | Specify whether or not to search only for connectable devices by using boolean. The default is true.
FILTER_SERVICE_UUID *1 | Filter the services to be searched. Specify an Array object that contains the UUID string of the service to be filtered.

exception

FUNC-4

Invalid argument value

RTM-54

Failed to access the Bluetooth function of the device.

RTM-83

Bluetooth is not enabled.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *2

RTM-113

Bluetooth device control is not supported.

RTM-119

The BluetoothLE function could not be used.

Example of use

Form form1 {
    Width = 424;
    Height = 320;

    Button btnStartScanning {
        X = 16;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Start device scan";

        Function OnTouch( e ) {
                try {
                    /* Start scanning for Bluetooth LE devices. */
                    var params = new Array();
                    params["CONNECTABLE_DEVICE_ONLY"] = true;
                    Runtime.StartBluetoothScanning(Runtime.BLUETOOTH_LE, params);
                } catch(e) {
                    MessageBox(e.Message);
                }
        }
    }

    Button btnStopScanning {
        X = 184;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Stop device scan";

        Function OnTouch( e ) {
            Runtime.CancelBluetoothScanning();
        }
    }
}
Function OnBluetoothScanStarted(e){
    print("Start scan\n");
}
Function OnBluetoothScanFinished(e){
    print("Stop scan\n");
}
Function OnBluetoothDeviceFound(e){
    print(e.DeviceID + "\n");
}

Related item

CancelBluetoothScanning、RequestBonding methods

Change History
*1　The specification has been changed since API version 20.
*2　The specification has been changed since API version 26.


Runtime.StartCameraCapture method

Explanation

Initialize the camera and start capturing with the camera.
The camera is controlled by combining this method with the following three methods.
· SetCameraOption method
· GetCameraCaptureImage method
· StopCameraCapture method

this method will be the very first to the execution of camera control.
By executing it, you can change the camera settings, acquire images from the camera, and stop the camera.

Call format

rt.StartCameraCapture()

Return value

None

argument

None

exception

RTM-46

Camera operation failed.

Example of use

/* Camera status */
Number isRun = $FALSE;
/* Current number of shots */
Number num = 0;
Function Start(){
    /* Start capture */
    ^.rtm.StartCameraCapture();
    /* Capture settings */
    ^.rtm.SetCameraOption(Runtime.CAMERA_OPTION_MODE, Runtime.CAMERA_MODE_FRONT);
    /* Start timer * /
    SetTimer(0.1);
    isRun = $TRUE;
    num = 0;
}
Function OnTimer(e){
    /* Do nothing if called while the camera is stopped */
    if(!isRun){return;}
    /* Auto stop after taking a few shots */
    if(num ++> MAX_SHOT){
        ^.rtm.StopCameraCapture();
        RemoveTimer();
        isRun = $FALSE;
        return;
    }
    /* Get image */
    var img = ^.rtm.GetCameraCaptureImage();
    /* Set the acquired image */
    if(img! = null && img.width> 0 && img.height> 0){
        ^.lbl.setImage(img);
    }
}

Related item

 SetCameraOption , GetCameraCaptureImage , StopCameraCapture method


Runtime.ShowNfcSettings method

Explanation

Displays the NFC setting screen of the terminal and immediately continues the subsequent processing.

Call format

var maxMem = Runtime.ShowNfcSettings();

Return value

None

argument

None

exception

None

Example of use

/* Check if NFC function is available */
if(!Runtime.HasNfcFeature()){
    //.MessageBox("This device cannot read NFC tag.");
}else if (! Runtime.IsNfcReaderEnabled()){
    //.MessageBox("NFC reader / writer function is off. Please set it to On.");
    Runtime.ShowNfcSettings(); /* Show settings screen */
}else {
    /* Ready to start reading NFC */
}

Related item

IsNfcReaderEnabled method


Runtime.StartLocationMeasure method

Explanation

Start positioning. If the location information is updated, it will be notified in the LocationChanged event.

Call format

Android version
Rt.StartLocationMeasure( accuracy or providers ) for Android

Return value

None

argument

Number accuracy

Accuracy information

The values ​​that can be specified are as follows.

constant | value | Explanation
Runtime.LOCATION_ACCURACY_HIGH | 8 | Position with the highest accuracy
Runtime.LOCATION_ACCURACY_MEDIUM | 9 | Positioning with medium accuracy (error of around several hundred meters)
Runtime.LOCATION_ACCURACY_LOW | 10 | Positions with low accuracy (error of around several kilometers)

Number providers

Specify one or more location providers to perform positioning.

Normally, the above accuracy should be specified.

It cannot be specified with accuracy at the same time.

The values ​​that can be specified are as follows.

constant | value | Explanation
Runtime.LOCATION_PROV_GPS | 1 | Position using GPS (Global Positioning System)
Runtime.LOCATION_PROV_NETWORK | 2 | Positions using mobile networks and WiFi.

exception

None

Example of use

var rt = new Runtime;
rt.StartLocationMeasure(Runtime.LOCATION_ACCURACY_MEDIUM);

Related item

StopLocationMeasure method, LocationChanged event


Runtime.StopCameraCapture method

API version 8

Runtime.StopCameraCapture method change history

iOS Android Windows

Explanation

Stops camera capture.

This method must call the StartCameraCapture method before execution .
If it is executed when the camera is not initialized or the camera is stopped, an RTM-46 exception will occur.

Call format

rt.StopCameraCapture ([ release ] * 1 )

Return value

None

argument

boolean release

argument is ignored. It can be omitted.

It is left for compatibility.* 2

exception

RTM-46

Camera operation failed.

Example of use

r.StopCameraCapture();
* See also the usage example of StartCameraCapture .

Related item

 StartCameraCapture , SetCameraOption , GetCameraCaptureImage method
Change history
* 1 From API version 12, a function to specify whether to release the secured state of the device resource of the camera has been added.
* 2 Until API version 14, this feature was used to specify whether or not to release the device resources of the camera, but this feature has been removed.


Runtime.StopLocationMeasure method

Explanation

Stop positioning.

Call format

var result = rt.StopLocationMeasure()

Return value

None

argument

None

exception

None

Example of use

var rt = new Runtime;
rt.StartLocationMeasure(Runtime.LOCATION_ACCURACY_MEDIUM);
/* … */
rt.StopLocationMeasure();

Related item

StartLocationMeasure method


Runtime.ShowLocationSettings method

Explanation

Displays the location information service setting screen of the terminal and immediately continues the subsequent processing.

Call format

var maxMem = Runtime.ShowLocationSettings();

Return value

None

argument

None

exception

None

Example of use

/* Displays the setting screen if GPS positioning is not enabled */
if(Runtime.IsProviderEnabled(Runtime.LOCATION_PROV_GPS)){
    Runtime.ShowLocationSettings();
}

Related item

IsProviderEnabled method


Runtime.UnloadSound method

Explanation

Unload the audio file for sound effects.

Call format

Runtime.UnloadSound( soundID ).

Return value

None

argument

integer soundID

Sound effect ID

Specify the sound effect to be unloaded with the value obtained from the return value of the LoadSound method.

exception

FUNC-4

Invalid argument

Example of use

/* When you want to release the sound effect */
rtm.UnloadSound(soundID);

Related item

LoadSound method

PlaySound method


Runtime event

API version 4

Event

The following events are defined in the Runtime class.

API | name | Explanation
HT (10) | EndProcess | It is retained for compatibility. Does not occur.
4 | LocationChanged | It occurs when the location information is updated for the object that started positioning with StartLocationMeasure

Class overview

Base class event


Runtime.LocationChanged event

This event occurs when the location information is updated while positioning is started by the StartLocationMeasure method.

The LocationChanged event has the following structure.

Event{
    Number provider; /* Get the location provider that obtained this location information. */
    Number latitude; /* Get the latitude. The unit is degree (deg). */
    Number longitude; /* Get the longitude. The unit is degree (deg). */
    Date time; /* The time when this location information was acquired is stored. */
    Number hasAccuracy; /* $TRUE is stored if the measurement accuracy can be acquired, $FALSE is stored otherwise. */
    /* The following child objects exist only when hasAccuracy = $TRUE */
    Number accuracy; /* Gets the measurement accuracy. The unit is meter (m). */
}

In addition to latitude and longitude, the location information includes the acquisition time, measurement accuracy, and information on the location provider that measured it.

When actually using the location information, select the location information suitable for the purpose based on this information and use it.

LocationChanged event is generated when the OS location provider updates location information.

Therefore, if positioning takes a long time like GPS or there is a terminal in a place where positioning cannot be performed, the event may not occur for a long time.

If the Runtime object is not included in the object tree, be careful when writing the event handler.

When referencing other objects from objects not included in the object tree, you can only refer to global objects, absolute paths from "//", and child objects of your own object.

Description example not included in the object tree

var rt = new Runtime{
    Function OnLocationChanged(e){
    /* Runtime objects are not included in the object tree */
    /* Other objects cannot be referenced by relative path here */
    }
}
rt.StartLocationMeasure(Runtime.LOCATION_GPS);

Description example included in the object tree

Runtime tr{
    Function OnLocationChanged(e){
    /* Runtime objects are included in the object tree */
    /* Again, you can reference other objects by relative path */
    /* Objects remain permanently unless deleted after use */
    }
}
rt.StartLocationMeasure(Runtime.LOCATION_GPS);


SerialPort class

iOSAndroidWindows

Object
 | SerialPort

Class for USB serial communication.

Like the File class, it can also be used in conjunction with other classes.

Default properties and ValueType

There are no default properties. The value type specification is invalid.


SerialPort property

API version 22

Property

iOSAndroidWindows

The following properties are defined in the SerialPort class.

API | name | access | type | Initial value | Explanation
22 | BaudRate | CRW | integer | 9600 | Baudrate
22 | DataBits | CRW | integer | 8 | Number of data bits
22 | DeviceType | CRW | String |  | Device type
22 | Parity | CRW | integer | 0 | Parity method
22 | ProductID | CRW | integer | 0 | Device product ID
22 | StopBits | CRW | integer | 1 | Number of stop bits
22 | Timeout | CRW | Number | 0 | Timeout values for Read and ReadLine methods
22 | VendorID | CRW | integer | 0 | Device vendor ID

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


SerialPort.BaudRate property

iOSAndroidWindows

Specifies the baudrate.

The default is 9600.


SerialPort.DataBits property

iOSAndroidWindows

Specifies the number of data bits; can be 7 or 8.

The default value is 8.


SerialPort.DeviceType property

iOSAndroidWindows

Specify the device type from the following values:

constant | value | Explanation
SerialPort.DEVICE_AUTO | "" | Automatic detection of device type
SerialPort.DEVICE_CDC | "cdc" | CDC device
SerialPort.DEVICE_CH34x | "ch34x" | CH34x device
SerialPort.DEVICE_CP210x | "cp210x" | CP210x device
SerialPort.DEVICE_FTDI | "ftdi" | FTDI device
SerialPort.DEVICE_PL2303 | "pl2303" | PL2303 device

Default is SerialPort.DEVICE_AUTO.


SerialPort.Parity property

iOSAndroidWindows

Specify the parity bit from the following values:

constant | value | Explanation
SerialPort.PARITY_NONE | 0 | no parity
SerialPort.PARITY_ODD | 1 | Odd parity
SerialPort.PARITY_EVEN | 2 | Even parity

Default is SerialPort.PARITY_NONE.


SerialPort.ProductID property

iOSAndroidWindows

Specify the product ID of the device to be connected.

If both the VendorID and ProductID properties are non-zero, the connection is made with the device matching the specified vendor ID and product ID.

Default is 0.


SerialPort.StopBits property

iOSAndroidWindows

Specify the number of stop bits from the following values:

constant | value | Explanation
SerialPort.STOP_BITS_1 | 1 | 1 bit
SerialPort.STOP_BITS_2 | 2 | 2 bit

Default is SerialPort.STOP_BITS_1.


SerialPort.Timeout property

iOSAndroidWindows

Specifies the timeout period in seconds for the Read and ReadLine methods.

The default is 0 (do not wait for reception).


SerialPort.VendorID property

iOSAndroidWindows

Specify the vendor ID of the device to be connected.

If both the VendorID and ProductID properties are non-zero, the connection is made with the device matching the specified vendor ID and product ID.

Default is 0.


SerialPort method

API version 22

Method

iOSAndroidWindows

The following methods are defined in the SerialPort class.

API | name | Explanation
22 | Close | Closes the connection to the device
22 | Open | Connect with device
22 | Read | Reads the received data
22 | ReadLine | Reads a single line of string data from the received data
22 | Write | Send data
22 | WriteString | Sends a string

Static method

API | name | Explanation
22 | GetDeviceList | Get a list of USB serial devices

Class overview

Base class methods


SerialPort.Close method

iOSAndroidWindows

Explanation

Disconnects from the device.

After connecting to a device with the Open etc., be sure to close the device after reading or writing.

Call format

port.Close()

Return value

None

argument

None

exception

None

Example of use

var port = new SerialPort;
port.DeviceType = SerialPort.DEVICE_AUTO;
port.Open();
port.WriteString("hello");
port.Close();

Related item

Open method


SerialPort.GetDeviceList method

iOSAndroidWindows

Explanation

Gets a list of USB serial devices connected to the terminal.

Call format

var devices = SerialPort.GetDeviceList( )

Return value

An array of Records with the following child objects is returned.

Type | name | Explanation
Number | VendorId | Vendor ID
Number | ProductId | Product ID
String | ProductName | Product name
String | DeviceName | Device name

argument

None

exception

None

Example of use

var devices = SerialPort.GetDeviceList();
var port = new SerialPort();
for (var i = 0; i < devices.length; i++) {
    port.VendorID = devices[i].VendorID;
    port.ProductID = devices[i].ProductID;
    port.Open();
    break;
}

Related item

Open method


SerialPort.Open method

API version 22

SerialPort.Open methos

iOSAndroidWindows

Explanation

Connect with the device.

If both the VendorID and ProductID properties are non-zero, the connection is made with the device matching the specified vendor ID and product ID.

If either the VendorID or ProductID property is 0, connect to the first serial device found that can be opened.

Call format

port.Open()

Return value

None

argument

None

exception

RTM-74

Can not connect to the specified device.

RTM-123

Already connected to device.

RTM-125

You do not have permission to connect to the specified USB device

RTM-126

No connectable serial device was found

Example of use

var port = new SerialPort;
port.DeviceType = SerialPort.DEVICE_AUTO;
port.Open();
port.WriteString("hello");
port.Close();

Related item

Close method


SerialPort.Read method

iOSAndroidWindows

Explanation

Reads data received from the device.

If the read is not completed within the time specified by the Timeout property, the data that has been read up to that point is returned.

Call format

var data= port.Read( size )

Return value

ByteArray object containing the read data.

argument

integer size

Size to read. Specify the size in bytes.

If omitted or a negative value is specified, the value is assumed to be 4096.

exception

RTM-124

No connected to a device.

Example of use

var port = new SerialPort;
port.Open();
while (true) {
    var data = port.Read(256);
    if (data.Length <= 0) {
        break;
    }
    print(data);
    port.Write(data);
}
port.Close();

Related item

ReadLine、Write method


SerialPort.ReadLine method

iOSAndroidWindows

Explanation

Reads a single line of string data from the received data.

If the reading does not complete within the time specified by the Timeout property, an empty string is returned.

Call format

var data = port.ReadLine()

Return value

Returns the read string data as a String object.

Newline characters at the end of the line are not included. If the end of the data is reached and no more can be read, an empty string is returned.

argument

None

exception

RTM-124

No connected to a device

Example of use

var port = new SerialPort;
port.Open();
while (true) {
    var data = port.ReadLine();
    if (data.length <= 0) {
        break;
    }
    print(data);
    port.WriteString(data);
}
port.Close();

Related item

Read、WriteString method


SerialPort.Write method

iOSAndroidWindows

Explanation

Send data to the device.

Automatically converts data to byte data according to the data type.

Call format

port.Write( data )

Return value

None

argument

data

Data to be written

exception

RTM-10

Unknown type of output data. Unknown byte numbers to output

RTM-73

Write operation did not complete

RTM-124

No connected to a device.

Example of use

var port = new SerialPort;
port.Open();
while (true) {
    var data = port.Read(256);
    if (data.Length <= 0) {
        break;
    }
    print(data);
    port.Write(data);
}
port.Close();

Example of use

WriteString、Read method

The difference in writing format for each data type

Depending on the data type of the variable specified for data, the format to be written will be as follows.

data type | example | Explanation
String | Write("abc") Write(new String("abc")); | character string data String data will be written in UTF-8.
integer | Write(10) | Integer value data It is written as 4 bytes of signed integer data.
boolean | Write(true) | bool-value data It is written as 4 bytes of signed integer data. The value is 1 if true, 0 if false.
Number | Write(1.2) Write(new Number(10)) | Numeric (floating point) data The data is written as 8 bytes of floating point data.
Date | Write(new Date()) | Date data The value of the Value property will be written as 8 bytes of floating point data.
ByteArray | Results read by the Read method, etc. | binary data Binary data will be written as is.

If you always want to write as a string, use the WriteString method.


SerialPort.WriteString method

iOSAndroidWindows

Explanation

Writes string data to the device.
Converts data to a string and sends it.

Call format

port.WriteString( data )

Return value

None

argument

String data

String data to be written

exception

RTM-73

Write operation did not complete

RTM-124

No connected to a device.

Example of use

var port = new SerialPort;
port.Open();
while (true) {
    var data = port.ReadLine();
    if (data.length <= 0) {
        break;
    }
    print(data);
    port.WriteString(data);
}
port.Close();

Related item

Write、ReadLine method


SerialPort event

API version 22

Event

iOSAndroidWindows

The following events are defined in the SerialPort class.

API | name | Explanation
22 | Receive | Notifies the user that data is ready to be received

Class overview

Base class event


SerialPort.Receive event

iOSAndroidWindows

This event occurs when data is ready to be received.


Socket class

iOSAndroidWindows

Object
 | Socket

This class performs communication through a TCP/IP socket connection.

Like the File class, it can also be used in conjunction with other classes.

In addition to being created by itself and used as a client, it may be automatically created as a server socket by the SocketListener class.

Default properties and ValueType

The default property is Value.The ValueType can be String, Number, Fixed, or Date.


Socket property

API version 15

Property

iOSAndroidWindows

The following properties are defined in the Socket class.

API | name | access | type | Initial value | Explanation
15 | BufferSize | CRW | integer | 65536 | Receive buffer size
15 | Host | R | String |  | Host name or IP address of the connection destination
15 | IsConnected | R | boolean |  | Whether the socket is connected or not
15 | Port | R | integer |  | Port number to connect to
15 | Timeout | CRW | integer | 0 | Timeout values for Read and ReadLine methods
15 | Value | CRW | String Number Fixed Date |  | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


Socket.BufferSize property

iOSAndroidWindows

Specifies the size of the socket's receive buffer in bytes.

The default is 65536 bytes.


Socket.Host property

iOSAndroidWindows

The client-side host name of the socket being connected to is stored.

This property is read-only and cannot be modified.


Socket.IsConnected property

iOSAndroidWindows

The value is $TRUE if the socket is already connected, otherwise it is $FALSE.

This property is read-only and cannot be modified.


Socket.Port property

iOSAndroidWindows

The client-side port number of the currently connected socket is stored.

This property is read-only and cannot be changed.


Socket.Timeout property

iOSAndroidWindows

Specifies the timeout period in seconds for the Read and ReadLine methods.

The default is 0 (do not wait for reception).


Socket.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


Socket method

API version 15

Method

iOSAndroidWindows

The following methods are defined in the Socket class.

API | name | Explanation
15 | Close | Close the socket.
15 | Open | Open the socket.
15 | Read | Reads data from the socket
15 | ReadLine | Reads a single line of string data from the socket
15 | Write | Write data to the socket
15 | WriteString | Writes string data to the socket

Class ovewview

Base class methods


Socket.Close method

iOSAndroidWindows

Explanation

Close the socket and disconnect the connection.

Be sure to close the socket opened by the Open method, etc., after reading or writing is completed.

Call format

sock.Close()

Return value

None

argument

None

exception

RTM-71

Socket is not open.

Example of use

var sock = new Socket;
sock.Open("192.168.1.10", 16000);
sock.WriteString("hello");
sock.Close();

Related item

Open method


Socket.Open method

iOSAndroidWindows

Explanation

Open a socket to a port on the host (server) to connect.

Call format

sock.Open( host, port )

Return value

None

argument

String host

Host name or IP address

integer port

port number

Specify a value in the range of 1 to 65535.

exception

RTM-68

The socket is already open.

RTM-69

Unable to connect to the specified host.

Example of use

var sock = new Socket;
sock.Open("192.168.1.10", 16000);
sock.WriteString("hello");
sock.Close();

Related item

Close method


Socket.Read method

iOSAndroidWindows

Explanation

Reads data from the socket.

The process will not return until the specified size of data is received or the timeout occurs.

Call format

var data= sock.Read( size )

Return value

ByteArray object containing the read data.

argument

integer size

Size to read. Specify the size in bytes.

If omitted or a negative value is specified, the value is assumed to be 4096.

exception

RTM-71

Socket is not open.

RTM-72

Could not complete the read operation.

Example of use

var sock = new Socket;
sockr.Open("192.168.1.10", 16000);
while (true) {
    var data = sock.Read(256);
    if (data.Length <= 0) {
        break;
    }
    print(data);
    sock.Write(data);
}
sock.Close();

Related item

ReadLine、Write method


Socket.ReadLine method

iOSAndroidWindows

Explanation

Reads a single line of string data from the socket.

This function reads the string data from the current read position of the socket to the next newline character.

The process will not return until one line is received or timeout. Any error other than a timeout will result in an exception.

Call format

var data = sock.ReadLine()

Return value

Returns the read string data as a String object.

Newline characters at the end of the line are not included. If the end of the data is reached and no more can be read, an empty string is returned.

argument

None

exception

RTM-71

Socket is not open.

RTM-72

Could not complete the read operation.

Example of use

var sock = new Socket;
sock.Open("192.168.1.10", 16000);
while (true) {
    var data = sock.ReadLine();
    if (data.length <= 0) {
        break;
    }
    print(data);
    sock.WriteString(data);
}
sock.Close();

Related item

Read、WriteString method


Socket.Write method

iOSAndroidWindows

Explanation

Writes data to the socket.

Automatically converts data to byte data according to the data type.

Call format

sock.Write( data )

Return value

None

argument

data

Data to be written

exception

RTM-10

The type of output data is unknown. The number of bytes to be output is unknown.

RTM-71

Socket is not open.

RTM-73

Could not complete the write operation.

Example of use

var sock = new Socket;
sockr.Open("192.168.1.10", 16000);
while (true) {
    var data = sock.Read(256);
    if (data.Length <= 0) {
        break;
    }
    print(data);
    sock.Write(data);
}
sock.Close();

Related item

WriteString、Read method

The difference in writing format for each data type

Depending on the data type of the variable specified for data, the format to be written will be as follows.

data type | example | Explanation
String | Write("abc") Write(new String("abc")); | character string data String data will be written in UTF-8.
integer | Write(10) | Integer value data It is written as 4 bytes of signed integer data.
boolean | Write(true) | bool-value data It is written as 4 bytes of signed integer data. The value is 1 if true, 0 if false.
Number | Write(1.2) Write(new Number(10)) | Numeric (floating point) data The data is written as 8 bytes of floating point data.
Date | Write(new Date()) | Date data The value of the Value property will be written as 8 bytes of floating point data.
ByteArray | Results read by the Read method, etc. | binary data Binary data will be written as is.

If you always want to write as a string, use the WriteString method.


Socket.WriteString method

iOSAndroidWindows

Explanation

Writes string data to the socket.
Converts data to a string and sends it.

Call format

sock.WriteString( data )

Return value

None

argument

String data

String data to be written

exception

RTM-71

Socket is not open.

RTM-73

Could not complete the write operation.

Example of use

var sock = new Socket;
sock.Open("192.168.1.10", 16000);
while (true) {
    var data = sock.ReadLine();
    if (data.length <= 0) {
        break;
    }
    print(data);
    sock.WriteString(data);
}
sock.Close();

Related item

Write、ReadLine method


Socket event

API version 15

Event

iOSAndroidWindows

The following events are defined in the Socket class.

API | name | Explanation
15 | Receive | Notifies the user that data is ready to be received

Class overview

Base class events


Socket.Receive event

iOSAndroidWindows

This event occurs when data is ready to be received.


SocketListener class

iOSAndroidWindows

Object
 | SocketListener

Create a TCP/IP server socket and wait to receive.

When a connection is made from a client, a Socket object is created as a child object.

After creating a SocketListener object and setting the Port property, call the Start method to enter the TCP/IP socket listening state.

If the Port is already in use on the computer when the Start method is called, an error will occur, an exception will be raised, and socket listening will be aborted.

Default properties and ValueType

The default property is Value.The ValueType can be String, Number, Fixed, or Date.


SocketListener property

API version 15

Property

iOSAndroidWindows

The following properties are defined in the SocketListener class.

API | name | access | type | Initial value | Explanation
15 | IsListening | R | boolean |  | Whether a socket is waiting or not.
15 | Port | CR | integer | 80 | Receive port number
15 | Value | CRW | String Number Fixed Date |  | The value of the object

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class properties


SocketListener.IsListening property

iOSAndroidWindows

If the object is waiting for a socket, it is $TRUE; otherwise, it is $FALSE.

This property is read-only and cannot be modified.


SocketListener.Port property

iOSAndroidWindows

Specify the TCP/IP receive port number.

The default is 80. It is not possible to specify the same port number that is already in use in the computer.


SocketListener.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


SocketListener method

API version 15

Method

iOSAndroidWindows

The following methods are defined in the SocketListener class.

API | name | Explanation
15 | Start | Start waiting for reception
15 | Stop | Stop waiting for reception

Class overview

Base class methods


SocketListener.Start method

iOSAndroidWindows

Explanation

Start waiting for a socket to be received.

Please set the Port property prior to calling this method.

Waiting for an event is stopped by calling the Stop method.

When the SocketListener object disappears, it also stops waiting for events, but the processing timing for the object's disappearance is indefinite.

Be sure to call the Stop method to stop it.

Call format

sockListener.Start()

Return value

None

argument

None

exception

RTM-68

The socket is already open.

RTM-70

Failed to wait for reception.

Example of use

SocketListener sockListener {
    Port = 16000;
    Function OnAccept(e) {
        :
    }
    if (!$DESIGNTIME) {
        Start();
    }
}

Related item

Stop method


SocketListener.Stop method

iOSAndroidWindows

Explanation

Stops waiting for a socket to be received.

When the SocketListener object disappears, it also stops waiting for events, but the processing timing for the object's disappearance is indefinite.

If you start the waiting process with the Start method, be sure to call the Stop method to stop it.

Call format

sockListener.Stop()

Return value

None

argument

None

exception

None

Example of use

SocketListener sockListener {
    Port = 16000;
    Function OnAccept(e) {
        :
    }
    if (!$DESIGNTIME) {
        Start();
    }
}

Related item

Start method


SocketListener event

API version 15

Event

iOSAndroidWindows

The following events are defined in the SocketListener class.

API | name | Explanation
15 | Accept | Occurs when a connection is made from a TCP/IP client socket.

Class overview

Base class events


SocketListener.Accept event

iOSAndroidWindows

This event is fired when a connection is established from a client socket to a server socket waiting in the Start method.

The following child objects are attached to the Event object.

type | name | Explanation
String | SocketName | The Socket object name created by the connection is stored.

SocketName is set to the name of the Socket object created by the connection.

The Socket object will automatically be connected to the SocketListener as a child object.

For example, you can get the Socket created by FindChild(e.SocketName).

When the communication is finished and the Socket object is no longer needed, delete it with the Delete method.

When data arrives at the created Socket and the Receive event occurs, the event will be propagated to the parent object, SocketListener.

By writing the event handler OnReceive in the SocketListener object, it is possible to identify the Socket object by e.From and implement the receiving process.


Converter package

This is a package of conversion related classes.

class

API | name | Explanation
4 | Base64Decoder | Decrypt Base64 data
4 | Base64Encoder | Base64 encoding is performed
4 | NewlineConverter | Convert line feed code
4 | NullConverter | No conversion class
4 | TextConverter | Convert character code


Base64Decoder class

Object
 | Base64Decoder

A class that decodes Base64 data. Used to restore Base64 data to the original binary data.

Base64 encoding (encoding) of binary data is performed by the Base64Encoder class.

Base64 is a conversion method that assigns and encodes binary data to a character string containing only alphanumeric characters. It is used when sending and receiving binary data, such as by e-mail, which is premised on sending and receiving text data.

There are two methods depending on the Base64 data to be decoded.

One is to decode the I / O of the Reader / Writer object . Specify the object used for data input / output in the constructor of Base64Decoder class .

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_READ);
var b64d = new Base64Decoder (fp);
var data = b64d.Read();
b64d.Close(true);

Another method is to directly decode Base64 data.

var dec_data = Base64Decoder.Convert ("g0GDToNWg1iDXIN0g2c =");

In this example, Base64 data is decoded and stored in the dec_data variable.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


Base64Decoder property

API version 4

Property

iOS Android Windows

The following properties are defined in the Base64Decoder class.

name | access | Type | Explanation
Filename | R | String | file name
PathName | R | String | Path name
Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Base64Decoder.FileName property

Indicates the file name to input / output data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


Base64Decoder.PathName property

Indicates the path name for inputting / outputting data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


Base64Decoder.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


Base64Decoder method

API version 4

Method

iOS Android Windows

The following methods are defined in the Base64Decoder class.

name | Explanation
( Constructor ) | Initialize the Base64Decoder object
Close | End output or input
Read | Read the decoded binary data
Write | Write the decoded binary data

Static method

name | Explanation
Convert | Decode Base64 data

Class overview

Base class methods


Base64Decoder constructor

Explanation

Initialize the Base64Decoder object.

Call format

var b64d = new Base64Decoder ( rw_obj )

Return value

Initialized Base64Decoder object

argument

Object rw_obj

Specify the Reader object that is the input source of Base64 data or the Writer object that is the output destination of the decoding result .

ByteArray can also be specified as an I/O object.

If you specify a Reader object, you cannot use the Write method.

If you specify a Writer object, you cannot use the Read method.

exception

CONVERT 1

No valid object specified

CONVERT 10

Illegal argument

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_WRITE);
var b64e = new Base64Encoder(fp);
b64e.Write("Biz/Browser");
b64e.Close(true);

var fp2 = fs.Open("base64.txt", FileSystem.OPEN_READ);
var fp3 = fs.Open("output.dat", FileSystem.OPEN_WRITE);
var b64d = new Base64Decoder(fp3);
b64d.Write(fp2.Read());
b64d.Close(true);
fp2.Close();

Related item

Read , Write , Close methods


Base64Decoder.Close method

Explanation

Ends output or input.

If the output from the Write method remains in the internal buffer, it will be passed to the Writer object when the Close method is called.

Call format

b64d.Close([ deep ])

Return value

None

argument

boolean deep

If $TRUE is specified, the Close method of the Reader / Writer object specified in the constructor will be called.

Otherwise, it closes the Base64Decoder object, but the Reader / Writer object's Close method is not executed.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_READ);
var b64d = new Base64Decoder (fp);
var data = b64d.Read();
b64d.Close($TRUE);

Related item

Read , Write methods


Base64Decoder.Read method

Explanation

Read the decoded binary data.

Decodes Base64 data read fromthe Reader object specified in the constructor and returns size bytes of datafrom the result.

Call format

var data = b64d.Read([ size ])

Return value

Base64 data decoded result

Returns a ByteArray object. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified -1, it will be read to the end.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_READ);
var b64d = new Base64Decoder(fp);
var data = b64d.Read();
b64d.Close(true);
print(data, "\n");

Related item

Close method

ByteArray class


Base64Decoder.Write method

Explanation

Writes the decoded binary data.

data decode the Base64 data that you specified, the constructor was specified in the Writer object to write to.

The output of the Write method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

b64d.Write( data )

Return value

None

argument

String data

String of Base64 data to decode

exception

None

Example of use

var fs = new FileSystem;
var fp1 = fs.Open("base64.txt", FileSystem.OPEN_READ);
var fp2 = fs.Open("output.dat", FileSystem.OPEN_WRITE);
var b64d = new Base64Decoder(fp2);
b64d.Write(fp1.Read());
b64d.Close(true);
fp1.Close();

Related item

Close method


Base64Decoder.Convert method

Explanation

Decodes Base64 data.

This method is a static method. You can call it without creating an object.

Call format

var data = Base64Decoder.Convert ( data )

Return value

Base64 decoded result

Returns a ByteArray object.

argument

String data

String to decode

Specify a character string for Base64 data.

exception

CONVERT 10

Illegal argument

Example of use

var data = new ByteArray("Biz/Browser")
var enc = Base64Encoder.Convert(data);
print(enc, "\n");
var dec = Base64Decoder.Convert(enc);
print(dec, "\n");

Related item

ByteArray class


Base64Decoder event

API version 4

Event

iOS Android Windows

There are no events defined in the Base64Decoder class.

Class scan Overview

Base class event


Base64Encoder class

Object
 | Base64Encoder

This is a class that encodes with Base64. Used when converting binary data to Base64 data.

Decoding (decoding) Base64 data is performed by the Base64Decoder class.

Base64 is a conversion method that assigns and encodes binary data to a character string containing only alphanumeric characters. It is used when sending and receiving binary data, such as by e-mail, which is premised on sending and receiving text data.

There are two methods depending on the data to be Base64 encoded.

One is to Base64 encode the input and output of the Reader / Writer object . Specify the object used for data input / output in the constructor of Base64Encoder class .

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_WRITE);
var b64e = new Base64Encoder(fp);
b64e.Write(data);
b64e.Close(true);

Another method is to base64 encode the data directly.

var data = new ByteArray("Biz/Browser");
var enc_data = Base64Encoder.Convert (data);

In this example, the binary data of the character string "Biz/Browser" is Base64 encoded and stored in the enc_data variable.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


Base64Encoder property

API version 4

Property

iOS Android Windows

The following properties are defined in the Base64Encoder class.

name | access | Type | Explanation
FileName | R | String | file name
PathName | R | String | Path name
Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


Base64Encoder.FileName property

Indicates the file name to input / output data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


Base64Encoder.PathName property

Indicates the path name for inputting / outputting data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


Base64Encoder.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


Base64Encoder method

API version 4

Method

iOS Android Windows

The following methods are defined in the Base64Encoder class.

name | Explanation
( Constructor ) | Initialize the Base64Encoder object
Close | End output or input
Read | Read from the result of Base64 encoding the data
ReadLine | Read one line from the result of Base64 encoding the data
Write | Write the result of Base64 encoding the data
WriteString | Writes the result of Base64 encoding the string

Static method

name | Explanation
Convert | Base64 encode binary data

Class overview

Base class methods


Base64Encoder constructor

Explanation

Initialize the Base64Encoder object.

Call format

var b64e = new Base64Encoder ( rw_obj [, line ])

Return value

Initialized Base64Encoder object

argument

Object rw_obj

Specify the Reader object that is the input source of the data to be encoded or the Writer object that is the output destination of the encoded Base64 data .

ByteArray can also be specified as an I/O object.

If you specify a Reader object, you cannot use the Write and WriteString methods.

If you specify a Writer object, you cannot use the Read and ReadLine methods.

integer line

Number of characters per line

It is output at 4 times the specified number. For example, if you specify 10, one line will be generated with 40 characters. If 0 is specified, it will be output without line breaks. If omitted, the default value is 18.

exception

CONVERT 1

No valid object specified

CONVERT 10

Illegal argument

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_WRITE);
var b64e = new Base64Encoder(fp);
b64e.Write("Biz/Browser");
b64e.Close(true);

var fp2 = fs.Open("base64.txt", FileSystem.OPEN_READ);
var fp3 = fs.Open("output.dat", FileSystem.OPEN_WRITE);
var b64d = new Base64Decoder(fp3);
b64d.Write(fp2.Read());
b64d.Close(true);
fp2.Close();

Related item

Read , ReadLine , Write , WriteString , Close methods


Base64Encoder.Close method

Explanation

Ends output or input.

If the output from the Write or WriteString method remains in the internal buffer, it will be passed to the Writer object when the Close method is called.

Call format

b64e.Close([ deep ])

Return value

None

argument

boolean deep

If $TRUE is specified, the Close method of the Reader / Writer object specified in the constructor will be called.

Otherwise, it closes the Base64Encoder object, but the Reader / Writer object's Close method is not executed.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_WRITE);
var b64e = new Base64Encoder(fp);
b64e.Write("Biz/Browser");
b64e.Close($TRUE);

Related item

Read , ReadLine , Write , WriteString methods


Base64Encoder.Read method

Explanation

Reads from the result of Base64 encoding the data.

Base64-encodes the data read fromthe Reader object specified in the constructor ,and returns size bytes of datafrom the result.

Call format

var data = b64e.Read([ size ])

Return value

Base64 encoded result

Returns string data. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified -1, it will be read to the end.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("input.dat", FileSystem.OPEN_READ);
var b64e = new Base64Encoder(fp);
print(b64e.Read(), "\n");
b64e.Close(true);

Related item

ReadLine , Close method


Base64Encoder.ReadLine method

Explanation

Reads one line from the result of Base64 encoding the data.

Base64-encodes the data read fromthe Reader object specified in the constructor ,and returns the character string data for one line from the result.

Call format

var data = b64e.ReadLine()

Return value

Base64 encoded result

Returns string data. It also includes a newline character at the end of the line. If there is no data to read, null is returned.

argument

None

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("input.dat", FileSystem.OPEN_READ);
var b64e = new Base64Encoder(fp);
while(true){
    var data = b64e.ReadLine();
    if(data == null){
        break;
    }
    print(data);
}
b64e.Close(true);

Related item

Read , Close methods


Base64Encoder.Write method

Explanation

Writes the result of Base64 encoding the data.

data the data specified in the Base64 encoded, constructor specified in the Writer object to write to.

The output of the Write method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

b64e.Write( data )

Return value

None

argument

data

Base64 encoded data

The content to be written differs depending on the specified data type. Similar to the Write method of the File class .

Usually you specify a String or ByteArray object.

It is possible to specify other objects such as Number and Date, but the bit pattern of the data held inside the object will be output as is, so no meaningful result will be obtained.

exception

None

Example of use

var fs = new FileSystem;
var fp1 = fs.Open("input.dat", FileSystem.OPEN_READ);
var fp2 = fs.Open("base64.txt", FileSystem.OPEN_WRITE);
var b64e = new Base64Encoder(fp2);
b64e.Write(fp1.Read());
b64e.Close(true);
fp1.Close();

Related item

WriteString , Close method


Base64Encoder.WriteString method

Explanation

Writes the result of Base64 encoding the string.

Base64-encodes the character string data specified in data andwritesit to the Writer object specified in the constructor .

The output of the WriteString method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

b64e.WriteString( data )

Return value

None

argument

String data

Base64-encoded string data

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("base64.txt", FileSystem.OPEN_WRITE);
var b64e = new Base64Encoder(fp);
b64e.WriteString("Biz/Browser");
b64e.Close(true);

Related item

Write , Close method


Base64Encoder.Convert method

Explanation

Base64 encode binary data.

This method is a static method. You can call it without creating an object.

Call format

var data = Base64Encoder.Convert ( data [, line ])

Return value

Base64 encoded result

Returns string data.

argument

ByteArray data

Base64 encoded data

Specifies a ByteArray object.

integer line

Number of characters in line

It is output at 4 times the specified number. For example, if 10 is specified, one line will be generated with 40 characters. If omitted, the default value is 18.

exception

CONVERT 10

Illegal argument

Example of use

var data = new ByteArray("Biz/Browser");
var enc = Base64Encoder.Convert(data);
print(enc, "\n");
var dec = Base64Decoder.Convert(enc);
print(dec, "\n");

Related item

ByteArray class


Base64Encoder event

API version 4

Event

iOS Android Windows

There are no events defined in the Base64Encoder class.

Class scan Overview

Base class event


NewlineConverter class

Object
 | NewlineConverter

Line feed code conversion class.

You can convert the line feed code of the specified character string at once.

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


NewlineConverter property

API version 4

Property

iOS Android Windows

The following properties are defined in the NewlineConverter class.

name | access | Type | Explanation
FileName | R | String | file name
PathName | R | String | Path name
Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


NewlineConverter.FileName property

Indicates the file name to input / output data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


NewlineConverter.PathName property

Indicates the path name for inputting / outputting data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


NewlineConverter.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


NewlineConverter method

API version 4

Method

iOS Android Windows

The following methods are defined in the NewlineConverter class.

name | Explanation
( Constructor ) | Initialize the NewlineConverter object
Close | End output or input
Read | Load the converted result
ReadLine | Read one line from the converted result
Write | Write the converted result
WriteString | Write the result of converting the string

Static method

name | Explanation
Convert | Convert the string

Class overview

Base class methods


NewlineConverter constructor

Explanation

Initializes the NewlineConverter object.

Call format

var conv = new NewlineConverter ( rw_obj , type)

Return value

Initialized NewlineConverter object

argument

Object rw_obj

Specify the Reader object that is the input source of the data to be converted or the Writer object that is the output destination of the converted data .

ByteArray can also be specified as an I/O object.

If you specify a Reader object, you cannot use the Write and WriteString methods.

If you specify a Writer object, you cannot use the Read and ReadLine methods.

integer type

Specify the following values.

Line feed code | constant | value
CRLF | NewlineConverter.CODE_CRLF | 0
LF | NewlineConverter.CODE_LF | 1
CR | NewlineConverter.CODE_CR | 2

exception

CONVERT 1

No valid object specified

CONVERT 10

Illegal argument

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FILESYSTEM.OPEN_READ);
var conv = new NewlineConverter(fp, NewlineConverter.CODE_CRLF);
var fp2 = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
fp2.Write(conv.Read());
conv.Close(true);
fp2.Close();

Related item

Read , ReadLine , Write , WriteString , Close methods


NewlineConverter.Close method

Explanation

Ends output or input.

If the output from the Write or WriteString method remains in the internal buffer, it will be passed to the Writer object when the Close method is called.

Call format

conv.Close([ deep ])

Return value

None

argument

boolean deep

If $TRUE is specified, the Close method of the Reader / Writer object specified in the constructor will be called.

Otherwise, it closes the NewlineConverter object, but the Reader / Writer object's Close method is not executed.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
var conv = new NewlineConverter(fp, NewlineConverter.CODE_CRLF);
conv.Write("Biz/Browser");
conv.Close($TRUE);

Related item

Read , ReadLine , Write , WriteString methods


NewlineConverter.Read method

Explanation

Read the converted result.

Converts the data read fromthe Reader object specified in the constructor and returns size bytes of datafrom the result.

Call format

var data = conv.Read([ size ])

Return value

Result of conversion

Returns string data. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified -1, it will be read to the end.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FILESYSTEM.OPEN_READ);
var conv = new NewlineConverter(fp, NewlineConverter.CODE_CRLF);
var fp2 = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
fp2.Write(conv.Read());
conv.Close(true);
fp2.Close();

Related item

ReadLine , Close method


NewlineConverter.ReadLine method

Explanation

Reads one line from the converted result.

Converts the data read fromthe Reader object specified in the constructor and returns the character string data for one line from the result.

Call format

var data = conv.ReadLine()

Return value

Result of conversion

Returns string data. It also includes a newline character at the end of the line. If there is no data to read, null is returned.

argument

None

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FILESYSTEM.OPEN_READ);
var conv = new NewlineConverter(fp, NewlineConverter.CODE_CRLF);
var fp2 = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
while(true) {
    var data = conv.ReadLine();
    if(data == null) {
        break;
    }
    fp2.Write(data);
}
conv.Close(true);
fp2.Close();

Related item

Read , Close methods


NewlineConverter.Write method

Explanation

Write the converted result.

Converts the data specified in data andwritesit to the Writer object specified in the constructor .

The output of the Write method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

conv.Write( data )

Return value

None

argument

String data

String to convert

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
var conv = new NewlineConverter(fp, NewlineConverter.CODE_CRLF);
conv.Write("Biz / Browser");
conv.Close(true);

Related item

WriteString , Close method


NewlineConverter.WriteString method

Explanation

Writes the result of converting the string.

Converts the character string data specified in data andwritesit to the Writer object specified in the constructor .

The output of the WriteString method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

conv.WriteString( data )

Return value

None

argument

String data

String to convert

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
var conv = new NewlineConverter(fp, NewlineConverter.CODE_CRLF);
conv.WriteString("Biz/Browser");
conv.Close(true);

Related item

Write , Close method


NewlineConverter.Convert method

Explanation

Convert the string.

This method is a static method. You can call it without creating an object.

Call format

var data = NewlineConverter.Convert ( data , type )

Return value

Result of conversion

Returns string data.

argument

String data

String to convert

integer type

Specify the following values.

Line feed code | constant | value
CRLF | NewlineConverter.CODE_CRLF | 0
LF | NewlineConverter.CODE_LF | 1
CR | NewlineConverter.CODE_CR | 2

exception

CONVERT 10

Illegal argument

Example of use

var data = NewlineConverter.Convert ("Data \ r \n", NewlineConverter.CODE_CR);

Related item


NewlineConverter event

API version 4

Event

iOS Android Windows

There are no events defined in the NewlineConverter class.

Class scan Overview

Base class event


NullConverter class

Object
 | NullConverter

No conversion class.

It is used when it is not necessary to convert, when it is used in functions that use the result of the class of Converter package.

No data is processed internally and the data is output as is.

Default property and ValueType

The default property is Value . ValueType can be specified as String, Number or Date.


NullConverter property

API version 4

Property

iOS Android Windows

The NullConverter class has the following properties defined.

API | name | access | Type | Explanation
4 | FileName | R | String | file name
4 | PathName | R | String | Path name
4 | Value | CRW | String Number Date | The value of the object

access | R | Readable
 | W | Writable
 | C | Can be initialized

: Default property

Class overview

Base class properties


NullConverter.FileName property

Indicates the file name for inputting / outputting data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


NullConverter.PathName property

Indicates the path name for inputting / outputting data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


NullConverter.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


NullConverter method

API version 4

Method

iOS Android Windows

The following methods are defined in the NullConverter class.

API | name | Explanation
4 | ( Constructor ) | Initializes a NullConverter object
4 | Close | Terminate output or input
4 | Read | Read the data
4 | ReadLine | Read one line from data
4 | Write | Write data
4 | WriteString | Writes a string

Static method

API | name | Explanation
4 | Convert | Returns the string as is

Class overview

Base class methods


NullConverter constructor

Explanation

Initializes a NullConverter object.

Call format

var conv = new NullConverter( rw_obj )

Return value

The initialized NullConverter object

argument

Object rw_obj

Specify the Reader object that is the input source of the data to be converted or the Writer object that is the output destination of the converted data .

ByteArray can also be specified as an input / output object.

If you specify a Reader object, you cannot use the Write and WriteString methods.

If you specify a Writer object, you cannot use the Read and ReadLine methods.

exception

CONVERT 1

No valid object specified

CONVERT 10

Invalid argument

Example of use

var fs = new FileSystem;
var fp = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
var conv = new NullConverter(fp);
conv.Write("Biz/Browser");
conv.Close(true);

Related item

Read , ReadLine , Write , WriteString , Close methods


NullConverter.Close method

Explanation

Terminates output or input.

If the contents output by the Write or WriteString method remain in the internal buffer, they are passed to the Writer object when the Close method is called.

Call format

conv.Close ([ deep ])

Return value

None

argument

boolean deep

If you specify $TRUE, call the Close method of the Reader / Writer object specified in the constructor .

Otherwise, it will close the NullConverter object but not execute the Reader / Writer object's Close method.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.open("out.txt", FILESYSTEM.OPEN_WRITE);
var conv = new NullConverter(fp);
conv.Write("Biz/Browser");
conv.Close($TRUE);

Related item

Read , ReadLine , Write , WriteString methods


NullConverter.Read method

Explanation

Read the data.

Returns size bytes of dataread fromthe Reader object specified in the constructor .

Call format

var data = conv.Read ([ size ])

Return value

Read data

Returns a ByteArray object. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified as -1, the data will be read to the end.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FILESYSTEM.OPEN_READ);
var conv = new NullConverter(fp);
var data = conv.Read();
conv.Close(true);
print(data,"\n");

Related item

ReadLine , Close method


NullConverter.ReadLine method

Explanation

Read one line from the data.

Returns one line of character string data from the data read fromthe Reader object specified in the constructor .

Call format

var data = conv.ReadLine ()

Return value

Read data

Returns string data. The line feed character at the end of the line is also included. If there is no data to read, null is returned.

argument

None

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FILESYSTEM.OPEN_READ);
var conv = new NullConverter(fp);
var data = conv.ReadLine();
conv.Close(true);
print(data, "\n");

Related item

Read and Close methods


NullConverter.Write method

Explanation

Write the data.

data the data specified in the constructor specified in the Writer object to write to.

The output contents of the Write method are temporarily stored in the internal buffer.

The contents remaining in the buffer are passed to the Writer object when you call the Close method, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

conv.Write( data )

Return value

None

argument

data

Data to write

The contents to be written differ depending on the specified data type. Similar to the Write method of File class .

Typically a String or ByteArray object.

It is possible to specify other objects such as Number and Date, but since the bit pattern of the data held inside the object is output as is, no meaningful result is obtained.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
var conv = new NullConverter(fp);
conv.Write("Biz/Browser");
conv.Close(true);

Related item

WriteString , Close method


NullConverter.WriteString method

Explanation

Write a string.

Writes thestring data specified in data to the Writer object specified in the constructor .

The output content of the WriteString method is temporarily stored in the internal buffer.

The contents remaining in the buffer are passed to the Writer object when you call the Close method, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

conv.WriteString ( data )

Return value

None

argument

String data

Character string data to write

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("out.txt", FILESYSTEM.OPEN_WRITE);
var conv = new NullConverter(fp);
conv.WriteString("Biz/Browser");
conv.Close(true);

Related item

Write , Close method


NullConverter.Convert method

Explanation | Returns the string as is. This method is a static method. Can be called without creating an object. This method is provided for consistency with other classes, but you do not have to use it.
Call format | var data = NullConverter.Convert( data )
Return value | Returns the value of data .
argument | String data | String data
exception | CONVERT 10 | Invalid argument
Example of use |
Related item |


NullConverter event

API version 4

Event

iOS Android Windows

There are no events defined in the NullConverter class.

Class scan Overview

Base class events


TextConverter class

Object
 | TextConverter

A class that converts character codes. You can convert a character string to a specified character code.

About character code

The character codes that can be handled by this class are as follows.

It can be converted to each other with the following character codes.

 | Character code | Remarks
(1) | UTF-8 | Standard character code
(2) | Shift_JIS |
(3) | Unicode | UTF-16LE

Default properties and ValueType

The default property is Value . ValueType can be String, Number, Date.


TextConverter property

API version 4

Property

iOS Android Windows

The following properties are defined in the TextConverter class.

name | access | Type | Explanation
FileName | R | String | file name
PathName | R | String | Path name
Value | CRW | String Number Date | Object value

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


TextConverter.FileName property

Indicates the file name to input / output data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


TextConverter.PathName property

Indicates the path name for inputting / outputting data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


TextConverter.Value property

The value of the object. Holds the value of the data type specified in ValueType .

The value of this property does not affect the behavior of the object.


TextConverter method

API version 4

Method

iOS Android Windows

The following methods are defined in the TextConverter class.

name | Explanation
( Constructor ) | Initialize the TextConverter object
Close | End output or input
Read | Read the result of character code conversion
ReadLine | Read one line from the result of character code conversion
Write | Write the result of character code conversion
WriteString | Write the result of character code conversion of the character string

Static method

name | Explanation
Convert | Convert character code

Class overview

Base class methods


TextConverter constructor

Explanation

Initializes the TextConverter object.

For the character code that can be specified , refer to About character code .

Call format

var conv = new TextConverter ( rw_obj , cset1 , cset2 )

Return value

Initialized TextConverter object

argument

Object rw_obj

Specify the Reader object that is the input source of the data to be converted or the Writer object that is the output destination of the converted data .

ByteArray can also be specified as an I/O object.

If you specify a Reader object, you cannot use the Write and WriteString methods.

If you specify a Writer object, you cannot use the Read and ReadLine methods.

String cset1

Character code of conversion source

Specify the name of the character code as a character string.

String cset2

Character code of conversion destination

Specify the name of the character code as a character string.

exception

CONVERT 1

No valid object specified

CONVERT 8

The conversion type is unknown

CONVERT 10

Illegal argument

Example of use

var str = new String("Sample 1");
var fs = new FileSystem;

var fp1 = fs.Open("eucjp.txt", FileSystem.OPEN_WRITE);
var conv1 = new TextConverter(fp1, "Shift_JIS", "EUC-JP");
conv1.Write(str);
conv1.Close(true);

var fp2 = fs.Open("eucjp.txt", FileSystem.OPEN_READ);
var conv2 = new TextConverter(fp2, "EUC-JP", "Shift_JIS");
var result2 = conv2.Read();
conv2.Close(true);
print(result2.ToString(), "\n");

Related item

Read , ReadLine , Write , WriteString , Close methods


TextConverter.Close method

Explanation

Ends output or input.

If the output from the Write or WriteString method remains in the internal buffer, it will be passed to the Writer object when the Close method is called.

Call format

conv.Close([ deep ])

Return value

None

argument

boolean deep

If $TRUE is specified, the Close method of the Reader / Writer object specified in the constructor will be called.

Otherwise, it closes the TextConverter object, but the Reader / Writer object's Close method is not executed.

exception

None

Example of use

var fs = new FileSystem;
var fp = fs.Open("utf8.txt", FileSystem.OPEN_WRITE);
var conv = new TextConverter(fp, "Unicode", "UTF-8");
conv.Write("Biz Browser");
conv.Close($TRUE);

Related item

Read , ReadLine , Write , WriteString methods


TextConverter.Read method

Explanation

Read the result of character code conversion.

Character code conversion is performed on the data read fromthe Reader object specified in the constructor ,and size bytes of data are returnedfrom the result.

Call format

var data = conv.Read([ size ])

Return value

Result of character code conversion

Returns a ByteArray object. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified -1, it will be read to the end.

exception

None

Example of use

var fs = new FileSystem;
var fp1 = fs.Open("utf8.txt", FileSystem.OPEN_WRITE);
var conv1 = new TextConverter(fp1, "Shift_JIS", "UTF-8");
conv1.Write("Biz Browser");
conv1.Close(true);

var fp2 = fs.Open("utf8.txt", FileSystem.OPEN_READ);
var conv2 = new TextConverter(fp2, "UTF-8", "Shift_JIS");
var data = conv2.Read();
conv2.Close(true);
print(data, "\n");

Related item

ReadLine , Close method


TextConverter.ReadLine method

Explanation

One line is read from the result of character code conversion.

Character code conversion is performed on the data read fromthe Reader object specified in the constructor , andthe character string data for one line is returned from the result.

Since a String object is returned as the return value of this method, valid results can be obtained only when the conversion destination character code is Shift_JIS.

Call format

var data = conv.ReadLine()

Return value

Result of character code conversion

Returns string data. It also includes a newline character at the end of the line. If there is no data to read, null is returned.

argument

None

exception

None

Example of use

var fs = new FileSystem;
var fp1 = fs.Open("utf8.txt", FileSystem.OPEN_WRITE);
var conv1 = new TextConverter(fp1, "Shift_JIS", "UTF-8");
conv1.WriteString("1st line \n");
conv1.WriteString("2nd line \n");
conv1.WriteString("3rd line \n");
conv1.Close(true);

var fp2 = fs.Open("utf8.txt", FileSystem.OPEN_READ);
var conv2 = new TextConverter(fp2, "UTF-8", "Shift_JIS");
while(true){
    var data = conv2.ReadLine();
    if(data == null){
        break;
    }
    print(data);
}
conv2.Close(true);

Related item

Read , Close methods


TextConverter.Write method

Explanation

Write the result of character code conversion.

Converts the data specified in data to the character codeand writesit to the Writer object specified in the constructor .

The output of the Write method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

conv.Write( data )

Return value

None

argument

data

Data to be converted to character code

The content to be written differs depending on the specified data type. Similar to the Write method of the File class .

Usually you specify a String or ByteArray object.

It is possible to specify other objects such as Number and Date, but the bit pattern of the data held inside the object will be output as is, so no meaningful result will be obtained.

exception

None

Example of use

var fs = new FileSystem;
var fp1 = fs.Open("utf8.txt", FileSystem.OPEN_WRITE);
var conv1 = new TextConverter(fp1, "Shift_JIS", "UTF-8");
conv1.Write("Biz Browser");
conv1.Close(true);

var fp2 = fs.Open("utf8.txt", FileSystem.OPEN_READ);
var conv2 = new TextConverter(fp2, "UTF-8", "Shift_JIS");
var data = conv2.Read();
conv2.Close(true);
print(data, "\n");

Related item

WriteString , Close method


TextConverter.WriteString method

Explanation

Writes the result of character code conversion of the character string.

data string data specified in the converted character code, the constructor was specified in the Writer object to write to.

Since a String object is passed as an argument of this method, valid results can be obtained only when the conversion source character code is Shift_JIS.

The output of the WriteString method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

conv.WriteString( data )

Return value

None

argument

String data

Character string data to be converted to character code

exception

None

Example of use

var fs = new FileSystem;
var fp1 = fs.Open("utf8.txt", FileSystem.OPEN_WRITE);
var conv1 = new TextConverter(fp1, "Shift_JIS", "UTF-8");
conv1.WriteString("1st line \n");
conv1.WriteString("2nd line \n");
conv1.WriteString("3rd line \n");
conv1.Close(true);

var fp2 = fs.Open("utf8.txt", FileSystem.OPEN_READ);
var conv2 = new TextConverter(fp2, "UTF-8", "Shift_JIS");
while(true){
    var data = conv2.ReadLine();
    if(data == null){
        break;
    }
    print(data);
}
conv2.Close(true);

Related item

Write , Close method


TextConverter.Convert method

Explanation | Convert the character code. This method is a static method. You can call it without creating an object. We do not recommend using this static method for character code conversion. Please call the constructor to create an object and use it. For the character code that can be specified , refer to About character code .
Call format | var str = TextConverter.Convert ( data , cset1 , cset2 )
Return value | Conversion result String object
argument | String data | String to convert
 | String cset1 | Character code of conversion source Specify the name of the character code as a character string.
 | String cset2 | Character code of conversion destination Specify the name of the character code as a character string.
exception | CONVERT 8 | The conversion type is unknown
 | CONVERT 10 | Illegal argument
Example of use |
Related item |

Supplement

This method specifies a String object as an argument and returns the String object as a return value.

Since the String object is handled as UTF-8, it is logically impossible to convert the character code with this method.

As an exceptional usage, set Shift_JIS binary data in the String object (garbled character string), set the conversion source to UTF-8, and set the conversion destination to UTF-8 to make the UTF-8 character string.

It is possible to get. It is also possible to obtain a String object (garbled characters as a character string) of the conversion result with UTF-8 as the conversion source and Shift_JIS as the conversion destination, and save it as it is in a file.

Mobile compatibility mode
Since the String object is a class that handles the native character code of the execution OS (Shift_JIS in the case of Japanese OS).
Set UTF-8 binary data in the String object (garbled character string), set the conversion source to UTF-8, and set the conversion destination to Shift_JIS to make the Shift_JIS character string.
It is possible to get. It is also possible to obtain a String object (garbled characters as a character string) of the conversion result with Shift_JIS as the conversion source and UTF-8 as the conversion destination, and save it as it is in a file.

However, these methods are exceptional uses for String objects and are not recommended. Normally , call the constructor to create an object and use it.


TextConverter event

API version 4

Event

iOS Android Windows

There are no events defined in the TextConverter class.

Class scan Overview

Base class event


Security package

This is a package that collects security related classes.

class

API | name | Explanation
4 | Encryptor | Do encryption
4 | Decryptor | Decrypt encrypted data
4 | Hash | Generate a hash value

About encryption algorithm

The following encryption algorithms are supported by the Security package, all block ciphers.

Blowfish algorithm

A 64-bit block cipher with a variable length key of 32 to 448 bits, devised by Bruce Schneuer. An open source algorithm widely used on the Internet.

In the normal mode (Encryptor.CALG_BLOWFISH), a Biz/Browser-specific header is added and deleted at the time of decryption.

If you do not want to add header, you can output only data without adding header by using Raw mode (Encryptor.CALG_BLOWFISH2).

In this case, due to the characteristics of Blowfish, padding is added to the data before encryption so that the size is an integral multiple of 8 bytes, so the file size before encryption is held in some form and after decryption, Remove the padding.

PKCS#5 padding mode (Encryptor.CALG_BLOWFISH3) has been added to compensate for the disadvantage that the data size after decryption is unknown in Raw mode.

PKCS#5 padding is specified in RFC1423 and is a padding method that allows the original data length to be extracted.

AES algorithm

It is one of the Federal Information Processing Standards (FIPS), a United States standard, and is a 128-bit block cipher. Key length can be 128, 196, or 256 bits.

It has the feature of specifying the initialization vector along with the encryption key. By specifying different initialization vectors for each encryption, different encryption results can be generated using the same encryption key.

Before encryption, padding is added so that the data size is an integral multiple of 16 bytes. PKCS#7 is used as the padding method.

About hash algorithm

The hash algorithms supported by the Security package are:

Android version
depends on the java.security.MessageDigest class for Android .

SHA algorithm

A standard US hash algorithm. Create a 160-bit digest.

MD5 algorithm

Creates a 128-bit digest with an algorithm devised by Rives of RSA. It has a lower probability of generating the same digest from different data than MD4, and can generate a good digest.


Encryptor class

Object
 | Encryptor

A class that encrypts data.

Use the Decryptor class to get the encrypted data back .

There are two methods depending on the data to be encrypted.

One is to encrypt the input / output of the Reader / Writer object , and specify the object to be used for data input / output in the constructor of the Encryptionor class .

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var enc = new Encryptor (fp, "password", Encryptor.CALG_BLOWFISH);
enc.WriteString("Data you want to encrypt");
enc.Close(true);

In this example, the Encryptor object enc is initialized with the File object fp as an argument, so the data encrypted with enc.WriteString is written to the file pointed to by fp. In this way, the Encryptor object behaves like a filter that performs encryption.

The other way is to encrypt the string directly.

var enc_data = Encryptor.EncryptString("encryption string", "password", Encryptor.CALG_BLOWFISH);

In this example, the "encrypted string" is encrypted and stored in the enc_data variable.

Default properties and ValueType

There are no default properties. The value type specification is invalid.


Encryptor property

API version 4

Property

iOS Android Windows

The following properties are defined in the Encryptor class.

API | name | access | Type | Explanation
4 | Algorithm | R | integer | algorithm
4 | FileName | R | String | file name
4 | PathName | R | String | Path name

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


Encryptor.Algorithm property

API version 4

Encryptor.Algorithm property Change History

iOS Android Windows

The algorithms used for encryption are indicated by numbers.

The following algorithms are currently defined.

constant | value | Explanation
Encryptor.CALG_BLOWFISH | 0 | BlowFish
Encryptor.CALG_BLOWFISH2 | 5 | BlowFish (Raw Mode)
Encryptor.CALG_BLOWFISH3 | 6 | BlowFish (PKCS # 5 padding)
Encryptor.CALG_AES128*1 | 7 | AES128(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 128 bits.
Encryptor.CALG_AES192*1 | 8 | AES192(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 192 bits.
Encryptor.CALG_AES256*1 | 9 | AES256(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 256 bits.

Change History
*1　The specification has been changed since API version 22.


Encryptor.FileName property

Indicates the file name to be encrypted and input / output data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


Encryptor.PathName property

Indicates the file name to be encrypted and input / output data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


Encryptor method

API version 4

Method

iOS Android Windows

The following methods are defined in the Encryptor class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Encryptor object
4 | Close | End output or input
4 | Read | Read the encrypted data
4 | Write | Write encrypted data
4 | WriteString | Write the encrypted data of the string

Static method

API | name | Explanation
4 | EncryptString | Encrypt the string

Class overview

Base class methods


Encryptor constructor

API version 4

Encryptor constructor Change History

iOS Android Windows

Explanation

Initialize the Encryptor object.

Call format

var enc = new Encryptor( rw_obj, pass, calg [, iv] )

or

var enc = new Encryptor( rw_obj, key, calg [, iv] )

Return value

Initialized Encryptor object

argument

Object rw_obj

Specify the Reader object that is the input source of the data to be encrypted or the Writer object that is the output destination of the encrypted data .

ByteArray can also be specified as an I / O object.

If you specify a Reader object, you cannot use the Write and WriteString methods.

If you specify a Writer object, you cannot use the Read method.

String pass

If the encryption algorithm is AES, the encryption key is created from a hash value (SHA256) created with the specified string, according to the key length specified in calg.

Otherwise, Specify a password of 4 to 56 characters.

ByteArray key

If the encryption algorithm is AES, the byte sequence is treated as the encryption key.

The length of the key depends on the algorithm.

Otherwise, it is interpreted as a string and the behavior is the same as for pass.

integer calg

Specify one encryption algorithm from the following.

constant | value | Explanation
Encryptor.CALG_BLOWFISH | 0 | BlowFish
Encryptor.CALG_BLOWFISH2 | 5 | BlowFish (Raw Mode)
Encryptor.CALG_BLOWFISH3 | 6 | BlowFish (PKCS # 5 padding)
Encryptor.CALG_AES128*1 | 7 | AES128(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 128 bits.
Encryptor.CALG_AES192*1 | 8 | AES192(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 192 bits.
Encryptor.CALG_AES256*1 | 9 | AES256(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 256 bits.

ByteArray iv

Specifies the initialization vector for AES.

Use a maximum of 16 bytes; if the length of iv is less than 16 bytes, or if it is omitted, Biz/Browser will fill in the missing portion with a fixed value to create an initialization vector.

exception

CRS-16

Invalid constructor argument

SEC-1

No valid I / O object specified

SEC-2

The encryption algorithm is unknown

SEC-3

Illegal passphrase

SEC-13

An error occurred in the security provider

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var enc = new Encryptor(fp, "passwd", Encryptor.CALG_BLOWFISH);
enc.WriteString("Data to encrypt");
enc.Close(true);

Related item

Read , Write , WriteString , Close methods

Change History
*1　The specification has been changed since API version 22.


Encryptor.Close method

Explanation

Ends output or input.

If the output from the Write or WriteString method remains in the internal buffer, it will be passed to the Writer object when the Close method is called.

Call format

enc.Close([ deep ])

Return value

None

argument

boolean deep

If $TRUE is specified, the Close method of the Reader / Writer object specified in the constructor will be called.

Otherwise, it closes the Encryptionor object, but the Reader / Writer object's Close method is not executed.

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

SEC-8

Missing Write method

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var enc = new Encryptor(fp, "passwd", Encryptor.CALG_BLOWFISH);
enc.WriteString("Data to encrypt");
enc.Close($TRUE);

Related item

Read , Write , WriteString methods


Encryptor.Read method

Explanation

Read the encrypted data.

Encrypts the data read fromthe Reader object specified in the constructor and returns size bytes of datafrom the result.

Call format

var data = enc.Read([ size ])

Return value

Encrypted data

Returns a ByteArray object. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified -1, it will be read to the end.

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

SEC-9

Missing Read method

SEC-10

The load operation could not be completed

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var enc = new Encryptor(fp, "passwd", Encryptor.CALG_BLOWFISH);
var d = enc.Read();
enc.Close(true);

Related item

Close method

ByteArray class


Encryptor.Write method

Explanation

Writes the encrypted data.

Encrypts the data specified in data andwritesit to the Writer object specified in the constructor .

The output of the Write method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

enc.Write( data )

Return value

None

argument

data

Data to be encrypted

The content to be written differs depending on the specified data type. Similar to the Write method of the File class .

Usually you specify a String or ByteArray object.

It is possible to specify other objects such as Number and Date, but the bit pattern of the data held inside the object will be output as is, so no meaningful result will be obtained.

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-5

The type of output data is unknown

SEC-7

The operation sequence is invalid

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var enc = new Encryptor(fp, "passwd", Encryptor.CALG_BLOWFISH);
enc.Write("Data to encrypt");
enc.Close(true);

Related item

WriteString , Close method


Encryptor.WriteString method

Explanation

Writes the encrypted data of the character string.

The character string data specified in data is encrypted and writtento the Writer object specified in the constructor .

The output of the WriteString method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

enc.WriteString( data )

Return value

None

argument

String data

String data to be encrypted

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var enc = new Encryptor(fp, "passwd", Encryptor.CALG_BLOWFISH);
enc.WriteString("Data to encrypt");
enc.Close(true);

Related item

Write , Close method


Encryptor.EncryptString method

API version 4

Encryptor.EncryptString method Change History

iOS Android Windows

Explanation

Encrypt the string.

This method is a static method. You can call it without creating an object.

The encrypted result is returned as a Base64 format string. It can be decrypted with the Decryptor.DecryptString method.

Call format

var enc = Encryptor.EncryptString( data, pass, calg [, iv] )

or

var enc = Encryptor.EncryptString( data, key, calg [, iv] )

Return value

Returns the encrypted data as a Base64 format string.

argument

String data

String to encrypt

String pass

If the encryption algorithm is AES, the encryption key is created from a hash value (SHA256) created with the specified string, according to the key length specified in calg.

Otherwise, Specify a password of 4 to 56 characters.

ByteArray key

If the encryption algorithm is AES, the byte sequence is treated as the encryption key.

The length of the key depends on the algorithm.

Otherwise, it is interpreted as a string and the behavior is the same as for pass.

integer calg

Specify one encryption algorithm from the following.

constant | value | Explanation
Encryptor.CALG_BLOWFISH | 0 | BlowFish
Encryptor.CALG_BLOWFISH2 | 5 | BlowFish (Raw Mode)
Encryptor.CALG_BLOWFISH3 | 6 | BlowFish (PKCS#5 padding)
Encryptor.CALG_AES128*1 | 7 | AES128(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 128 bits.
Encryptor.CALG_AES192*1 | 8 | AES192(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 192 bits.
Encryptor.CALG_AES256*1 | 9 | AES256(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 256 bits.

ByteArray iv

Specifies the initialization vector for AES.

Use a maximum of 16 bytes; if the length of iv is less than 16 bytes, or if it is omitted, Biz/Browser will fill in the missing portion with a fixed value to create an initialization vector.

exception

CRS-34

Out of memory

SEC-2

The encryption algorithm is unknown

SEC-3

Illegal passphrase

SEC-13

An error occurred in the security provider

Example of use

var enc = Encryptor.EncryptString("Data to encrypt", "pass", Encryptor.CALG_BLOWFISH);

Related item

Change History
*1　The specification has been changed since API version 22.


Encryptor event

API version 4

Event

iOS Android Windows

There are no events defined in the Encryptor class.

Class overview

Base class event


Decryptor class

Object
 | Decryptor

A class that decrypts encrypted data.

Use the Encryptor class to encrypt the data .

There are two methods depending on the encrypted data.

One is to encrypt the input / output of the Reader / Writer object , and specify the object to be used for data input / output in the constructor of the Decryptor class .

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var dec = new Decryptor (fp, "password", Decryptor.CALG_BLOWFISH);
var data = dec.Read();
dec.Close(true);

In this example, since the Decryptor object dec is initialized with the File object fp as an argument, the data encrypted by dec.Read is read from the file pointed to by fp, decrypted, and then returned as the return value. In this way, the Decryptor object behaves like a filter that decrypts.

The other way is to decrypt the string directly.

var dec_data = Decryptor.DecryptString("encrypted string", "password", Encryptor.CALG_BLOWFISH);

In this example, the "encrypted string" is decrypted and stored in the dec_data variable.

Default properties and ValueType

There are no default properties. The value type specification is invalid.


Decryptor property

API version 4

Property

iOS Android Windows

The following properties are defined in the Decryptor class.

API | name | access | Type | Explanation
4 | Algorithm | R | integer | algorithm
4 | FileName | R | String | file name
4 | PathName | R | String | Path name

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


Decryptor.Algorithm property

API version 4

Decryptor.Algorithm property Change History

iOS Android Windows

The algorithms used for encryption are indicated by numbers.

The following algorithms are currently defined.

constant | value | Explanation
Decryptor.CALG_BLOWFISH | 0 | BlowFish
Decryptor.CALG_BLOWFISH2 | 5 | BlowFish (Raw Mode)
Decryptor.CALG_BLOWFISH3 | 6 | BlowFish (PKCS#5 padding)
Decryptor.CALG_AES128*1 | 7 | AES128(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 128 bits.
Decryptor.CALG_AES192*1 | 8 | AES192(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 192 bits.
Decryptor.CALG_AES256*1 | 9 | AES256(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 256 bits.

Change History
*1　The specification has been changed since API version 22.


Decryptor.FileName property

Indicates the file name to be encrypted and input / output data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


Decryptor.PathName property

Indicates the file name to be encrypted and input / output data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


Decryptor method

API version 4

Method

iOS Android Windows

The following methods are defined in the Decryptor class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Decryptor object
4 | Close | Terminate output or input
4 | Read | Read the decrypted data
4 | ReadLine | Read one line from the decrypted data
4 | Write | Write decrypted data

Static method

API | name | Explanation
4 | DecryptString | Decrypts encrypted data

Class overview

Base class methods


Decryptor constructor

API version 4

Decryptor constructor Change History

iOS Android Windows

Explanation

Initialize the Decryptor object.

Call format

var dec = new Decryptor( rw_obj, pass, calg [, iv] )

or

var dec = new Decryptor( rw_obj, key, calg [, iv] )

Return value

Initialized Decryptor object

argument

Object rw_obj

Specify the Reader object that is the input source of the data to be decrypted or the Writer object that is the output destination of the decrypted data .

ByteArray can also be specified as an I / O object.

If you specify a Reader object, you cannot use the Write method.

If you specify a Writer object, you cannot use the Read and ReadLine methods.

String pass

If the encryption algorithm is AES, the encryption key is created from a hash value (SHA256) created with the specified string, according to the key length specified in calg.

Otherwise, Specify a password of 4 to 56 characters.

ByteArray key

If the encryption algorithm is AES, the byte sequence is treated as the encryption key.

The length of the key depends on the algorithm.

Otherwise, it is interpreted as a string and the behavior is the same as for pass.

integer calg

Specify one encryption algorithm from the following.

constant | value | Explanation
Decryptor.CALG_BLOWFISH | 0 | BlowFish
Decryptor.CALG_BLOWFISH2 | 5 | BlowFish (Raw Mode)
Decryptor.CALG_BLOWFISH3 | 6 | BlowFish (PKCS#5 padding)
Decryptor.CALG_AES128*1 | 7 | AES128(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 128 bits.
Decryptor.CALG_AES192*1 | 8 | AES192(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 192 bits.
Decryptor.CALG_AES256*1 | 9 | AES256(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 256 bits.

ByteArray iv

Specifies the initialization vector for AES.

Use a maximum of 16 bytes; if the length of iv is less than 16 bytes, or if it is omitted, Biz/Browser will fill in the missing portion with a fixed value to create an initialization vector.

exception

CRS-16

Invalid constructor argument

SEC-1

No valid I / O object specified

SEC-2

The encryption algorithm is unknown

SEC-3

Illegal passphrase

SEC-13

An error occurred in the security provider

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var dec = new Decryptor(fp, "passwd", Decryptor.CALG_BLOWFISH);
var data = dec.Read();
dec.Close(true);

Related item

Read , ReadLine , Write , Close methods

Change History
*1　The specification has been changed since API version 22.


Decryptor.Close method

Explanation

Terminates output or input.

If the output from the Write method remains in the internal buffer, it will be passed to the Writer object when the Close method is called.

Call format

dec.Close([ deep ])

Return value

None

argument

boolean deep

If $TRUE is specified, the Close method of the Reader / Writer object specified in the constructor will be called.

Otherwise, it closes the Decryptor object, but the Reader / Writer object's Close method is not executed.

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var dec = new Decryptor(fp, "passwd", Decryptor.CALG_BLOWFISH);
var data = dec.Read();
dec.Close($TRUE);

Related item

Read , ReadLine , Write methods


Decryptor.Read method

Explanation

Read the decrypted data.

Decodes the data read fromthe Reader object specified in the constructor and returns size bytes of datafrom the result.

Call format

var data = dec.Read([ size ])

Return value

Decrypted data

Returns a ByteArray object. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified -1, it will be read to the end.

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

SEC-9

Missing Read method

SEC-10

The load operation could not be completed

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var dec = new Decryptor(fp, "passwd", Decryptor.CALG_BLOWFISH);
var d = dec.Read();
dec.Close(true);

Related item

Close method

ByteArray class


Decryptor.ReadLine method

Explanation

Reads one line from the decrypted data.

Decodes the data read fromthe Reader object specified in the constructor and returns the character string data for one line from the result.

Call format

var data = dec.ReadLine()

Return value

Decrypted result

Returns string data. It also includes a newline character at the end of the line. If there is no data to read, null is returned.

argument

None

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

SEC-9

Missing Read method

SEC-10

The load operation could not be completed

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var dec = new Decryptor(fp, "passwd", Decryptor.CALG_BLOWFISH);
var d = dec.ReadLine();
dec.Close(true);

Related item

Read , Close methods


Decryptor.Write method

Explanation

Write the decrypted data.

data to decrypt the specified data, the constructor was specified in the Writer object to write to.

The output of the Write method is temporarily saved in an internal buffer.

The contents remaining in the buffer are passed to the Writer object when the Close method is called, so be sure to call the Close method.

If you do not execute the Close method, some or all of the output will be lost.

Call format

dec.Write( data )

Return value

None

argument

ByteArray data

Data to decrypt

Specifies a ByteArray object of data encrypted with the Encryptor class .

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-5

The type of output data is unknown

SEC-7

The operation sequence is invalid

Example of use

var fs = new FileSystem;
var fp1 = fs.Open("encrypted.txt", FileSystem.OPEN_READ);
var fp2 = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var dec = new Decryptor(fp2, "password", Decryptor.CALG_BLOWFISH);
dec.Write(fp1.read());
dec.Close(true);
fp1.Close();

Related item

Close method

ByteArray , Encryptor class


Decryptor.DecryptString method

API version 4

Decryptor.DecryptString method Change History

iOS Android Windows

Explanation

Decrypts the encrypted data.

This method is a static method. You can call it without creating an object.

Decrypts the result (Base64 format character string) encrypted with the Encryptor.EncryptString method.

For pass and calg , specify the same ones as when encrypted with the EncryptString method.

Call format

var data = Decryptor.DecryptString( data, pass, calg [, iv] )

or

var data = Decryptor.DecryptString( data, key, calg [, iv] )

Return value

Returns the decrypted string.

argument

String data

Data to be decrypted (Base64 format character string)

String pass

If the encryption algorithm is AES, the encryption key is created from a hash value (SHA256) created with the specified string, according to the key length specified in calg.

Otherwise, Specify a password of 4 to 56 characters.

ByteArray key

If the encryption algorithm is AES, the byte sequence is treated as the encryption key.

The length of the key depends on the algorithm.

Otherwise, it is interpreted as a string and the behavior is the same as for pass.

integer calg

Specify one encryption algorithm from the following.

constant | value | Explanation
Decryptor.CALG_BLOWFISH | 0 | BlowFish
Decryptor.CALG_BLOWFISH2 | 5 | BlowFish (Raw Mode)
Decryptor.CALG_BLOWFISH3 | 6 | BlowFish (PKCS#5 padding)
Decryptor.CALG_AES128*1 | 7 | AES128(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 128 bits.
Decryptor.CALG_AES192*1 | 8 | AES192(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 192 bits.
Decryptor.CALG_AES256*1 | 9 | AES256(PKCS#7 padding) If the encryption key is specified as a ByteArray, the length of the key must be 256 bits.

ByteArray iv

Specifies the initialization vector for AES.

Use a maximum of 16 bytes; if the length of iv is less than 16 bytes, or if it is omitted, Biz/Browser will fill in the missing portion with a fixed value to create an initialization vector.

exception

CRS-34

Out of memory

SEC-2

The encryption algorithm is unknown

SEC-3

Illegal passphrase

SEC-11

The decryption operation could not be completed

SEC-13

An error occurred in the security provider

Example of use

var dec = Decryptor.DecryptString("Data to decrypt", "pass", Decryptor.CALG_BLOWFISH);

Related item

Change History
*1　The specification has been changed since API version 22.


Decryptor event

API version 4

Event

iOS Android Windows

There are no events defined in the Decryptor class.

Class overview

Base class event


Hash class

Object
 | Hash

A class that generates a hash value.

A hash value is a fixed-length value calculated by a hash algorithm from data such as documents and numbers, and can be used as a summary of the original data. Since the hash value is just a list of numbers, it is impossible to estimate the original data from the hash value.

Using this feature, if you calculate and save the hash value of a certain document and compare the hash value calculated from the same document with the saved hash value at a later date, the original document has been tampered with in the meantime. You can be sure that it is not. The same thing can be done by saving the entire original document in another location and comparing it, but the hash value is short fixed length data regardless of the size of the document, so it is easy to save and compare. Will be.

Hashes are also used for digital signatures, and the hash value (message digest) of the data to be signed is calculated and encrypted by the public key cryptographic algorithm. If the hash value decrypted with the public key and the hash value recalculated from the original data match, it is guaranteed that the data was created by the owner of the public key and has not been tampered with.

There are two methods depending on the data for which the hash value is calculated.

One is to calculate from the input / output data of Reader / Writer object , and specify the object to be used for input / output of data in the constructor of Hash class .

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.xml", FileSystem.OPEN_READ);
var md = new Hash(fp, Hash.HALG_MD5);
var ximp = new xmlDOMImplementation();
var xdoc = ximp.Load(md);
md.close(true);
MessageBox(md.GetHashData(), "Hash");

In this example, the Hash object md is initialized with the File object fp as an argument. Next, the XML is loaded by the Load method of XmlDOMImplementation , but since it goes through the Hash object, the hash value of the file data.xml pointed to by fp is also calculated at the same time.

In this way, the Hash object behaves like a filter that calculates the hash value.

The other method is to calculate the Hash value directly from the string using the static method HashString of the Hash class .

var hash_value = Hash.HashString("string to calculate the hash value", Hash.HALG_MD5);

In this example, the hash value of the "character string for calculating the hash value" is stored in the hash_value variable.

Default properties and ValueType

There are no default properties. The value type specification is invalid.


Hash property

API version 4

Property

iOS Android Windows

The following properties are defined in the Hash class.

API | name | access | Type | Explanation
4 | Algorithm | R | integer | algorithm
4 | FileName | R | String | file name
4 | PathName | R | String | Path name

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


Hash.Algorithm property

API version 4

Hash.Algorithm propertychange history

iOS Android Windows

The hash algorithm is indicated by a number.

The following algorithms are currently defined.

constant | value | Explanation
Hash.HALG_SHA1 | 0 | SHA1 algorithm
Hash.HALG_MD5 | 2 | MD5 algorithm
Hash.HALG_SHA_256 | 3 | SHA-256 algorithm *1
Hash.HALG_SHA_512 | 4 | SHA-512 algorithm *1
Hash.HALG_HMAC_SHA_256 | 5 | HMAC-SHA-256 algorithm *1
Hash.HALG_HMAC_SHA_512 | 6 | HMAC-SHA-512 algorithm *1
change history
*1　This was added in API version 15.


Hash.FileName property

Indicates the file name to input / output data.

This property is a copy of the FileName property of the Reader / Writer object specified in the constructor . If the FileName property does not exist, it will be an empty string.


Hash.PathName property

Indicates the file name to input / output data.

This property is a copy of the PathName property of the Reader / Writer object specified in the constructor . If the PathName property does not exist, it will be an empty string.


Hash method

API version 4

Method

iOS Android Windows

The following methods are defined in the Hash class.

API | name | Explanation
4 | ( Constructor ) | Initialize the Hash object
4 | Close | Terminate output or input
4 | GetHashData | Get the calculated hash value
4 | Read | Read the data
4 | ReadLine | Read one line from the data
4 | Write | Write data
4 | WriteString | Write a string

Static method

API | name | Explanation
4 | HashString | Calculate the hash value from the string

Class overview

Base class methods


Hash constructor

API version 4

Hash constructorchange history

iOS Android Windows

Explanation

Initialize the Hash object.

Call format

var hs = new Hash( rw_obj, halg, [ key ] )

Return value

Initialized Hash object

argument

Object rw_obj

Specify the Reader object that is the input source of the data or the Writer object that is the output destination of the data .

ByteArray can also be specified as an I / O object.

If you specify a Reader object, the hash value of the data read by the Read and ReadLine methods is calculated.

If you specify a Writer object, the hash value of the data written by the Write and WriteString methods is calculated.

In either case, be sure to call the Close method to complete the I / O operation and then use the GetHashData method to get the hash value.

If you specify a Reader object, you cannot use the Write and WriteString methods.

If you specify a Writer object, you cannot use the Read and ReadLine methods.

integer halg

Specify one hash algorithm from the following.

constant | value | Explanation
Hash.HALG_SHA1 | 0 | SHA1 algorithm
Hash.HALG_MD5 | 2 | MD5 algorithm
Hash.HALG_SHA_256 | 3 | SHA-256 Algorithm *1
Hash.HALG_SHA_512 | 4 | SHA-512 Algorithm *1
Hash.HALG_HMAC_SHA_256 | 5 | HMAC-SHA-256 Algorithm *1
Hash.HALG_HMAC_SHA_512 | 6 | HMAC-SHA-512 Algorithm *1

String key

Specifies the encryption key for HMAC. *1

In the case of an empty string with the HMAC hash function specified in halg, an SEC-3 exception will be raised.

The default is null.

exception

CRS-16

Invalid constructor argument

SEC-1

No valid I / O object specified

SEC-3

Invalid passphrase.

SEC-12

The hash algorithm is unknown

SEC-13

An error occurred in the security provider

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var hs = new Hash(fp, Hash.HALG_MD5);
var data = hs.Read();
hs.Close(true);
MessageBox(hs.GetHashData(), "hash value of data.txt");

Related item

Read , ReadLine , Write , WriteString , Close , GetHashData methods
change history
*1　This was added in API version 15.


Hash.Close method

Explanation

Terminates output or input.

Whenever you get a hash value from a Hash object, you need to call the Close method. Calling the GetHashData method without calling the Close method raises a SEC-7 exception.

Call format

hs.Close([ deep ])

Return value

None

argument

boolean deep

If $TRUE is specified, the Close method of the Reader / Writer object specified in the constructor will be called.

Otherwise, it closes the Hash object, but the Reader / Writer object's Close method is not executed.

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

SEC-13

An error occurred in the security provider

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var hs = new Hash(fp, Hash.HALG_MD5);
var data = hs.Read();
hs.Close($TRUE);
var h = hs.GetHashData();

Related item

Read , ReadLine , Write , WriteString , GetHashData methods


Hash.GetHashData method

Explanation

Gets the calculated hash value.

The hash value is calculated for the data input / output by calling the Read , ReadLine , Write , and WriteString methods, and is recorded in the internal buffer.

Call the Close method to determine the hash value before calling the GetHashData method. Calling the GetHashData method without calling the Close method raises a SEC-7 exception.

Call format

var h = hs.GetHashData()

Return value

Returns the hash value as a Base64 format string.

argument

None

exception

SEC-7

The operation sequence is invalid

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var hs = new Hash(fp, Hash.HALG_MD5);
var d = hs.WriteString("Data for calculating hash value");
hs.Close(true);
var h = hs.GetHashData();

Related item

Read , ReadLine , Write , WriteString , Close methods


Hash.Read method

Explanation

Read the data.

Reads data fromthe Reader object specified in the constructor . The hash value is calculated internally for the read data.

Even if all the data of the Reader object is not read, the hash value is calculated including the rest of the data of the Reader object.

Call format

var data = hs.Read([ size ])

Return value

Read data

Returns a ByteArray object. If there is no data to read, null is returned.

argument

integer size

Maximum number of bytes to read

If omitted or specified -1, it will be read to the end.

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

SEC-9

Missing Read method

SEC-10

The load operation could not be completed

SEC-13

An error occurred in the security provider

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var hs = new Hash(fp, Hash.HALG_MD5);
var d = hs.Read();
hs.Close(true);
var h = hs.GetHashData();

Related item

ReadLine , Close method

ByteArray class


Hash.ReadLine method

Explanation

Read one line from the data.

Reads one line of data fromthe Reader object specified in the constructor . The hash value of the read data is calculated internally.

Even if all the data of the Reader object is not read, the hash value is calculated including the rest of the data of the Reader object.

Call format

var data = hs.ReadLine()

Return value

Read data

Returns string data. It also includes a newline character at the end of the line. If there is no data to read, null is returned.

argument

None

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

SEC-9

Missing Read method

SEC-10

The load operation could not be completed

SEC-13

An error occurred in the security provider

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_READ);
var hs = new Hash(fp, Hash.HALG_MD5);
var d = hs.ReadLine();
hs.Close(true);
var h = hs.GetHashData();

Related item

Read , Close methods


Hash.Write method

Explanation

Write the data.

data the data specified in the constructor specified in the Writer object to write to. The hash value of the written data is calculated internally.

Call format

hs.Write( data )

Return value

None

argument

data

Data to write

The content to be written differs depending on the specified data type. Similar to the Write method of the File class .

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-5

The type of output data is unknown

SEC-7

The operation sequence is invalid

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var hs = new Hash(fp, Hash.HALG_MD5);
/* When writing character string data */
var data = "sample";
hs.Write(data);
hs.Close(true);
var h = hs.GetHashData();

Related item

WriteString , Close method


Hash.WriteString method

Explanation

Write a string.

Writesthe character string data specified in data to the Writer object specified in the constructor . The hash value of the written data is calculated internally.

Call format

hs.WriteString( data )

Return value

None

argument

String data

Character string data to write

exception

CRS-34

Out of memory

SEC-1

No valid I / O object specified

SEC-7

The operation sequence is invalid

Example of use

var fs = new FileSystem;
var fp = fs.Open("data.txt", FileSystem.OPEN_WRITE);
var hs = new Hash(fp, Hash.HALG_MD5);
hs.WriteString("Data for calculating hash value");
hs.Close(true);
var h = hs.GetHashData();

Related item

Write , Close method


Hash.HashString method

Explanation

Calculate the hash value from the string.

This method is a static method. You can call it without creating an object.

Call format

var h = Hash.HashString( data , halg )

Return value

Returns the calculated hash value as a Base64 format string.

argument

String data

A string to calculate the hash value

integer halg

Specify one hash algorithm from the following.

constant | value | Explanation
HASH.HALG_SHA1 | 0 | SHA1 algorithm
HASH.HALG_MD5 | 2 | MD5 algorithm

exception

CRS-34

Out of memory

SEC-12

The hash algorithm is unknown

SEC-13

An error occurred in the security provider

Example of use

var h = Hash.HashString("data", HASH.HALG_MD5);

Related item


Hash event

API version 4

Event

iOS Android Windows

There are no events defined in the Hash class.

Class overview

Base class event


JSON package

It is a package for handling JSON (JavaScript Object Notation) format data.

class

API | name | Explanation
5 | JSONDocument | Parses and outputs JSON data


JSONDocument class

Object
 | JSONDocument

A class that parses and outputs JSON data.

The JSON data loaded by the Get , Load , or Parse method is expanded to an Array object, and the first Array object is set to Value.

In addition, the Save method converts the Array object set in Value to JSON data.

JSON-Array conversion rule

Arrays enclosed in [] are expanded as arrays starting from the 0th Array object, and objects enclosed in {} are expanded as associative arrays of Array objects with names as keys.

Objects and arrays as values take the form of Array objects stored in the elements of Array objects.

Example)

JSON data

[
    {"name": "Yamada Taro"},
      "character string",
      3.14
]

Expand to Array

Usage example to retrieve "Yamada Taro" of "name"

var j = new JSONDocument();
j << json <<-
[
    {"name": "Yamada Taro"},
      "character string",
      3.14
]
->>;

var name = j.value[0]["name"];

Default properties and ValueType

The default property is Value . ValueType can be specified as String, Number, Fixed or Date.


JSONDocument property

API version 5

Property

iOS Android Windows

The following properties are defined in the JSONDocument class.

API | name | access | Type | Explanation
5 | Value | CRW | Array | Array object as a result of parsing JSON data Or Array object you want to output as JSON

access | R | Readable
 | W | Writable
 | C | Initializable

: Default property

Class overview

Base class properties


JSONDocument.Value property

As a result of parsing JSON, Array object is assigned.

Also, assign the Array object you want to save.


JSONDocument method

API version 5

Method

iOS Android Windows

The following methods are defined in the JSONDocument class.

API | name | Overview
5 | Get | Read JSON from URL
5 | Load | Read JSON from Reader object
5 | Parse | Read JSON from a string
5 | Save | Save the JSON in a Writer object
19 | ToString | Get JSON data as a string

Class overview

Base class methods


JSONDocument.Get method

Explanation

Reads JSON data from the specified URL.

The Value value before executing the Get method is lost.

The JSON data to be acquired is not cached. Always get from the server.

If you do not specify param , the request will be sent via HTTP GET.

If you specify param , the request will be sent via HTTP POST.

If the web server does not return 200 ($HTTP_OK) for the HTTP status code, a CRS-331 exception will occur.

When the internal character code is Unicode, the character code of the input JSON file is UTF-8.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

jsondoc.Get( URL [, param [, param2 ,…]])

Return value

None

argument

String URL

URL to read JSON data

Same as the URL of the NetObject.Get method .

Object param

Parameters to be added to the request

Same as param of NetObject.Get method .

exception

JSON-1

Nth character analysis failed

CRS-331

Communication error

Same as the exception to the NetObject.Get method.

Example of use

var jsondoc = new JSONDocument;
jsondoc.Get("/test/sample.cgi", "KEY=126", "MODE=A");

Related item

Load , Parse , NetObject.Get methods


JSONDocument.Load method

Explanation

Read JSON data from the Reader object.

The Value value before executing the Load method is lost.

When the internal character code is Unicode, the character code of the input JSON file is UTF-8.

Call format

jsondoc.Load( reader )

Return value

None

argument

Object reader

Reader object of read source (object that can use Read method)

exception

JSON-1

Nth character analysis failed

JSON-2

No valid Read object specified

JSON-3

Does not support Read() method

Example of use

var jsondoc = new JSONDocument;
var res = session.Get("/test/sample.json");
jsondoc.Load(res);

Related item

Save , Get , Parse methods


JSONDocument.Parse method

Explanation

Read JSON data from a string.

The Value value before executing the Parse method is lost.

The Parse method has the same loading function as the Load method, but you can specify a String object as an argument.

Call format

jsondoc.Parse( str )

Return value

None

argument

String str

JSON string

exception

JSON-1

Nth character analysis failed

Example of use

var jsondoc = new JSONDocument;
var str = "[{\"aaa\":\"bbb\"},\"ccc\"]";
jsondoc.Parse(str);

Related item

Save , Get , Load methods


JSONDocument.Save method

Explanation

Outputs the Array object set to Value in the Writer object as JSON data.

If the Array object is not set in the Value value, "[]" is output.

Since CRS does not have a Boolean value internally, true and false are 1 and 0 when saved.

If the internal character code is Unicode, the character code of the saved JSON file will be UTF-8.

Call format

jsondoc.Save ( writer )

Return value

None

argument

Object writer

Writer object to save to

exception

JSON-4

No valid Write object specified

JSON-5

Does not support the Write() method

Example of use

var jsondoc = new JSONDocument;
var res = session.Get("http://server/sample.json");
jsondoc.Load(res);
var fs = new FileSystem;
var fp = fs.Open("sample.json", FileSystem.OPEN_WRITE);
jsondoc.Save(fp);
fp.Close();

Related item

Load method


JSONDocument.ToString method

iOSAndroidWindows

Explanation

Get the JSON data as a string.

Call format

jsondoc.ToString()

Return value

A string representing JSON data

argument

None

exception

None

Example of use

var jsondoc = new JSONDocument;
var res = session.Get("http://server/sample.json");
jsondoc.Load(res);
print(jsondoc.ToString());

関連項目

Save method


JSONDocument event

API version 5

Event

iOS Android Windows

There are no events defined in the JSONDocument class.

Class overview

Base class event


JSONDocument operator

API version 5

operator

iOS Android Windows

The following operators are defined in the JSONDocument class.

API | operator | Explanation
5 | JSONDocument << JSON constant | Load a JSON constant into a JSONDocument

Class overview


JSONDocument << JSON constant operator

This operator loads the JSON constants on the right side of the JSONDocument object on the left side .

Example of use

var j = new JSONDocument();
j << json <<-
{
    "data": [
        {
            "title": "Record 1",
            "item1": "Item 1",
            "item2": "Item 1",
            "item3": "Item 1"
        }
    ]
}
->>;


JSON constant

The JSON package defines JSON constants. JSON constants can be used by the << operator to populate the JSONDocument object.

CRS syntax, constants (such as $RED), operators (such as + and-), functions, etc. cannot be used inside JSON constant blocks because they are not grammatically related to CRS scripts. Must follow the format as JSON.

You can write JSON data directly in the CRS script in the following format.

json <<-
(JSON data)
->>;

Example of use

var j = new JSONDocument();
j << json <<-
{
    "data": [
        {
            "title":"Record 1",
            "item1":"item 1",
            "item2":"Item 1",
            "item3":"Item 1"
        }
    ]
}
->>;


Speech package

It is a package for handling voice control functions.

class

API | name | explanation
17 | SpeechSynthesizer | This class synthesizes speech from input text.
17 | Utterance | This is the class for speech settings.
17 | Voice | Class for audio information.


SpeechSynthesizer class

iOSAndroidWindows

Object
 | SpeechSynthesizer

This class outputs the input text as audio.

The text input by the StartSpeaking method is internally stored in a queue and output in the order in which it was input.

The output voice can be switched between languages and genders. The voices that can be used by the text-to-speech engine are obtained by the GetAvailableVoices method.

In addition, you can specify the speed of reading, the height of the voice, and register the reading method of words with the AddWordToDictionary method.

Depending on the OS version and the speech analysis engine specified in the SetEngine method, the reading result may differ.

Android version
Depending on the device, you may need to download the voice analysis engine and voice data in advance.

Notes on Text-To-Speech

In order to read out text as intended, some ingenuity may be required when implementing CRS scripts.

Consecutive numbers

Consecutive numbers will be read out as a single number.

var synthesizer = new SpeechSynthesizer;
synthesizer.Load();
synthesizer.StartSpeaking("12345");

If you want to read out the numbers one by one, you need to call the StartSpeaking method one character at a time.

synthesizer.StartSpeaking("1");
synthesizer.StartSpeaking("2");
synthesizer.StartSpeaking("3");
synthesizer.StartSpeaking("4");
synthesizer.StartSpeaking("5");

Default properties and ValueType

The default property is Value.


SpeechSynthesizer Property

API version 17

Property

iOSAndroidWindows

The following properties are defined in the SpeechSynthesizer class.

API | name | access | type | Initial value | explanation
17 | IsSpeaking | R | boolean |  | Whether it is in speech or not
17 | Pitch | CRW | Number | 1.0 | Voice height
17 | PostUtteranceDelay | CRW | Number | 0.0 | Wait time after reading out the text
17 | Rate | CRW | Number | 1.0 | Reading speed
17 | Value | CRW | String Number Fixed Date |  | The value of the object
17 | Volume | CRW | Number | 1.0 | Reading volume

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


SpeechSynthesizer.IsSpeaking property

iOSAndroidWindows

It is $TRUE if it is speaking, and $FALSE if it is not.

This property is read-only and cannot be changed.


SpeechSynthesizer.Pitch property

iOSAndroidWindows

Specifies the pitch of the sound as a value greater than 0. The default value is 1.0.

A value greater than 1.0 makes the sound higher.

A value smaller than 1.0 makes the sound lower.

The value is internally trimmed to the range that can be set by the OS.


SpeechSynthesizer.PostUtteranceDelay property

iOSAndroidWindows

Specifies the amount of time, in seconds, between the reading of the text specified by the StartSpeaking method and the reading of the next text.

Default is 0.0 seconds.


SpeechSynthesizer.Rate property

iOSAndroidWindows

Specifies the speed of reading, as a value greater than 0. The default value is 1.0.

A value greater than 1.0 increases the reading speed.

A value smaller than 1.0 will decrease the reading speed.

The value is internally trimmed to the range that can be set by the OS.


SpeechSynthesizer.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


SpeechSynthesizer.Volume property

iOSAndroidWindows

Specifies the reading volume between 0.0 and 1.0. The default is 1.0.

The higher the value, the louder the volume.

It will be internally trimmed to the range configurable by the OS.


SpeechSynthesizer method

API version 17

Method

iOSAndroidWindows

The following methods are defined in the SpeechSynthesizer class.

API | name | explanation
17 | AddWordToDictionary | Register word readings
17 | AddWordToDictionaryWithCSV | Register word pronunciations in CSV format.
17 | GetAvailableEngines | Get a list of available text-to-speech engine names
17 | GetAvailableVoices | Get a list of available speech information.
17 | GetCurrentEngine | Retrieves the name of the currently set text-to-speech engine.
17 | GetCurrentVoice | Retrieves the currently set voice information.
17 | IsLanguageAvailable | Detects whether the specified language is available or not.
17 | Load | Loads the text-to-speech function.
17 | RemoveWordFromDictionary | Deletes the registered word readings.
17 | SetEngine | Sets the speech analysis engine to be used
17 | SetVoice | Sets the voice to be used
17 | StartSpeaking | Specify the text to be read and start speaking
17 | StopSpeaking | Stop speech
17 | Unload | Unload the text-to-speech function

Class overview

Base class method


SpeechSynthesizer.AddWordToDictionary method

iOSAndroidWindows

explanation

Register the reading of a word.

Replaces the string specified by word in the text with pronunciation. (The word is not case-sensitive.)

If space is set to "true", the word will be read only if there is a space before or after the word. Use this option when you want to read the word by word.

example | space=$TRUE | space=$FALSE
text="There is a word in the text." (There are no spaces before or after the word) | No transposition will occur. | There will be a transposition
text="There is a word in the text." (Space before and after the word) | There will be a transposition | There will be a transposition
text="word is at the beginning of the sentence" (space after the word) | There will be a transposition | There will be a transposition
text="at the end of a sentence: word" (Space before the word) | There will be a transposition | There will be a transposition
text="word" (word alone) | There will be a transposition | There will be a transposition

If the word has already been registered, overwrite the content and register it.

Call format

synthesizer.AddWordToDictionary(word, pronunciation, space)

Return value

None

argument

String word

Register words to be read

String pronunciation

How to read a word

boolean space

If "true" is specified, the word will be read only if there is a space before or after the word.

exception

None

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
synthesizer.AddWordToDictionary("corp", "corporation", true);
synthesizer.StartSpeaking("corporation");

Related item

AddWordToDictionaryWithCSV、RemoveWordFromDictionary method


SpeechSynthesizer.AddWordToDictionaryWithCSV method

iOSAndroidWindows

explanation

Register word readings in CSV format.

The format is as follows

Word,How to read,Whether to consider half-width spaces before and after a word (boolean)

Replaces the string specified in the first column in the text with the reading specified in the second column. (The words are not case-sensitive.)

If true is specified in the third column, the reading will be changed only if there is a space before or after the word.

example | Three column entries TRUE | Three column entries FALSE
text="There is a word in the sentence" (No spaces before or after the word) | No transposition will occur. | There will be a transposition
text="There is a word in the sentence" (Space before and after the word) | There will be a transposition | There will be a transposition
text="The word is at the beginning of the sentence" (Space after a word) | There will be a transposition | There will be a transposition
text="At the end of a sentence Word" (Space before a word) | There will be a transposition | There will be a transposition
text="Word" (only Word) | There will be a transposition | There will be a transposition

If the word has already been registered, the content will be overwritten and registered.

Call format

synthesizer.AddWordToDictionaryWithCSV(csvDoc)

Return value

None

argument

CSVDocument csvDoc

Reference to the CSVDocument object.

exception

None

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
synthesizer.AddWordToDictionaryWithCSV(new CSVDocument << CSV{
 corp,corporation,false
});
synthesizer.StartSpeaking("corporation");

Related item

AddWordToDictionary、RemoveWordFromDictionary method


SpeechSynthesizer.GetAvailableEngines method

iOSAndroidWindows

explanation

Get a list of available text-to-speech engine names.

Call format

var engines = synthesizer.GetAvailableEngines()

Return value

Array object that contains a list of engine name strings.

argument

None

exception

SPEECH-1

The text-to-speech function is not loaded.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
var engines = synthesizer.GetAvailableEngines();
for (var i = 0; i < engines.length; i++) {
 var row = ^.FlexView1.insertRow();
 row.Engine = engines[i];
}

Related item

GetCurrentEngine、SetEngine method


SpeechSynthesizer.GetAvailableVoices method

iOSAndroidWindows

explanation

Gets a list of speech information that can be used by the speech synthesis engine.

Android version
Depending on the device, you may need to download the voice data in advance.
The results may include audio information that has not yet been downloaded.

Call format

var voices = synthesizer.GetAvailableVoices()

Return value

Array object that contains the Voice class object.

argument

None

exception

SPEECH-1

The text-to-speech function is not loaded.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
var voices = synthesizer.GetAvailableVoices();
for (var i = 0; i < voices.length; i++) {
 var row = ^.FlexView1.insertRow();
 row.ID = voices[i].ID;
 row.Name = voices[i].VoiceName;
 row.Language = voices[i].Language;
}

Related item

GetCurrentVoice、SetVoice method


SpeechSynthesizer.GetCurrentEngine method

iOSAndroidWindows

explanation

Get the name of the text-to-speech engine currently being used.

Call format

var engine = synthesizer.GetCurrentEngine()

Return value

Engine name string

argument

None

exception

SPEECH-1

The text-to-speech function is not loaded.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
var engine = synthesizer.GetCurrentEngine();
print("Current Engine:" + engine);

Related item

GetAvailableEngines、SetEngine method


SpeechSynthesizer.GetCurrentVoice method

iOSAndroidWindows

explanation

Get the audio information currently being used.

Call format

var vo = synthesizer.GetCurrentVoice()

Return value

Reference to the Voice class object

argument

None

exception

SPEECH-1

The text-to-speech function is not loaded.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
var vo = synthesizer.GetCurrentVoice();
print("Current Voice ID:" + vo.ID + "\n");
print("Current Voice name:" + vo.VoiceName + "\n");
print("Current Voice language:" + vo.Language + "\n");

Related item

Voice class

GetAvailableVoices、SetVoice method


SpeechSynthesizer.IsLanguageAvailable method

iOSAndroidWindows

explanation

Determines whether or not the specified language is available.

Call format

var available = synthesizer.IsLanguageAvailable( language )

Return value

If language is available, true will be returned.

argument

String language

Language expressed by language code and country code (ja-JP, etc.)

exception

SPEECH-1

The text-to-speech function is not loaded.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
var language = "ja-JP";
if (synthesizer.IsLanguageAvailable(language)) {
 print(language + " is available.\n");
}

Related item

GetAvailableVoices method


SpeechSynthesizer.Load method

iOSAndroidWindows

explanation

Initializes the text-to-speech engine with the default text-to-speech engine and voice information.

Call format

synthesizer.Load()

Return value

None

argument

None

exception

SPEECH-2

The text-to-speech feature is already loaded.

SPEECH-10

Failed to initialize the speech synthesis engine.

Example of use

SpeechSynthesizer synthesizer {
 Function OnUtteranceStateChanged(e) {
  if (e.state == $UTTERANCE_FINISHED) {
   Unload();
  }
 }

 if (!$DESIGNTIME) {
  Load();
  StartSpeaking("Hello World!");
 }
}

Related item

Unload method


SpeechSynthesizer.RemoveWordFromDictionary method

iOSAndroidWindows

explanation

Deletes the readings of the words registered with the AddWordToDictionary and AddWordToDictionaryWithCSV methods.

Call format

synthesizer.RemoveWordFromDictionary( word )

Return value

None

argument

String word

Words to remove reading

exception

None

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.AddWordToDictionary("corp", "corporation", true);
synthesizer.StartSpeaking("corporation");

synthesizer.RemoveWordFromDictionary("corp");
synthesizer.StartSpeaking("corporation");

Related item

AddWordToDictionary、AddWordToDictionaryWithCSV method


SpeechSynthesizer.SetEngine method

iOSAndroidWindows

explanation

Set the text-to-speech engine to be used and re-initialize the text-to-speech engine.

If a SPEECH-10 exception occurs, you will need to call the Load method again.

Call format

synthesizer.SetEngine( engine )

Return value

None

argument

String engine

Text-to-speech engine name

exception

SPEECH-1

The text-to-speech function is not loaded.

SPEECH-10

Failed to initialize the speech synthesis engine.

SPEECH-11

You cannot set the text-to-speech engine while speaking.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
var engines = synthesizer.GetEngines();
if (engines.length > 2){
 synthesizer.SetEngine(engines[1]);
}

Related item

GetAvailableEngines、GetCurrentEngine method


SpeechSynthesizer.SetVoice method

iOSAndroidWindows

explanation

Sets the audio to be used by default.

If a Voice class object is specified in StartSpeaking, it will take precedence.

Call format

synthesizer.SetVoice( vo )

Return value

None

argument

Voice vo

Voice class object

exception

SPEECH-1

The text-to-speech function is not loaded.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();
var engines = synthesizer.GetEngines();
if (engines.length > 2){
 synthesizer.SetEngine(engines[1]);
}

Related item

GetAvailableVoices、GetCurrentVoice、StartSpeaking method


SpeechSynthesizer.StartSpeaking method

iOSAndroidWindows

explanation

Starts the speech.

This method puts the text into an internal queue and then returns to process it without waiting for the speech to start or end.

The text is spoken in the order in which the StartSpeaking method is called.

If the speech setting is omitted, the values of Pitch, PostUtteranceDelay, Rate, and Volume properties will be used.

If you omit the voice information, the voice set by the SetVoice method will be used.

When the speech starts, the UtteranceStateChanged event will be fired with state=SpeechSynthesizer.

When all the text is read, the UtteranceStateChanged event is fired with state=SpeechSynthesizer.UTERANCE_FINISHED.

Call format

synthesizer.StartSpeaking( text [, uttr , vo] )

Return value

None

argument

String text

Text to be read out loud

Utterance uttr

Utterance class object with speech settings

Voice vo

Voice class object with voice information

exception

SPEECH-1

The text-to-speech function is not loaded.

SPEECH-3

Failed to start speaking.

Example of use

Form Form1 {
 X = 0;
 Y = 0;
 Width = 150;
 Height = 150;
 SpeechSynthesizer synthesizer {
  Function OnUtteranceStateChanged(e) {
   print("State:" + str(e.state) + " Text:" + e.text + "\n");
  }
 }

 Button Button1 {
  X = 10;
  Y = 10;
  Width = 100;
  Height = 25;
  Title = "Start";
  function OnTouch(e) {
   ^.synthesizer.StartSpeaking("Hello world!");
  }
 }

 Button Button2 {
  X = 10;
  Y = 40;
  Width = 100;
  Height = 25;
  Title = "Stop";
  function OnTouch(e) {
   ^.synthesizer.StopSpeaking(true);
  }
 }

 if ( !$DESIGNTIME ) {
  synthesizer.Load();
 }
}

Related item

Pitch、PostUtteranceDelay、Rate、Volume property

SetVoice、StopSpeaking method


SpeechSynthesizer.StopSpeaking method

iOSAndroidWindows

explanation

Stops speech.

It will also stop speaking for any text that has not yet been spoken.

When the speech is stopped by this method, the UtteranceStateChanged event will be fired, and the state will be SpeechSynthesizer.UTTERANCE_CANCELED.

Call format

synthesizer.StopSpeaking( [immediate] )

Return value

None

argument

boolean immediate

If true, speech will stop immediately; if false, speech will stop after the currently pronounced word is read out.

The default is true.

Android version
Stops speech immediately regardless of the argument.
Arguments are defined for other platforms.

exception

SPEECH-1

The text-to-speech function is not loaded.

SPEECH-4

Could not stop speech.

SPEECH-7

It is not in speech.

Example of use

Form Form1 {
 X = 0;
 Y = 0;
 Width = 150;
 Height = 150;
 SpeechSynthesizer synthesizer {
  Function OnUtteranceStateChanged(e) {
   print("State:" + str(e.state) + " Text:" + e.text + "\n");
  }
 }

 Button Button1 {
  X = 10;
  Y = 10;
  Width = 100;
  Height = 25;
  Title = "Start";
  function OnTouch(e) {
   ^.synthesizer.StartSpeaking("Hello world!");
  }
 }

 Button Button2 {
  X = 10;
  Y = 40;
  Width = 100;
  Height = 25;
  Title = "Stop";
  function OnTouch(e) {
   ^.synthesizer.StopSpeaking(true);
  }
 }

 if ( !$DESIGNTIME ) {
  synthesizer.Load();
 }
}

Related item

StartSpeaking method


SpeechSynthesizer.Unload method

iOSAndroidWindows

explanation

Unloads the Text-To-Speech function.

Call format

synthesizer.Unload()

Return value

None

argument

None

exception

SPEECH-1

The text-to-speech function is not loaded.

Example of use

SpeechSynthesizer synthesizer {
 Function OnUtteranceStateChanged(e) {
  if (e.state == $UTTERANCE_FINISHED) {
   Unload();
  }
 }

 if (!$DESIGNTIME) {
  Load();
  StartSpeaking("Hello World!");
 }
}

Related item

Load method


SpeechSynthesizer event

API version 17

Event

iOSAndroidWindows

The following events are defined in the SpeechSynthesizer class.

API | name | explanation
17 | UtteranceStateChanged | Notifies the user that the speech state has changed.

Class overview

Base class event


SpeechSynthesizer.UtteranceStateChanged event

iOSAndroidWindows

Notifies the user that the state of the speech started by the StartSpeaking method has changed.

The following child objects are added to the Event object.

type | name | explanation
Integer | state | The speech state is stored.
String | text | The text being spoken will be stored.
Integer | position | Contains the starting position of the word being pronounced in the text Only present if state is SpeechSynthesizer.UTTERANCE_SPEAKING
Integer | length | The length of the word being pronounced is stored. Only present if state is SpeechSynthesizer.UTTERANCE_SPEAKING

The speech state takes the following values.

constant | value | explanation
SpeechSynthesizer.UTTERANCE_STARTED | 0 | She's starting to speak.
SpeechSynthesizer.UTTERANCE_FINISHED | 1 | Speech terminated.
SpeechSynthesizer.UTTERANCE_CANCELED | 2 | Speech was cancelled by the StopSpeaking method.
SpeechSynthesizer.UTTERANCE_SPEAKING | 3 | He's speaking.

Android version
The following restrictions apply to state=SpeechSynthesizer.
・The event will not occur on operating systems lower than Android 8.
・Depending on the text-to-speech engine and the Voice.Language property you set, the event may not occur.


Utterance class

iOSAndroidWindows

Object
 | Utterance

This class is used to set the speech information in the SpeechSynthesizer.StartSpeaking method.

Default properties and ValueType

The default property is Value.


Utterance property

API version 17

Property

iOSAndroidWindows

The following properties are defined in the Utterance class.

API | name | access | type | Initial value | explanation
17 | Pitch | CRW | Number | 1.0 | Voice height
17 | PostUtteranceDelay | CRW | Number | 0.0 | Wait time after reading out the text
17 | Rate | CRW | Number | 1.0 | Reading speed
17 | Value | CRW | String Number Fixed Date |  | The value of the object
17 | Volume | CRW | Number | 1.0 | Reading volume

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


Utterance.Pitch property

iOSAndroidWindows

Specifies the pitch of the sound as a value greater than 0. The default is 1.0.

If a value greater than 1.0 is specified, the sound will be higher.

If a value smaller than 1.0 is specified, the sound will be lower.

It is internally trimmed to the range configurable by the OS.


Utterance.PostUtteranceDelay property

iOSAndroidWindows

Specifies the amount of time, in seconds, between the reading of the text specified by the StartSpeaking method and the reading of the next text.

Default is 0.0 seconds.


Utterance.Rate property

iOSAndroidWindows

Specifies the speed of reading, as a value greater than 0. The default value is 1.0.

A value greater than 1.0 increases the reading speed.

A value smaller than 1.0 will decrease the reading speed.

The value is internally trimmed to the range that can be set by the OS.


Utterance.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


Utterance method

API version 17

Method

iOSAndroidWindows

The following methods are defined in the Utterance class.

API | name | explanation
17 | (constructor) | Initializes the Utterance class.

Class overview

Base class method


Utterance constructor

iOSAndroidWindows

explanation

Initializes the Utterance class.

Call format

var uttr = new Utterance([pitch , rate, volume , postUtteranceDelay])

Return value

Utterance object

argument

Number pitch

Audio height

Specifies a value greater than 0.

Number rate

Reading speed

Specifies a value greater than 0.

Number volume

Reading volume

Specify a value between 0 and 1.

Number postUtteranceDelay

Specifies the waiting time in seconds after the text is read out loud.

exception

None

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();

var uttr = new Utterance(0.5, 2.0, 0.5, 5);

synthesizer.StartSpeaking("Hello world", uttr);

Related item

SpeechSynthesizer.StartSpeaking method


Utterance event

API version 17

Event

iOSAndroidWindows

There are no events defined in the Utterance class.

Class overview

Base class event


Voice class

iOSAndroidWindows

Object
 | Voice

This class is used to set the speech information to be used by the speech synthesis engine and to store the speech information that the speech synthesis engine can use.

Use the ID property or the Language property to set the speech information to be used by the speech synthesis engine.

Voice object is specified by SpeechSynthesizer.SetVoice method and SpeechSynthesizer.StartSpeaking method.

When using voice information, the engine will search for and use voice information that matches the ID and Language properties of the Voice object specified in the above method from among the available voice information.

(If both are specified, the ID property takes precedence.)

The other properties are used for storing information retrieved from the text-to-speech engine.

Default properties and ValueType

The default property is Value.


Voice property

API version 17

Property

iOSAndroidWindows

The following properties are defined in the Voice class.

API | name | access | type | explanation
17 | Gender | R | Integer | Voice gender
17 | ID | CR | String | Voice information identifier
17 | IsNetworkRequired | R | boolean | Whether a network connection is required.
17 | Language | CR | String | Languages supported
17 | Latency | R | Integer | Voice delay
17 | Quality | R | Integer | Speech Synthesis Quality
17 | Value | CRW | String Number Fixed Date | The value of the object
17 | VoiceName | R | String | Name of audio information

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


Voice.Gender property

iOSAndroidWindows

Indicates the gender of the voice. It can take the following values.

constant | value | explanation
Voice.GENDER_UNSPECIFIED | 0 | unknown
Voice.GENDER_MALE | 1 | male
Voice.GENDER_FEMALE | 2 | female

Android version
Depending on the version of the text-to-speech engine you are using, you may not be able to get the gender,
and all Voice.Gender properties obtained by the GetAvailableVoices method may become Voice.Gender_Unspecified.

This property is read-only and cannot be modified.


Voice.ID property

iOSAndroidWindows

Indicates the identifier of the voice information.


Voice.IsNetworkRequired property

iOSAndroidWindows

Indicates $TRUE if a network connection is required for speech synthesis. Indicates $FALSE if not required.

Even if this property is $FALSE, downloading the audio information itself is necessary.

This property is read-only and cannot be modified.


Voice.Language property

iOSAndroidWindows

Indicates which languages are supported by the audio information.

The string will be a combination of language code and country code (e.g. ja-JP).


Voice.Latency property

iOSAndroidWindows

Indicates how much the audio is delayed. The value is shown below.

constant | value | explanation
Voice.LATENCY_VERY_LOW | 0 | Very short delay time.
Voice.LATENCY_LOW | 1 | Short delay time
Voice.LATENCY_NORMAL | 2 | Moderate delay time
Voice.LATENCY_HIGH | 3 | Long delay time (e.g., when network is required for speech synthesis)
Voice.LATENCY_VERY_HIGH | 4 | The delay time is very long. (e.g., if speech synthesis requires a network and the network is slow)

This property is read-only and cannot be modified.


Voice.Quality property

iOSAndroidWindows

Indicates the audio quality. The values are as follows.

constant | value | explanation
Voice.QUALITY_VERY_LOW | 0 | Lowest quality
Voice.QUALITY_LOW | 1 | Low quality
Voice.QUALITY_NORMAL | 2 | Normal quality
Voice.QUALITY_HIGH | 3 | High quality
Voice.QUALITY_VERY_HIGH | 4 | Highest quality

This property is read-only and cannot be changed.


Voice.Value property

iOSAndroidWindows

The value of the object, which holds the value of the data type specified in ValueType.

The value of this property has no effect on the behavior of the object.


Voice.VoiceName property

iOSAndroidWindows

Indicates the name of the audio information.

This property is read-only and cannot be modified.


Voice method

API version 17

Method

iOSAndroidWindows

The following methods are defined in the Voice class.

API | name | explanation
17 | (constructor) | Initializes the Voice class.

Class overview

Base class method


Voice constructor

iOSAndroidWindows

explanation

Initializes the Voice class.

The Voice object is used in the SpeechSynthesizer.SetVoice method and SpeechSynthesizer.StartSpeaking method.

To actually use the audio information, search for audio information that matches the id or language among the available audio information.

(If both are specified, the id will be searched first).

Call format

var vo = new Voice(id [, language])

Return value

Voice object

argument

String id

Voice information identifier

String language

Languages supported by audio information

It is represented by a language code and a country code (such as ja-JP).

exception

CRS-16

Invalid constructor argument.

Example of use

var synthesizer = new SpeechSynthesizer();
synthesizer.Load();

var vo = new Voice("language-id");

synthesizer.SetVoice(vo);
synthesizer.StartSpeaking("Hello world");

Related item

ID、Language property

SpeechSynthesizer.GetAvailableVoices、SpeechSynthesizer.SetVoice、SpeechSynthesizer.StartSpeaking method


Voice event

API version 17

Event

iOSAndroidWindows

There are no events defined in the Voice class.

Class overview

Base class event


SmaPri package

This package is designed to work with SATO printers using SmaPri Library.

For an overview of this feature and the procedure to print, please see "SmaPri Package Overview".

※SmaPri is a registered trademark or trademark of SATO HOLDINGS CORPORATION.

Class

API | name | Explanation
23 | SmaPri | This class is designed for printing using SATO printers.
23 | SmaPriBluetooth | Class for searching and connecting Bluetooth devices using SmaPri Library.
23 | SmaPriInputItem | Class for setting print items.
23 | SmaPriPrinter | This class is used to configure printer settings.


SmaPri Package Overview

1 Configuration of this feature

The SmaPri package provides the ability to print labels in conjunction with SATO printers that are compatible with the SmaPri Library.

Biz/Browser HT and printer are connected via Bluetooth or TCP.

A format file (*.spfmtz) created in "SmaPri Designer" is used to issue label printouts. Biz/Browser HT creates a print command from the format information and publication data read from the format file and instructs the printer to issue the command.

※SATO and SmaPri are registered trademarks or trademarks of SATO HOLDINGS CORPORATION.

2 Steps to printing by CRS

The following is an example of a CRS code from the connection to the printer to the print instruction.

The entire code is first described below. Individual descriptions are given below.

Form Form1 {
    X = 0;
    Y = 0;
    Width = 600;
    Height = 400;

    SmaPri sm;
    SmaPriPrinter sp;

    Button btnSetPrinter {
        X = 10;
        Y = 10;
        Width = 50;
        Height = 20;
        Title = "SetPrinter";
        Function OnTouch(e) {
            ^.sp.SetPrinter(SmaPriPrinter.DeviceTypeTcp, "192.168.1.15", SmaPriPrinter.ProtocolStatus4, false);
        }
    }

    Button btnConnect {
        X = 70;
        Y = 10;
        Width = 50;
        Height = 20;
        Title = "Connect to Printer";
        Function OnTouch(e) {
            ^.sp.Connect();
        }
    }

    Button btnRegisterFormat {
        X = 10;
        Y = 40;
        Width = 50;
        Height = 20;
        Title = "Register format";
        Function OnTouch(e) {
            ^.sm.RegisterFormat("http://192.168.1.15/format/sample.spfmtz");
        }
    }

    Button btnPrintFormat {
        X = 10;
        Y = 40;
        Width = 50;
        Height = 20;
        Title = "Print format";
        Function OnTouch(e) {
            var item = new SmaPriInputItem[2];
            item[0].FormatId = 1;
            item[0].PrintNum = 1;
            item[0].SetData("Text1", "ABCD");
            item[0].SetData("Barcode1", "hello world!");

            item[1].FormatId = 2;
            item[1].PrintNum = 1;
            item[1].SetData("fixed graphics", "http://192.168.1.15/image/sample.bmp");
            item[1].SetData("switching graphic", "1");

            var extended = new Array();
            extended["print_operation"] = "1,3,3";
            extended["print_offset"] = "50,50";

            ^.sm.PrintFormat(item, extended);
        }
    }
    // {
        Function OnSmaPriPrinterConnectionChanged(e) {
            //.MessageBox("Printer connection status change:" + str(e.State) + " :" + e.Message);
        }
        Function OnSmaPriPrintFailed(e) {
            //.MessageBox("Print Failure(" + e.JobName + "):" + e.Message);
        }
        Function OnSmaPriPrintFinished(e) {
            //.MessageBox("Print Complete(" + e.JobName + ")");
        }
    }
}

First, connect with the SmaPriPrinter.SetPrinter and SmaPriPrinter.Connect methods. The printer model in the third argument of the SmaPriPrinter.SetPrinter method must match the printer. The printer information specified in the SmaPriPrinter.SetPrinter method is saved and will be applied the next time Biz/Browser is started. IP addresses and Bluetooth addresses are saved separately.

    Button btnSetPrinter {
        X = 10;
        Y = 10;
        Width = 50;
        Height = 20;
        Title = "SetPrinter";
        Function OnTouch(e) {
            ^.sp.SetPrinter(SmaPriPrinter.DeviceTypeTcp, "192.168.1.15", SmaPriPrinter.ProtocolStatus4, false);
        }
    }

    Button btnConnect {
        X = 700;
        Y = 10;
        Width = 50;
        Height = 20;
        Title = "Connect to Printer";
        Function OnTouch(e) {
            ^.sp.Connect();
        }
    }

The format file is loaded with the SmaPri.RegisterFormat method and saved in the Android device. The format file can be specified as a URL to a file on a Web server or in a terminal, or as a string of binary data encoded in Base64 format.

    Button btnRegisterFormat {
        X = 10;
        Y = 40;
        Width = 50;
        Height = 20;
        Title = "Register format";
        Function OnTouch(e) {
            ^.sm.RegisterFormat("http://192.168.1.15/format/sample.spfmtz");
        }
    }

The published data is created as an array in the SmaPriInputItem class. The created issue data is passed to the SmaPri.PrintFormat method to execute printing. Printing is performed in the index order of the issue data array.

    Button btnPrintFormat {
        X = 10;
        Y = 40;
        Width = 50;
        Height = 20;
        Title = "Print format";
        Function OnTouch(e) {
            var item = new SmaPriInputItem[2];
            item[0].FormatId = 1;
            item[0].PrintNum = 1;
            item[0].SetData("Text1", "ABCD");
            item[0].SetData("Barcode1", "hello world!");

            item[1].FormatId = 2;
            item[1].PrintNum = 1;
            item[1].SetData("fixed graphics", "http://192.168.1.15/image/sample.bmp");
            item[1].SetData("switching graphic", "1");

            var extended = new Array();
            extended["print_operation"] = "1,3,3";
            extended["print_offset"] = "50,50";

            ^.sm.PrintFormat(item, extended);
        }
    }

3 Menu

The SmaPri function can be configured from the Biz/Browser HT menu.

The operation to connect to the printer by "Printer connection status / Control" is the same as calling the SmaPriPrinter.Connect method, and CRS will also be in the connected state.

The address of the printer is the address of the printer set in the SmaPriPrinter.SetPrinter method or in the printer settings screen. If a Bluetooth device is configured, the Bluetooth address is displayed. If a printer on the network, the IP address of the printer is displayed.

４ Printer Settings screen

The Printer Settings screen allows you to configure detailed settings related to SmaPri's printers.

No.

Explanation

1. Printer model

Printer model of the configured printer. Default is Status 4(1 port connection).

This is the value specified in the third argument of the SmaPriPrinter.SetPrinter method.

Must match the printer to which it is connected.

2. Bluetooth connection

Use Bluetooth printer, exclusive with LAN setup.

This check is enabled if the Bluetooth printer (SmaPriPrinter.DeviceTypeBluetooth) is specified in the first argument of the SmaPriPrinter.SetPrinter method.

3. Bluetooth device

Select the Bluetooth printer. It also searches for and pairs the Bluetooth device.

Tap to list configured and paired devices and set the selected device as the printer. Select "Discover new device" to scan for Bluetooth devices.

Bluetooth devices configured here will also be enabled on the CRS.

4. Device name filter

Set whether to filter paired devices and search result devices to be displayed in "3. Bluetooth device".

Displays only devices that contain the string you set. Default is off. The default search string is "SATO".

It does not affect the result of the SmaPriBluetooth.Discover method.

5. Automatic pairing

Sets whether pairing is performed automatically and the PIN code for pairing. Default is off.

If this setting is enabled, a PIN code is automatically specified when pairing (by calling "3. Bluetooth device" and SmaPriBluetooth.CreateBond method) and also when connecting to a Bluetooth printer (by connecting from the menu and by calling Pairing is also performed when connecting to a Bluetooth printer (by calling SmaPriPrinter.Connect method).

6. LAN connection

Use a printer on the network, exclusive of Bluetooth settings.

This check is enabled if the Bluetooth printer (SmaPriPrinter.DeviceTypeTcp) is specified as the first argument of the SmaPriPrinter.SetPrinter method.

7. IP address

Displays and sets the IP address of the network printer.

The IP address set here is also valid on the CRS.

8. TCP Port

Displays and sets the port number for connecting to a network printer. Default is 9100.

The port number set here is also valid on the CRS.

9. Wi-Fi automatic enabling

Automatically turns Wi-Fi on when connecting to the printer. Default is off.

Valid both when connecting from the menu and when calling the SmaPriPrinter.Connect method.

The function is disabled in Android 10 or later due to OS limitations.

10. Printer disconnection timer

Sets the amount of time to automatically disconnect from the printer after connecting and printing. The default is 5 minutes.

In the case of "Every label print", the connection is not automatically disconnected after the connection is made. It will be disconnected after printing is executed.

11. WiFi/Bluetooth interface automatic disable timer

Sets the amount of time to turn off Wi-Fi or Bluetooth after disconnecting from the printer. The default is "No disconnection".

The ability to turn off Wi-Fi is disabled in Android 10 and later due to OS limitations.

From Biz/Browser HT 1.3.3, the ability to turn off Bluetooth is disabled in Android 13 and later due to OS limitations.

12. Multi item transmission

Specifies whether or not to execute the next printout without waiting for the printout to finish when printing. Default is off.

13. Enable transmission control character

Specifies whether transmission control characters (STX, ETX) are automatically added when sending print data. Default is on.

If "14. Enable CRC" is on, this setting is always enabled.

14. Enable CRC

Enables CRC checking during communication. Default is off.

If the CRC check is enabled, if the print data is damaged due to a communication error, the damaged data will not be printed. However, the printing speed will be slower.

This setting must be the same as the printer's CRC check function. Please refer to the printer manual for how to set up the printer.

15. Printer reply timeout is invalid.

Sets the printer response timeout in milliseconds. The default is 20000 milliseconds.


SmaPri class

iOSAndroidWindows

Object
 | SmaPri

Class for registering and printing format files (*.spfmtz) in conjunction with a SATO printer.

For an overview of this feature and the procedure to print, please see "SmaPri Package Overview".

Default properties and ValueType

There are no default properties. The ValueType specification is invalid.


SmaPri property

API version 23

Property

iOSAndroidWindows

The following properties are defined in the SmaPri class.

API | name | access | type | Initial value | explanation
23 | FileSize | R | integer | 0 | File size of the format file
23 | LastModified | R | Date | NULL | Date the format file was last updated
23 | PrinterName | R | String |  | Printer name specified in the format file
23 | PrinterResolution | R | integer | 0 | Resolution specified in the format file
23 | ProjectName | R | String |  | Project name as specified in the format file
23 | SBPLVersion | R | String |  | SBPL Version

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


SmaPri.FileSize property

iOSAndroidWindows

Indicates the file size of the format file.

This property is read-only and cannot be changed.


SmaPri.LastModified property

iOSAndroidWindows

Holds the last modified date of the format file as a Date object.

This property is read-only and cannot be changed.


SmaPri.PrinterName property

iOSAndroidWindows

Indicates the printer name specified in the format file.

This property is read-only and cannot be changed.


SmaPri.PrinterResolution property

iOSAndroidWindows

Indicates the resolution specified in the format file.

This property is read-only and cannot be changed.


SmaPri.ProjectName property

API version 23

SmaPri. ProjectName property

iOSAndroidWindows

Indicates the project name specified in the format file.

This property is read-only and cannot be changed.


SmaPri.SBPLVersion property

iOSAndroidWindows

Indicates the SBPL version of the format file.

This property is read-only and cannot be changed.


SmaPri method

API version 23

Method

iOSAndroidWindows

The following methods are defined in the SmaPri class.

API | name | explanation
23 | GetFormatInfo | Get the number and name of the layout contained in the format file
23 | GetInputItem | Get layout entries
23 | GetPrintCutSettings | Get the paper cut setting specified for the layout
23 | GetPrintDepthSettings | Get the print density setting specified for the layout
23 | GetPrintItem | Get print items
23 | GetPrintOffsetSettings | Get the base point correction settings specified for the layout
23 | GetPrintSpeedSettings | Get the print speed setting specified for the layout
23 | GetTableInfo | Get table information
28 | PreviewFormat | Get print preview image data (FLEQV FX3-LX only) *FLEQV is a registered trademark or trademark of SATO HOLDINGS CORPORATION.
23 | PrintFormat | Printing is performed using the registered format information
23 | RegisterFormat | Register format file (*.spfmtz)
23 | SendCommand | Issue a print command to the printer
23 | SendRawData | Send data to the printer

Class overview

Base class method


SmaPri.GetFormatInfo method

iOSAndroidWindows

Explanation

Get the call number and call name of the format contained in the format file.

Call format

var formatInfo = sm.GetFormatInfo( );

Return value

Record object with the following child objects:

type | name | Explanation
Number | FormatId | Format number
String | FormatName | Format name

argument

None

exception

SMAPRI-2

The format is not set.

Example of use

var info = sm.GetFormatInfo();
print("Format No:", std(info.FormatId), " Name:", info.FormatName);
var inputItems = sm.GetInputItem(info[0].FormatId);
var items = new SmaPriInputItem[1];
items.SetData(items[0].FieldName, "ABC");

Related item

RegisterFormat method


SmaPri.GetInputItem method

iOSAndroidWindows

Explanation

Get input items contained in the format file.

Call format

var inputItem = sm.GetInputItem(formatId);

Return value

An array of Record objects with the following child objects is returned:

type

name

Explanation

Number

FieldType

Field Type. Can be one of the following values.

constant | value | Explanation
SmaPri.FieldTypeText | 0 | Text
SmaPri.FieldTypeBarcode | 1 | Barcode
SmaPri.FieldTypePrice | 2 | Price
SmaPri.FieldTypeDateTime | 3 | Date
SmaPri.FieldTypeSequence | 4 | Sequential number
SmaPri.FieldTypeTable | 5 | Table
SmaPri.FieldTypeGraphic | 6 | Graphics
SmaPri.FieldTypeQuantity | 100 | Number of sheets printed

String

FieldName

Filed name

Number

TableId

Table ID(Only if FieldType is SmaPri.FieldTypeTable)

Number

InputLength

Number of input digits

String

DefaultValue

Initial value

argument

String formatId

Format id

exception

SMAPRI-2

The format is not set.

SMAPRI-10

Failed to get the format input item.

Example of use

var info = sm.GetFormatInfo();
print("Format No:", std(info.FormatId), " Name:", info.FormatName);
var inputItems = sm.GetInputItem(info[0].FormatId);
var items = new SmaPriInputItem[1];
items.SetData(items[0].FieldName, "ABC");
sm.PrintFormat(items);

Related item

RegisterFormat, GetFormatInfo, SmaPriInputItem.SetData method


SmaPri.GetPrintCutSettings method

iOSAndroidWindows

Explanation

Get the paper cut information contained in the format file.

Call format

var settings = sm.GetPrintCutSettings(formatId);

Return value

Record object with the following child objects:

type | name | Explanation
Number | MaxNumberOfSheetsCut | Maximum number of specified sheets cut
Number | DefaultNumberOfSheetsCut | Default number of specified sheets cut
Number | DefaultEjectionSheetsCut | Default value for whether or not cutting is performed when paper is ejected. If cutting is performed when paper is ejected, the value is $TRUE.

argument

String formatId

Format id

exception

SMAPRI-2

The format is not set.

SMAPRI-16

Failed to retrieve format settings.

Example of use

var info = sm.GetFormatInfo();

var settings = sm.GetPrintCutSettings(info[0].FormatId);
print("Default number of sheets cut:", str(settings.MaxNumberOfSheetsCut));

Related item

RegisterFormat, PrintFormat, GetFormatInfomethod


SmaPri.GetPrintDepthSettings method

iOSAndroidWindows

Explanation

Get print density information contained in the format file.

Call format

var settings = sm.GetPrintDepthSettings(formatId);

Return value

An array of Record objects with the following child objects is returned:

type | name | Explanation
Number | SettingValue | Printing Density Level
Number | isDefault | Whether the set value is the default or not. If default, $TRUE.

argument

String formatId

Format id

exception

SMAPRI-2

The format is not set.

SMAPRI-16

Failed to retrieve format settings.

Example of use

var info = sm.GetFormatInfo();

var settings = sm.GetPrintDepthSettings(info[0].FormatId);
for (var i = 0; i < setting.length; i++) {
 print("SettingValue(", str(i), "):", str(settings[i].SettingValue));
}

Related item

RegisterFormat, PrintFormat, GetFormatInfo method


SmaPri.GetPrintItem method

iOSAndroidWindows

Explanation

Get the print items contained in the format file.

Call format

var printItem = sm.GetPrintItem();

Return value

An array of Record objects with the following child objects is returned:

type

name

Explanation

String

PrintItemName

Print item name

Number

PrintItemType

Type of print item. Can be one of the following values:

constant | value | Explanation
SmaPri.PrintItemTypeText | 0 | Text
SmaPri.PrintItemTypeBarcode | 1 | Barcode
SmaPri.PrintItemTypePrice | 2 | Price
SmaPri.PrintItemTypeDateTime | 3 | Date
SmaPri.PrintItemTypeSequence | 4 | Sequential number
SmaPri.PrintItemTypeTable | 5 | Table
SmaPri.PrintItemTypeGraphic | 6 | Graphic
SmaPri.PrintItemTypeCommand | 7 | Command
SmaPri.PrintItemTypeFrame | 8 | Frame line
SmaPri.PrintItemTypeLine | 9 | Ruled line

argument

None

exception

SMAPRI-2

The format is not set.

SMAPRI-17

Failed to retrieve format print item.

Example of use

var info = sm.GetFormatInfo();
print("Format No:", std(info.FormatId), " Name:", info.FormatName);
var printItems = sm.GetPrintItem(info[0].FormatId);
var items = new SmaPriInputItem[1];
items.SetData(items[0].PrintItemName, "", false);
sm.PrintFormat(items);

Related item

RegisterFormat, PrintFormat, GetFormatInfo method


SmaPri.GetPrintOffsetSettings method

iOSAndroidWindows

Explanation

Get the maximum and minimum values of the base point corrections contained in the format file.

Call format

var settings = sm.GetPrintOffsetSettings(formatId);

Return value

Record object with the following child objects:

type | name | Explanation
Number | MinVerticalPosition | Minimum offset of the base point in the vertical direction
Number | MaxVerticalPosition | Maximum offset of the base point in the vertical direction
Number | MinHorizontalPosition | Minimum offset of the base point in the horizontal direction
Number | MaxHorizontalPosition | Maximum offset of the base point in the horizontal direction

argument

String formatId

Format id

exception

SMAPRI-2

The format is not set.

SMAPRI-16

Failed to retrieve format settings.

Example of use

var info = sm.GetFormatInfo();

var settings = sm.GetPrintOffsetSettings(info[0].FormatId);
print("Vertical offset range:", str(settings.MaxVerticalPosition),"-", str(settings.MinVerticalPosition), "\n");
print("Horizontal offset range:", str(settings.MaxHorizontalPosition),"-", str(settings.MinHorizontalPosition), "\n");

Related item

RegisterFormat, PrintFormat, GetFormatInfo method


SmaPri.GetPrintSpeedSettings method

iOSAndroidWindows

Explanation

Get print speed information contained in the format file.

Call format

var settings = sm.GetPrintSpeedSettings(formatId);

Return value

An array of Record objects with the following child objects is returned:

type | name | Explanation
Number | SettingValue | Printing speed level
String | SpeedValue | Printing speed(mm/s)
Number | isDefault | Whether the set value is the default or not. If default, $TRUE.

argument

String formatId

Format id

exception

SMAPRI-2

The format is not set.

SMAPRI-16

Failed to retrieve format settings.

Example of use

var info = sm.GetFormatInfo();

var settings = sm.GetPrintSpeedSettings(info[0].FormatId);
for (var i = 0; i < setting.length; i++) {
 print("SettingValue(", str(i), ":", str(settings[i].SettingValue), " Speed(mm/s):", settings[i].SpeedValue);
}

Related item

RegisterFormat, PrintFormat, GetFormatInfo method


SmaPri.GetTableInfo method

iOSAndroidWindows

Explanation

Get table information contained in the format file.

Call format

var tableInfo = sm.GetTableInfo();

Return value

An array of Record objects with the following child objects is returned:

type

name

Explanation

String

Name

Table name

Number

IdNumber

Table ID

Array

Record

Record information for the table.

An array of Records with the following child objects:

type | name | Explanation
Number | RegistrationNumber | Registration number of the record For image tables, the value is fixed at 100.
String | StringValue | Text of record
String | GraphicData | Image data of records expressed in Base64 format

argument

None

exception

SMAPRI-2

The format is not set.

Example of use

var tableInfo = sm.GetTableInfo();
var item = new SmaPriInputItem[1];
item[0].FormatId = 1;
item[0].PrintNum = 1;
/* Specify the registration number of a record for a table field associated with the first table */
item[0].SetData("Text of Table1", str(tableInfo[0].Record[0].RegistrationNumber));

sm.PrintFormat(item);

Related item

RegisterFormat, PrintFormat, GetFormatInfo method


SmaPri.PreviewFormat method

iOSAndroidWindows

Explanation

A preview command is created from the registered format file information and print data to create print preview image data.

Use the SmaPriInputItem class to set the print data.

This function can only be used when connected to FLEQV FX3-LX.

*FLEQV is a registered trademark or trademark of SATO HOLDINGS CORPORATION.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

imgs = smapri.PreviewFormat( inputItems [, extraParams [, mount [,rotate]]] );

Return value

Array object containing multiple preview image Image objects.

Creates an image for each print data specified in inputItems.

argument

SmaPriInputItem[] inputItems

Array of SmaPriInputItem class with print data set.

Create preview images in array index order.

SmaPriInputItem.PrintNum property is ignored.

Array extraParams

Specify extension parameters.

Stores the setting name in the key (string) and the setting value in the value of the Array argument.

Key(String) | Value type | Explanation
"print_offset" | String | Specifies a comma-separated list of print position correction values. The format is "±aaaaa,±bbbbb". ±aaaa : Vertical correction value (in dots) ±bbbb : Horizontal correction value (in dots)

If null is specified, the behavior will be the same as if the argument is omitted.

boolean mount

If you specify $TRUE, the image of the mount is included in the preview image.

The default value is $FALSE.

integer rotate

Specify the amount to rotate the preview image from the following values:

constant | value | explanation
SmaPri.deg90 Image.deg270 | 2 | Rotate 90 degrees counterclockwise
SmaPri.deg180 Image.deg180 | 1 | Rotate 180 degrees
SmaPri.deg270 Image.deg90 | 0 | Rotate 270 degrees counterclockwise

If omitted, it will not rotate.

例外

FUNC-4

Wrong argument value

SMAPRI-1

The printer is not set.

SMAPRI-2

The format is not set.

SMAPRI-7

The printer is not connected.

SMAPRI-19

Failed to create preview image.

Example of use

SmaPri sm;

Button btnPrintFormat {
 X = 10;
 Y = 40;
 Width = 50;
 Height = 20;
 Title = "Print format";
 Function OnTouch(e) {
  var item = new SmaPriInputItem[2];
  item[0].FormatId = 1;
  item[0].SetData("Text1", "ABCD");
  item[0].SetData("Barcode1", "hello world!");

  item[1].FormatId = 2;
  item[1].SetData("fixed graphics", "http://192.168.1.15/image/sample.bmp");
  item[1].SetData("switching graphic", "1");

  var extended = new Array();
  extended["print_offset"] = "50,50";

  var imgs = ^.sm.PreviewFormat(item, extended);
  var fs = new FileSystem();

  for ( var i = 0; i < imgs.length; i++ ) {
   var fp = fs.Open("sample_" + str(i) + ".jpg", FileSystem.OPEN_WRITE);
   imgs[i].Save(fp, Image.FORMAT_JPEG, 80);
   fp.Close();
  }
 }
}

Related item

RegisterFormat、PrintFormat、GetPrintOffsetSettings method


SmaPri.PrintFormat method

iOSAndroidWindows

Explanation

Creates a print command from the information in the registered format file and the issued data, and executes printing.

The SmaPriInputItem class is used to set the published data.

Please refer to the "SmaPri Package Overview" for detailed usage instructions.

Each time one issue data is processed, a Root.SmaPriPrintFinished event is fired if printing is successful. Root.SmaPriPrintFailed event occurs if printing fails.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

sm.PrintFormat(inputItems [ ,extraParams] );

Return value

None

argument

SmaPriInputItem[] inputItems

Array of SmaPriInputItem class with issue data set

Execute printing in array index order.

Array extraParams

Specify extension parameters.

Stores the setting name in the key (string) and the setting value in the value of the Array argument.

Key(String)

Value type

Explanation

"print_operation"

String

Specifies print operation. Specify the cutting operation, print density, and print speed, separated by commas. The format is "aaaa,bb,cc".

Setting | Explanation
aaaa(cut operation) | 0-9999 : Cutting of specified number of pieces E : discharge cut S : Follow the format file settings omitted : Follow the format file settings *The cutting of specified number of pieces and discharge cuts can be used simultaneously by combining them (e.g., 2E).
bb(print density) | 1-10 : density level S : Follow the format file settings omitted : Follow the format file settings
cc(print speed) | number : speed level Specify one of the print speed levels obtained with the GetPrintSpeedSettings method. S : Follow the format file settings omitted : Follow the format file settings

"print_offset"

String

Specifies a comma-separated list of print position correction values. The format is "±aaaaa,±bbbbb".

±aaaa : Vertical correction value (in dots)

±bbbb : Horizontal correction value (in dots)

exception

FUNC-4

Wrong argument value

SMAPRI-1

The printer is not set.

SMAPRI-2

The format is not set.

SMAPRI-6

Failed to print.

SMAPRI-7

The printer is not connected.

SMAPRI-14

Invalid format ID.

Example of use

SmaPri sm;

Button btnPrintFormat {
 X = 10;
 Y = 40;
 Width = 50;
 Height = 20;
 Title = "Print format";
 Function OnTouch(e) {
  var item = new SmaPriInputItem[2];
  item[0].FormatId = 1;
  item[0].PrintNum = 1;
  item[0].SetData("Text1", "ABCD");
  item[0].SetData("Barcode1", "hello world!");

  item[1].FormatId = 2;
  item[1].PrintNum = 1;
  item[1].SetData("fixed graphics", "http://192.168.1.15/image/sample.bmp");
  item[1].SetData("switching graphic", "1");

  var extended = new Array();
  extended["print_operation"] = "1,3,3";
  extended["print_offset"] = "50,50";

  ^.sm.PrintFormat(item, extended);
 }
}

Related item

RegisterFormat, PreviewFormat, GetPrintSpeedSettings, GetPrintDepthSettings, GetPrintCutSettings, GetPrintOffsetSettings method

SmaPriInputItem.SetData method


SmaPri.RegisterFormat method

iOSAndroidWindows

Explanation

Register SmaPri format file (*.spfmtz).

The format file can be specified by URL as the location of the file on the web server or on the terminal's storage, or as a string of binary data in Base64 format.

The registered format file is saved on the terminal storage, and the information in the format file is used the next time Biz/Browser is launched.

If a URL is specified in format, it compares whether the format file has been updated or not, and if not, it does not download the file.

Whether the file has been updated or not is determined by whether either the file's last modified date or file size is different.

If the URL points to a file on the web server, use the Last-Modified value of the response header obtained by the HTTP HEAD method of HTTP as the last modified date of the file. For the file size, use the Content-Length value.

Please refer to the "SmaPri Package Overview" for detailed usage instructions.

Android version
When accessing files in directories other than application-specific directories on devices running Biz/Browser HT ver 1.2.6 or later and Android 11 or later, it is necessary to obtain permission from the OS by user operation.
For more information, see File access for Android 11 and later.

Call format

sm.RegisterFormat(format);

Return value

None

argument

String format

URL of the format file, or a string representing the binary data of the format file in Base64 format

exception

FUNC-4

Wrong argument value

SMAPRI-5

Failed to register the format.

SMAPRI-15

Now printing.

Example of use

SmaPri sm;

Button btnRegisterFormat {
 X = 10;
 Y = 40;
 Width = 50;
 Height = 20;
 Title = "Register format";
 Function OnTouch(e) {
  ^sm.RegisterFormat("http://192.168.1.15/format/sample.spfmtz");
 }
}

Related item

PrintFormat method


SmaPri.SendCommand method

iOSAndroidWindows

Explanation

Sends a print command to the printer.

If the command is successfully sent, the Root.SmaPriPrintCommandFinished event is fired. If an error occurs after sending the command, the Root.SmaPriPrintCommandFailed event is generated.

Call format

sm.SendCommand(command, commandType [, extraParams]);

Return value

None

argument

String command

Print command

The type of command is specified by commandType.

Integer commandType

Command Type of command

Specify the following values:

Constant | Value | Explanation
SmaPri.CommandTypeText | 0 | Specify the command as a string.
SmaPri.CommandTypeBase64 | 1 | Specify the binary data of the command as a string in Base64 format.
SmaPri.CommandTypeURL | 2 | Specify by URL the file where the binary data of the command is stored. http(s)://,file:// protocol can be specified.

Array extraParams

Specifies extended parameters.

Stores the setting name in the key (string) and the setting value in the value of the Array argument.

key(String)

Value type

Explanation

"escape_character"

String

Specifies the character (or string) to replace the command delimiter (0x1B) when commandType is SmaPri.CommandTypeText.

If not specified, "^" is replaced by the delimiter.

"tc_character"

Number

Specifies whether transmission control characters (STX/ETX) are automatically added. Specify $TRUE for automatic addition or $FALSE for non-addition.

If not specified, the setting of "Enable transmission control character" in "Printer settings" is followed.

See "SmaPri Package Overview" for more information on "Printer Settings".

exception

FUNC-4

Wrong argument value

SMAPRI-1

The printer is not set.

SMAPRI-7

The printer is not connected

SMAPRI-8

Failed to send the command.

Example of use

/* Print the text "ABC" */
sm.SendCommand("^A^V200^H200^%0^P0^L030^X21,ABC^Q1^Z", SmaPri.CommandTypeText);

Related item


SmaPri.SendRawData method

iOSAndroidWindows

Explanation

Sends data to the printer and receives data from the printer.

If the data is successfully sent, the Root.SmaPriPrintSendDataFinished is fired. Data received from the printer is retrieved from the event object.

If an error occurs after transmission, the Root.SmaPriPrintSendDataFailed event is fired.

Call format

sm.SendRawData(data [, extraParams]);

Return value

None

argument

String data

Specify the data to be sent as a string in Base64 format.

Array extraParams

Specifies extended parameters.

Stores the setting name in the key (string) and the setting value in the value of the Array argument.

Key(String) | Value type | Explanation
"byte_count" | Number | Specifies the receive data size. Receive until the specified number of bytes of data is received. If omitted, all data will be received.
"termination_data" | String | Specify the terminal data as a string in Base64 format. Receives data matching the specified data until it is received.

If both "byte_count" and "termination_data" are specified, the data is received until either condition is met.

exception

FUNC-4

Wrong argument value

SMAPRI-1

The printer is not set.

SMAPRI-7

The printer is not connected.

SMAPRI-9

Failed to send data.

Example of use

/* Get printer settings */
var data = new ByteArray(0x12, 0x50, 0x42, 0x2C, 0x43, 0x41, 0x04);
var params = new Array;
params["termination_data"] = Base64Encoder.Convert(new ByteArray(0x03));
sm.SendRawData(Base64Encoder.Convert(data), params);

Related item


SmaPri event

API version 23

Event

iOSAndroidWindows

There are no events defined in the SmaPri class.

Class overview

Base class event


SmaPriBluetooth class

iOSAndroidWindows

Object
 | SmaPriBluetooth

Class that performs searches for Bluetooth devices using the SmaPri Library.

Some functions share common processing with Bluetooth device control by the Runtime class.

Default properties and ValueType

There are no default properties. The ValueType specification is invalid.


SmaPriBluetooth property

API version 23

Property

iOSAndroidWindows

The following properties are defined in the SmaPriBluetooth class.

API | name | access | type | explanation
23 | IsDiscovering | R | boolean | Whether a Bluetooth device is being discovered or not

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


SmaPriBluetooth.IsDiscovering property

iOSAndroidWindows

Indicates whether a Bluetooth device is being discovered.

This property is read-only and cannot be changed.


SmaPriBluetooth method

API version 23

Method

iOSAndroidWindows

The following methods are defined in the SmaPriBluetooth class.

API | name | explanation
23 | CreateBond | Perform bonding with a Bluetooth device.
23 | Discover | Discover Bluetooth devices
23 | GetBondedDevices | Get bonded Bluetooth devices

Class overview

Base class method


SmaPriBluetooth.CreateBond method

API version 23

SmaPriBluetooth.CreateBond methodChange History

iOSAndroidWindows

Explanation

Starts bonding (pairing) to the device with the specified device ID.

This method returns immediately after the bonding process is started. It does not wait for the end of processing.

Bonding success/failure is handled using the BluetoothBondingFinished event.

If a PIN code is specified in pin or "Automatic pairing" is turned on in "Printer Settings", the PIN code will be entered automatically.

Otherwise, the input of PIN codes required for bonding and the process of verifying PIN codes between devices with each other requires user intervention.

An OS dialog may appear at this time.

See "SmaPri Package Overview" for more information on "Printer Settings".

Call format

sb.CreateBonding( deviceId [, pin] )

Return value

None

argument

String deviceId

Specify the BD address (The format of the BD address is the same as the MAC address).

String pin

Specify the PIN code.

exception

RTM-47

Failed to access location information.

RTM-54

Access to the Bluetooth function of the device failed.

RTM-83

Bluetooth is not enabled.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

RTM-113

Bluetooth device control is not supported.

RTM-117

Currently bonding.

RTM-118

Already bonded.

Example of use

SmaPriBluetooth sb;

Function Start() {
    try {
        /* Start to discover Bluetooth device */
        var devices = ^.sb.Discover(10, $FALSE);
        for (var i = 0; i < devices.length; i++) {
            if (devices[i].Name == "SATO Printer") {
                ^.sb.CreateBond(devices[i].DeviceId);
            }
        }
    } catch(e) {
        MessageBox(e.Message);
    }
}

Function OnBluetoothBondingFinished(e) {
    if (e.bonded) {
        //.MessageBox("Bonding was successful.");
    } else {
        //.MessageBox("Bonding failed.");
    }
}

Related item

Discover、GetBondedDevices method

Change History
*1　The specification has been changed since API version 26.


SmaPriBluetooth.Discover method

API version 23

SmaPriBluetooth.Discover methodChange History

iOSAndroidWindows

Explanation

Discover Bluetooth devices and get devices in search results.

Call format

var devices = sb.Discover( [timeoutSec [, isAsync]] );

Return value

Returns an array of Record that contains device information.

The following objects are included in Record:

Type

Name

Explanation

String

DeviceId

The BD address of the Bluetooth device is stored.

(The format of the BD address is the same as the MAC address.)

String

Name

The name of the Bluetooth device is stored.

Number

ConnectableAsBluetoothClassic

If the device can be connected as a Bluetooth Classic device, $TRUE is stored, and if not, $FALSE is stored.

Number

ConnectableAsBluetoothLE

If the device can be connected as a BLE (Bluetooth Low Energy) device, $TRUE is stored, and if it cannot be connected, $FALSE is stored.

Number

HasRssi

If the RSSI value (Received Signal Strength Indication) is present, $TRUE is stored; if not, $FALSE is stored.

Some BLE devices rarely do not have RSSI values.

Number

Rssi

If HasRssi is $TRUE, the RSSI value is stored. The unit is dBm.

If HasRssi is $FALSE, this object will not be added.

Number

HasTxPowerLevel

If it has a tx-power value, $TRUE is stored; if not, $FALSE is stored.

Number

TxPowerLevel

When HasTxPowerLevel is $TRUE, the tx-power value is stored. The unit is dBm.

If HasTxPowerLevel is $FALSE, this object will not be added.

Array

ServiceUuidList

The list of advertised services is stored.

Note that there may be some services that are not advertised but can be used.

Array

ManufacturerSpecificDataList

Manufacturer Specific Data is stored as an Array object of the following Record:

Type | Name | Explanation
Number | CompanyId | Manufacturer-specific ID
ByteArray | Data | The byte array of Manufacturer Specific Data

Array

ServiceDataList

Service Data is stored as an Array object of the following Record:

Type | Name | Explanation
String | uuid | UUID of the service
ByteArray | Data | The byte array of Service Data

argument

integer timeoutSec

Specify the time in seconds to perform the search.

If omitted, the device found at the time of the call is acquired.

boolean isAsync

Specifies whether searches are performed asynchronously.

If $TRUE is specified, the method returns immediately and searches in the background.

If $FALSE is specified, the method does not return until the number of seconds specified in timeoutSec elapses, and returns the resulting device after that time has elapsed.

exception

RTM-47

Failed to access location information.

RTM-83

Bluetooth is not enabled.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

SMAPRI-18

Failed to find Bluetooth device.

Example of use

SmaPriBluetooth sb;

Form form1 {
    Width = 424;
    Height = 320;

    Button btnStartDiscover {
        X = 16;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Start device scanning";

        Function OnTouch( e ) {
                try {
                    /* Start to discover Bluetooth device */
                    ^.sb.Discover(10, $TRUE);
                } catch(e) {
                    MessageBox(e.Message);
                }
        }
    }

    Button btnGetDeviceList {
        X = 184;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Get discovered devices";

        Function OnTouch( e ) {
            var devices = ^.sb.Discover();
            for (var i = 0; i < devices.length; i++) {
                print(devices[i].DeviceId + "\n");
            }
        }
    }
}

Related item

Change History
*1　The specification has been changed since API version 26.


SmaPriBluetooth.GetBondedDevices method

API version 23

SmaPriBluetooth.GetBondedDevices methodChange History

iOSAndroidWindows

Explanation

Get a list of bonded (paired) devices.

Call format

var devices = sb.GetBondedDevices()

Return value

Returns an array of Record that contains device information.

The following objects are included in Record:

Type | Name | Explanation
String | DeviceId | The BD address of the target Bluetooth device is stored. (The format of the BD address is the same as the MAC address.)
String | Name | The name of the target Bluetooth device is stored.
Number | ConnectableAsBluetoothClassic | If the device can be connected as a Bluetooth Classic device, $TRUE is stored, and if not, $FALSE is stored.
Number | ConnectableAsBluetoothLE | If the device can be connected as a BLE (Bluetooth Low Energy) device, $TRUE is stored, and if it cannot be connected, $FALSE is stored.
Number | HasRssi | If the RSSI value (Received Signal Strength Indication) is present, $TRUE is stored; if not, $FALSE is stored. Some BLE devices rarely do not have RSSI values.
Number | Rssi | If HasRssi is $TRUE, the RSSI value is stored. The unit is dBm. If HasRssi is $FALSE, this object will not be added.
Number | HasTxPowerLevel | If it has a tx-power value, $TRUE is stored; if not, $FALSE is stored.
Number | TxPowerLevel | When HasTxPowerLevel is $TRUE, the tx-power value is stored. The unit is dBm. If HasTxPowerLevel is $FALSE, this object will not be added.
Array | ServiceUuidList | The list of advertised services is stored. Note that there may be some services that are not advertised but can be used.

argument

None

exception

RTM-47

Failed to access location information.

RTM-83

Bluetooth is not enabled.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

Example of use

SmaPriBluetooth sm;

Form form1 {
    Width = 424;
    Height = 320;

    Button btnGetBondedDeviceList {
        X = 16;
        Y = 16;
        Width = 120;
        Height = 40;
        Title = "Get discovered devices";

        Function OnTouch( e ) {
            try {
                var devices = ^.sb.GetBondedDevices();
                for (var i = 0; i < devices.length; i++) {
                    print(devices[i].DeviceId + "\n");
                 }
            } catch(e) {
                MessageBox(e.Message);
            }
        }
    }
}

Related item

CreateBond method

Change History
*1　The specification has been changed since API version 26.


SmaPriBluetooth event

API version 23

Event

iOSAndroidWindows

There are no events defined in the SmaPriBluetooth class.

Class overview

Base class event


SmaPriInputItem class

iOSAndroidWindows

Object
 | SmaPriInputItem

Sets the print content to be specified to the SmaPri.PrintFormat method.

Default properties and ValueType

There are no default properties. The ValueType specification is invalid.


SmaPriInputItem property

API version 23

Property

iOSAndroidWindows

The following properties are defined in the SmaPriInputItem class.

API | name | access | type | Initial value | explanation
23 | FormatId | CRW | integer |  | Format ID to print
23 | JobName | CRW | String |  | Print job name
23 | PrintNum | CRW | integer | 1 | Number of sheets printed

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


SmaPriInputItem.FormatId property

iOSAndroidWindows

Specifies the format ID to be printed.


SmaPriInputItem.JobName property

iOSAndroidWindows

Specifies the print job name. The specified job name is used in the event object of the Root.SmaPriPrintFinished event.

If blank, it will be the layout name of the layout specified by the FormatId property.


SmaPriInputItem.PrintNum property

iOSAndroidWindows

Specifies the number of copies to print. Default is 1.


SmaPriInputItem method

API version 23

Method

iOSAndroidWindows

The following methods are defined in the SmaPriInputItem class.

API | name | explanation
23 | GetData | Get the configured issue data.
23 | GetVisibility | Get the setting whether or not to print the configured issue data.
23 | RemoveData | Remove the configured issue data.
23 | SetData | Set the issue data.

Class overview

Base class method


SmaPriInputItem.GetData method

iOSAndroidWindows

Explanation

Get print content from preconfigured issue data.

Call format

var data = inputItem.GetData( name );

Return value

A string of the printed content is returned.

argument

String name

Specify the name of the print item.

exception

SMAPRI-11

Print item not found.

Example of use

var item = new SmaPriInputItem[1];
item[0].FormatId = 1;
item[0].PrintNum = 1;
item[0].SetData("Text1", "ABCD");
item[0].SetData("Barcode1", "hello world!");

print("Text1:", item[0].GetData("Text1"), " Visibility:", item[0].GetVisibility()?"Visible":"Invisible", "\n");

Related item

SetData method


SmaPriInputItem.GetVisibility method

iOSAndroidWindows

Explanation

Get whether or not to print the print items of the configured issue data.

Call format

var visiblity = inputItem.GetVisibility( name );

Return value

Returns $TRUE if printing, $FALSE if not printing.

argument

String name

Specify the name of the print item.

exception

SMAPRI-11

Print item not found.

Example of use

var item = new SmaPriInputItem[1];
item[0].FormatId = 1;
item[0].PrintNum = 1;
item[0].SetData("Text1", "ABCD");
item[0].SetData("Barcode1", "hello world!");

print("Text1:", item[0].GetData("Text1"), " Visibility:", item[0].GetVisibility()?"Visible":"Invisible", "\n");

Related item

SetData method


SmaPriInputItem.RemoveData method

iOSAndroidWindows

Explanation

Remove the print content of the specified print item from the configured issue data.

Call format

inputItem.RemoveData( name );

Return value

None

argument

String name

Specify the name of the print item.

exception

None

Example of use

var item = new SmaPriInputItem[1];
item[0].FormatId = 1;
item[0].PrintNum = 1;
item[0].SetData("Text1", "ABCD");
item[0].SetData("Barcode1", "hello world!");

item[0].RemoveData("Text1");

Related item

SetData method


SmaPriInputItem.SetDataメソッド

API version 23

SmaPriInputItem.SetData method

iOSAndroidWindows

Explanation

Set the publication data for printing.

The set publication data is passed to the SmaPri.PrintFormat method to execute printing.

See "SmaPri Package Overview" for detailed instructions.

Call format

inputItem.SetData( name , data [, visibility] );

Return value

なし

argument

String name

Specify the name of the print item.

If a print item name that has already been set is specified, the print content will be overwritten.

String data

Specify the content to be printed.

What should be specified depends on the item. If the item cannot be entered, this argument will be ignored.

boolean visibility

If $TRUE is specified, print items; If $FALSE is specified, it does not print.

exception

None

Example of use

SmaPri sm;

Button btnPrintFormat {
 X = 10;
 Y = 40;
 Width = 50;
 Height = 20;
 Title = "Print format";
 Function OnTouch(e) {
  var item = new SmaPriInputItem[2];
  item[0].FormatId = 1;
  item[0].PrintNum = 1;
  item[0].SetData("Text1", "ABCD");
  item[0].SetData("Barcode1", "hello world!");

  item[1].FormatId = 2;
  item[1].PrintNum = 1;
  item[1].SetData("fixed graphics", "http://192.168.1.15/image/sample.bmp");
  item[1].SetData("switching graphic", "1");

  var extended = new Array();
  extended["print_operation"] = "1,3,3";
  extended["print_offset"] = "50,50";

  ^.sm.PrintFormat(item, extended);
 }
}

Related item

SmaPri.PrintFormat, SmaPri.GetFormatInfo, SmaPri.GetInputItem, SmaPri.GetPrintItem method


SmaPriInputItem event

API version 23

Event

iOSAndroidWindows

There are no events defined in the SmaPriInputItem class.

Class overview

Base class event


SmaPriPrinter class

iOSAndroidWindows

Object
 | SmaPriPrinter

This class is used to connect to SATO printers and acquire printer information.

For an overview of this feature and the procedure to print, please see "SmaPri Package Overview".

Default properties and ValueType

There are no default properties. The ValueType specification is invalid.


SmaPriPrinter property

API version 23

Property

iOSAndroidWindows

The following properties are defined in the SmaPriPrinter class.

API | name | access | type | Initial value | explanation
23 | Address | R | String |  | Printer address
23 | DeviceType | R | integer | -1 | Printer type
23 | IsConnected | R | boolean | false | Whether the printer is connected or not
23 | IsCRCEnabled | R | boolean | false | Whether CRC check is valid or not
23 | Protocol | R | integer | -1 | Communication protocol with printer

access | R | Readable
 | W | Writable
 | C | Initializable

:Default property

Class overview

Base class property


SmaPriPrinter.Address property

iOSAndroidWindows

Indicates the address of the printer.

This property is read-only and cannot be changed.


SmaPriPrinter.DeviceType property

iOSAndroidWindows

Indicates the printer type. It can be one of the following values:

Constant | Value | Explanation
SmaPriPrinter.DeviceTypeNone | -1 | Printer not specified
SmaPriPrinter.DeviceTypeBluetooth | 0 | Printer connected via Bluetooth
SmaPriPrinter.DeviceTypeTcp | 1 | Printers on the network

This property is read-only and cannot be changed.


SmaPriPrinter.IsConnected property

iOSAndroidWindows

Indicates whether the printer is connected or not.

This property is read-only and cannot be changed.


SmaPriPrinter.IsCRCEnabled property

iOSAndroidWindows

Indicates whether CRC check is enabled when sending data to the printer.

This property is read-only and cannot be changed.


SmaPriPrinter.Protocol property

iOSAndroidWindows

Indicates the printer communication protocol (printer model). It can be one of the following values:

Constant | Value | Explanation
SmaPriPrinter.ProtocolStatusNone | -1 | Printer not specified
SmaPriPrinter.ProtocolStatus3 | 0 | Status 3
SmaPriPrinter.ProtocolStatus3Lapin | 1 | Status 3(Lapin)
SmaPriPrinter.ProtocolStatus4 | 2 | Status 4

*Lapin is a registered trademark or trademark of SATO HOLDINGS CORPORATION.

This property is read-only and cannot be changed.


SmaPriPrinter method

API version 23

Method

iOSAndroidWindows

The following methods are defined in the SmaPriPrinter class.

API | name | explanation
23 | Connect | Connect to the printer
23 | Disconnect | Disconnect from the printer
23 | GetStatus | Get printer status
23 | SetPrinter | Specify the printer

Class overview

Base class method


SmaPriPrinter.Connect method

API version 23

SmaPriPrinter.Connect method Change History

iOSAndroidWindows

Explanation

Connects to a designated printer.

The same operation is performed when this method is invoked when a connection is made in the "Printer connection status / Control" menu.

When connecting to a printer via Bluetooth, if "Automatic pairing" in "Printer Settings" is enabled, Bluetooth pairing will be performed when connecting.

When connecting to a printer via TCP, if "Wi-Fi automatic enabling" in "Printer Settings" is enabled, Wi-Fi is turned on when connecting.

If a call to this method connects to the printer or fails to connect, the Root.SmartPrinterConnectionChanged event is generated.

Please refer to the "SmaPri Package Overview" for detailed usage instructions.

Call format

sp.Connect( );

Return value

None

argument

None

exception

RTM-47

Failed to access location information.

RTM-84

The use of Bluetooth is not allowed.Please allow the use of Bluetooth in your OS settings. *1

SMAPRI-1

The printer is not set.

SMAPRI-4

Failed to connect to the printer.

SMAPRI-12

Failed to bond with device.

Example of use

SmaPriPrinter sp;

Button btnSetPrinter {
 X = 10;
 Y = 10;
 Width = 50;
 Height = 20;
 Title = "SetPrinter";
 Function OnTouch(e) {
  ^.sp.SetPrinter(SmaPriPrinter.DeviceTypeTcp, "192.168.1.15", SmaPriPrinter.ProtocolStatus4, false);
 }
}

Button btnConnect {
 X = 70;
 Y = 10;
 Width = 50;
 Height = 20;
 Title = "Connect to Printer";
 Function OnTouch(e) {
  ^.sp.Connect();
 }
}

Related item

SetPrinter, Disconnect method

Change History
*1　The specification has been changed since API version 26.


SmaPriPrinter.Disconnect method

iOSAndroidWindows

Explanation

Disconnect from the printer.

When the connection is disconnected in the "Printer connection status / Control" menu, the same operation is performed as when this method is invoked.

If the connection state with the printer changes due to a call to this method, the Root.SmaprinterConnectionChanged event is generated.

Call format

sp.Disconnect( );

Return value

None

argument

None

exception

SMAPRI-1

The printer is not set.

Example of use

Button btnConnect {
 X = 70;
 Y = 10;
 Width = 50;
 Height = 20;
 Title = "Connect to Printer";
 Function OnTouch(e) {
  ^.sp.Connect();
 }
}

Button btnDisconnect {
 X = 130;
 Y = 10;
 Width = 50;
 Height = 20;
 Title = "Disconnect printer";
 Function OnTouch(e) {
  ^.sp.Disconnect();
 }
}

Related item

SetPrinter、Connect method


SmaPriPrinter.GetStatus method

iOSAndroidWindows

Explanation

Get printer status.

Call format

var status = sp.GetStatus( );

Return value

A Record with the following child objects is returned:

Type | Name | Explanation
Number | StatusCode | Printer status code
Number | StatusType | Type of status; 0 for Standard and 1 for Lapin.

*Lapin is a registered trademark or trademark of SATO HOLDINGS CORPORATION.

argument

None

exception

SMAPRI-1

The printer is not set.

Example of use

var status = sp.GetStatus();
print("Status code:", status.StatusCode.ToString(16), "\n");

Related item


SmaPriPrinter.SetPrinter method

iOSAndroidWindows

Explanation

Specify the printer to print to. The specified printer information is saved and will be valid for the next startup.

Printer information specified by this method is also reflected in the "Printer Settings".

Also, when a printer is specified in "Printer Settings", the same operation is performed as when this method is called.

See "SmaPri Package Overview" for detailed usage instructions.

Call format

sp.SetPrinter(type, address [ ,protocol [, isCrc]] );

Return value

None

argument

integer type

Printer Type. One of the following values:

Constant | Value | Explanation
SmaPriPrinter.DeviceTypeNone | -1 | Do not change from the printer type that has already been set
SmaPriPrinter.DeviceTypeBluetooth | 0 | Printer connected via Bluetooth Specify the BD address as address.
SmaPriPrinter.DeviceTypeTcp | 1 | Printers on the network Specify the IP address (IPv4) as address.

String address

Printer address

If an empty string is specified, the address is not changed from the one already set.

If type is other than SmaPriPrinter.DeviceTypeNone and the address is left blank, a FUNC-4 exception is raised.

When specifying an IP address, if the port number is omitted, the value of "TCP Port" in "Printer Settings" is used.(The default for "TCP port" is 9100).

If a port number is specified along with the IP address, it will be reflected in the "TCP port".

integer protocol

Printer model (communication protocol)

One of the following values:

Constant | Value | Explanation
SmaPriPrinter.ProtocolStatus3 | 0 | Status 3
SmaPriPrinter.ProtocolStatus3Lapin | 1 | Status 3(Lapin)
SmaPriPrinter.ProtocolStatus4 | 2 | Status 4

※Lapin is a registered trademark or trademark of SATO HOLDINGS CORPORATION.

If omitted, the value of "Printer model" in "Printer Settings" is used (the default for "Printer model" is SmaPriPrinter.ProtocolStatus4).

The communication protocol must match that of the printer.

boolean isCrc

Specifies whether or not a CRC check is performed when sending data.

If omitted, the value of "Enable CRC" in "Printer Settings" is used (the default for "Enable CRC" is $FALSE).

If the CRC check is enabled, if the print data is damaged due to a communication error, the damaged data will not be printed. However, the printing speed will be slower.

This setting must be the same as the printer's CRC check function. Please refer to the printer manual for how to set up the printer.

exception

FUNC-4

Wrong argument value

SMAPRI-1

The printer is not set.

SMAPRI-3

Failed to set up the printer.

Example of use

SmaPriPrinter sp;

Button btnSetPrinter {
 X = 10;
 Y = 10;
 Width = 50;
 Height = 20;
 Title = "SetPrinter";
 Function OnTouch(e) {
  ^.sp.SetPrinter(SmaPriPrinter.DeviceTypeTcp, "192.168.1.15", SmaPriPrinter.ProtocolStatus4, false);
 }
}

Button btnConnect {
 X = 70;
 Y = 10;
 Width = 50;
 Height = 20;
 Title = "Connect to Printer";
 Function OnTouch(e) {
  ^.sp.Connect();
 }
}

Related item

Connect method


SmaPriPrinter event

API version 23

Event

iOSAndroidWindows

There are no events defined in the SmaPriPrinter class.

Class overview

Base class event


OCR package

A package for handling character recognition functions.

Class

API | name | explanation
27 | TextRecognizer | A class for recognizing text in an input image.


TextRecognizer class

iOSAndroidWindows

Object
 | TextRecognizer

A class that recognizes the text in the input image and outputs it as string information.

There are two types of character string languages that can be recognized: English and Japanese.


TextRecognizer property

API version 27

Property

iOSAndroidWindows

The TextRecognizer class defines the following properties.

API | name | access | Type | initial value | Explanation
27 | Lang | R | integer |  |

access | R | Readable
 | W | Writable
 | C | Initializable

Class overview

Base class properties


TextRecognizer.Lang property

iOSAndroidWindows

Indicates the language to recognize, as specified in the constructor.


TextRecognizer method

API version 27

メソッド

iOSAndroidWindows

The following methods are defined in the TextRecognizer class.

API | name | overview
27 | (Constructor) | Initialize the TextRecognizer object
27 | Process | Recognize text in images and get string information

Class overview

Base class properties


TextRecognizer constructor

iOSAndroidWindows

Explanation

Initialize the TextRecognizer class.

Call format

var recognizer = new TextRecognizer([lang])

Return value

TextRecognizer object

argument

integer lang

Specify the language to be recognized from the following:

name | value | explanation
$EN | 1033 | English
$JA | 1041 | Japanese

If omitted, $EN will be used.

exception

None

Example of use

var recognizer = new TextRecognizer();
var texts = recognizer.Process();

Related item


TextRecognizer.Process method

iOSAndroidWindows

Explanation

Recognizes text in an input image and returns string information.

Call format

var texts = recognizer.Process(img)

Return value

The string information of the recognition result is returned in the following Record.

Type | Name | Explanation
String | Text | Whole text
Array | Blocks | Text block information

The information of the text block will be an array of the following Records.

Type | Name | Explanation
String | Text | Text for the entire text block
integer | X | X coordinate of the upper left corner of the textblock (position of the textblock within the image) The top left of the image indicated by img is (0,0).
integer | Y | Y coordinate of the upper left corner of the text block
integer | Width | Width of the text block
integer | Height | Text block height
Array | Langs | Language in text block An array of strings indicating language codes
Array | Lines | Text information per line

The text information for each line will be an array of the following Records.

Type | Name | Explanation
String | Text | One line of text
integer | X | X coordinate of top left corner of one line of text (position of text in image) The top left of the image indicated by img is (0,0).
integer | Y | Y coordinate of top left corner of one line of text
integer | Width | Width of one line of text
integer | Height | The height of one line of text
Array | Langs | Language in text An array of strings indicating language codes.

The relationship between the entire text, text blocks, and text per line is shown in the figure below.

argument

Image img

The Image object of the image for character recognition.

exception

OCR-1

Illegal argument

OCR-2

Failed to recognize text

Example of use

var recognizer = new TextRecognizer();
var texts = recognizer.Process();
print(texts.text);

Related item


TextRecognizer event

API version 27

Event

iOSAndroidWindows

There are no events defined in the TextRecognizer class.

Class overview

Base class events


Platform specific package

This chapter describes in detail how to take advantage of the packages and classes implemented specifically for each platform.

Android specific package

name | Explanation
ExternalObject | A package for linking with external libraries


ExternalObject Package (Android)

It is a package for linking with an external library.

In cooperation with the Android standard library, a class for generating and executing Java external objects and a class for issuing an intent to other Android applications are prepared.

class

PKG | name | Explanation
1 | ExternalObject (For Java linkage) | Holds Java objects
1 | ExtVal (For Java linkage) | Class for matching Java data types
1 | Intent | It is a class for issuing intent to other applications
HT (10) | ExternalService | It is a class for linking with Android services made for Biz/Browser SmartDevice and Biz/Browser HT.

Security level

Use of the ExternalObject package is restricted by security level . The ExternalObject package is available by setting the security level to 0.

At security level 1 and above, an exception occurs when you try to instantiate a class in the ExternalObject package.

Data type conversion between CRS and Java

When you pass a value from CRS to a Java object, and vice versa, when you receive a result from a Java object, it is automatically converted to the data type of each language.

The conversion rules are as follows.

Value conversion rule from CRS to Java

It is a rule that is applied when passing arguments and setting fields

◇ If you pass ExtVal

Source (CRS) | Destination (Java)
ExtVal.Boolean | boolean type (primitive type)
ExtVal.Char | char type (primitive type, 2-byte signed integer, for character representation)
ExtVal.Byte | byte type (primitive type, 1-byte signed integer)
ExtVal.Short | short type (primitive type, 2-byte signed integer)
ExtVal.Int | int type (primitive type, 4-byte signed integer)
ExtVal.Long | long type (primitive type, 8-byte signed integer)
ExtVal.Float | float type (primitive type, 4byte single precision floating point number)
ExtVal.Double | double type (primitive type, 8-byte double-precision floating-point number)

◇ When passing a CRS object

Source (CRS) | Destination (Java)
Number | Int type for integer values Interpret as double type when keeping values below the decimal point
Date | java.util.Date class
String | java.lang.String class
ByteArray | byte[] type
ExternalObject | The class of the stored instance
Other (including null) | Exception occurred (type cannot be resolved)

Value conversion rule from Java to CRS

This is the rule that is applied when returning from a method return value or field.

◇ When receiving a primitive type

Source (Java) | Convert to (CRS)
boolean type | 1 if true, 0 if false
char type | Integer value
byte type | Integer value
short type | Integer value
int type | Integer value
long type | Integer value (It will be truncated to a range that can represent a 4-byte signed integer)
float type | Number object
double type | Number object

◇ If you receive a reference type

Source (Java) | Convert to (CRS)
null value (regardless of type) | null value
java.lang.String | A String object
byte[] | A ByteArray object
Other objects | ExternalObject object

Primitive types and boxing

Types in the Java language are broadly divided into "primitive types" and "reference types".

In the Java linkage function of the ExternalObject package, the ExtVal class wraps the primitive type and the ExternalObject class wraps the reference type.

In the Java language, converting a primitive type to a reference type that inherits from Object is called "boxing".

For example, the process of converting an int type value to an instance of the java.lang.Integer class is equivalent.

Also, converting a reference type to a primitive type is called "unboxing".

As an example, the process of converting an instance of the java.lang.Double class to a double type value is equivalent.

Boxing and unboxing are normally done automatically by the Java compiler, but if you use the ExternalObject Java linkage, you need to do it explicitly.

In CRS, use the ExtVal.Boxing method for boxing and the ExternalObject.Unboxing method for unboxing .

The correspondence between Java primitive types and their corresponding Java reference types is shown below.

Correspondence between primitive type and reference type in boxing and unboxing

ExtVal.Type value | ExtVal.Type shows Primitive type | Corresponding Java reference type
ExtVal.Boolean | boolean type | java.lang.Boolean class
ExtVal.Char | char type | java.lang.Character class
ExtVal.Byte | byte type | java.lang.Byte class
ExtVal.Short | short type | java.lang.Short class
ExtVal.Int | int type | java.lang.Integer class
ExtVal.Long | long type | java.lang.Long class
ExtVal.Float | float type | java.lang.Float class
ExtVal.Double | double type | java.lang.Double class

Loading an external Jar file

The ExternalObject package allows you to load an external Jar file using the ExternalObject.LoadJar method.

The library ID specified at this time is a value for managing the class loader that holds the class information in the loaded Jar file. Specifies a non-null non-null string that is not covered by other libraries.

Use the ExternalObject.IsLibraryIdUsed method to find out if the library ID is being used .

Since the Android Dalvik virtual machine cannot execute the jar file for PC (general Java) as it is, it is necessary to convert the created jar file into a format that can be interpreted by Android using the tool (dx command) attached to the Android SDK. There is.

By specifying the same library ID as when loading the class when specifying the class with the ExternalObject constructor or the ExternalObject.InvokeStatic method, the class information is read from the class loader.

If the class and interface have the same class name (fully qualified name) but different library IDs, they are treated as different types.

The class (java.lang.String and android.graphics.Point) which Android originally loaded is the system class loader.

I am managing. When using these classes, please specify null for the library ID.

About restrictions due to permissions as an Android application

Biz/Browser HT, like other popular Android apps, requires what is called a permission from the Android OS in order to achieve its functionality.

Permissions clearly indicate what functions the Android app may access, and a list will be displayed when the Android app is installed.

The Android OS prohibits Android apps from accessing functions other than the requested permissions.

Therefore, when using the Android standard library or the library provided in the form of Jar file by using ExternalObject class, it is necessary that the processing is possible within the range of the permissions granted to Biz/Browser AI.

Please check the required permissions before using the library.

The permissions that Biz/Browser HT requests for Android OS are described in Features and restrictions of Android version .

How to specify arguments

What can be specified as the argument of the constructor and method of the Java class includes general CRS, literals, ExternalObject objects, and ExtVal objects.

The argument is passed to Java primitive type or Java reference type according to the rules of type conversion between CRS and Java .

Example)

Specify a literal literal

var extobj = new ExternalObject("java.util.Random", null, 999);
var ret = extobj.Invoke("nextInt", 100);
print(ret, "\n");

Specify a string type variable

var str = "TMP";
var ret = ExternalObject.InvokeStatic("java.lang.System", null, "getenv", str);
print(ret, "\n");

Specify Java primitive type using ExtVal class

var v = new ExtVal(true, ExtVal.Boolean);
var ret = ExternalObject.InvokeStatic("java.lang.Boolean", null, "toString", v);
print(ret, "\n");

Specify Java reference type using ExternalObject class

var v1 = new ExternalObject("android.graphics.Point", null, 10, 20);
var v2 = new ExternalObject("android.graphics.Point", null, 30, 40);
var ret = v1.Invoke("equals", v2);
print(ret, "\n");

Specify the Java reference type whose type has been converted using the ExternalObject.Cast method

var extobj1 = new ExternalObject("java.io.FileOutputStream", null, "/sdcard/test.txt");
var extobj2 = new ExternalObject("java.io.BufferedOutputStream", null, extobj1.Cast ("java.io.OutputStream"));
/ *… * /
extobj2.Invoke("close");
extobj1.Invoke("close");

Specifying any other CRS object or reference that cannot be converted to a value will result in an error.

When calling a constructor or method, the type of all arguments defined in the callee must be exactly the same. (Including the difference between reference type and value type)

For reference types, you must explicitly convert the ExternalObject.Cast method to a reference to the calling base class if you pass a derived class of the requested class.

Also, when specifying a null value, it is necessary to create a null reference with type information using the ExternalObject.NullRef method.

For primitive types, implicit widening conversion and narrowing conversion are not performed.Use the ExtVal object to specify the explicitly requested type.

You must explicitly do boxing and unboxing reference types. Please refer to Primitive and Boxing for boxing and unboxing .

If the class name, method name, and all argument types do not match, the callee cannot be found and an error occurs.

User exception occurred

The ExternalObject.Invoke method or the ExternalObject.InvokeStatic method can catch the exception that occurred on the Java class side.

If you throw an exception in the method of interest, Biz/Browser will throw an EXTOBJ-4 exception indicating that the Invoke and InvokeStatic failed.

A child object ExtException is added to the CRS exception object. ExtException is an ExternalObject object that holds the exception thrown on the Java side.

With this mechanism, you can access the Java exception class from CRS and acquire the information.

Example) Catch an exception

try{
    var extobj = ExternalObject.InvokeStatic("sampleNS.SampleClass", "sampleLib");
    extobj.Invoke("SampleMethod");
}catch(e){
    if(e.Method == "EXTOBJ" && e.Code == 4) {
        MessageBox(e.ExtException.Invoke("toString"));
    }
}

In addition to the EXTOBJ-4 exception, ExtException may be added as a child object of the EXTOBJ exception object.

To determine ExtException is added Object.FindChild use.

External Object (Java linkage) architecture

Biz/Browser HT runs on Dalvik virtual machine or ART (some native code) as well as general Android applications.

Therefore, the Java linkage function of ExternalObject operates Java objects by using reflection, which is a part of Java functions.

Java objects are created in the same memory space as Biz/Browser.

Therefore, if you allocate a large amount of memory in the Java object, Biz/Browser itself may stop due to insufficient memory.

Also, to protect the operation of Biz/Browser, operations on objects in the jp.co.opst.bizsd namespace are prohibited.

If you operate on an object in this namespace, you will get an EXTOBJ-11 exception.

Execution log output

The Java linkage function has a log output function as a debug function.

If you place a file named ".logging.on" (please note the dot at the beginning of the file name) in the "/sdcard/Android/data/jp.co.opst.bizht.v1/files" folder, Biz/Browser will Output the execution log file named "ExternalObject.log" to the same directory. The ".logging.on" file can be 0 bytes as long as there is a file.


ExternalObject class (Java linkage)

Android

Object
 | ExternalObject

A class that holds Java objects.

It provides a one-to-one correspondence with Java objects, provides the creation and destruction of Java instances, and provides access to Java properties and methods.

In addition to creating Java objects by CRS programs, it is also used for Java objects returned as the result of calling Java methods.

It is also possible to use an ExternalObject object as an argument when calling a method of the ExternalObject class.

Default property and ValueType

There are no default properties. The ValueType specification is invalid.

Security level

In Biz / Browser HT, the usage of ExternalObject package is restricted by security level . The ExternalObject package is available by setting the security level to 0.

At security level 1 and above, an exception occurs when you try to instantiate the ExternalObject class.


ExternalObject class (Java linkage) property

Package version 1

Property

Android

The following properties are defined in the ExternalObject class (Java linkage).

PKG | name | access | Type | Explanation
1 | Type | R | String | Gets the fully qualified name of the Java class
1 | IsJavaArray | R | boolean | Gets whether it is a Java array object
1 | JavaArrayLength | R | integer | Gets the length of a Java array object
1 | IsNullRef | R | boolean | Gets whether the object is a null reference

access | R | Readable
 | W | Writable
 | C | initialized

Class overview

Base class properties


ExternalObject.Type property (Java linkage)

Android

Holds the fully qualified name of the Java object class that ExternalObject holds.

You can refer to the class name specified in the constructor or cast method.

This property is read-only.


ExternalObject.IsJavaArray property(Java linkage)

Android

If the Java object held by ExternalObject is an array object, $TRUE is set, otherwise $FALSE is set.

This property is read-only.


ExternalObject.IsNullRef property (Java linkage)

Android

Set to $TRUE if the object is a null reference, $FALSE otherwise.

This property is read-only.


ExternalObject.JavaArrayLength property(Java linkage)

Android

If the Java object held by ExternalObject is an array object, the number of elements in that array is set.

If it is not an array object, 0 is set.

This property is read-only.


ExternalObject class (Java linkage) method

Package version 1

Method

Android

The following methods are defined in the ExternalObject class (Java linkage).

PKG | name | Explanation
1 | ( Constructor ) | Creates a Java object
1 | GetProperty | Gets the value of a field in a Java object
1 | Invoke | Invokes a method on a Java object
1 | SetProperty | Set values ​​in fields of Java object
1 | GetAt | Get value from java array
1 | SetAt | Populate a Java array
1 | Cast | Gets the value of a Java object cast to another reference type
1 | IsInstanceOf | Gets whether the Java object is an instance of the specified class
1 | Unboxing | Gets the unboxed value of the reference type

Static method

PKG | name | Explanation
24 | GetClassForName | Gets a Java class object (java.lang.Class) from a class name
1 | GetPropStatic | Gets the value of a static field in a Java class
1 | InvokeStatic | Call a static method of a Java class
1 | SetPropStatic | Set the value to the static field of Java class
1 | LoadJar | Load an external Jar file
1 | IsLibraryIdUsed | Gets whether the specified library ID is used
1 | NullRef | creates an ExternalObject instance with a null reference
1 | GetCurrentContext | Gets the context of the activity where Biz/Browser is running
1 | GetMessageHandler | Required to publish ExternalMessage event Get the message handler.

Class overview

Base class methods


ExternalObject constructor (Java linkage)

Android

Explanation

Generate a Java object.

Call format

var extobj = new ExternalObject( className [, libraryId [, param1 [, ...]]])

Return value

ExternalObject object

argument

String className

Java class name to be generated

Describe with a fully qualified name including the namespace. It is case sensitive.

When creating an array object, add the character string "[]" to the end of the type name for the number of dimensions of the array.

String libraryId

Library in which Java class is defined

See Loading External Jar Files for more information.

Object param1 ... n

Constructor arguments

When creating something other than an array object

For details , refer to How to specify arguments .

When creating an array object

Specify an integer value for the number of elements in each dimension as many as 0 or more and less than or equal to the dimension of the array.

exception

EXTOBJ-1

Could not find constructor for class %s

EXTOBJ-2

Call to constructor %s failed

EXTOBJ-8

Could not find class %s

EXTOBJ-10

Unsupported data type

EXTOBJ-11

Object in %s namespace cannot be manipulated

EXTOBJ-14

The array has too many dimensions.

EXTOBJ-15

Jar file with ID “%s” is not loaded

CRS-407

Class 'ExternalObject' is not available at the current security level

Example of use

var extobj1 = new ExternalObject("android.graphics.Rect");
extobj1.Invoke("set", 0, 0, 20, 30);
var ret = extobj1.Invoke("toString");
print(ret, "\n");

var extobj2 = new ExternalObject("int[][]", 2, 3);
print(extobj2.JavaArrayLength, "\n");
print(extobj2.GetAt(0).JavaArraylength, "\n");

ExternalObject.LoadJar("sampleLib", "sampleLib.jar");
var extobj3 = new ExternalObject("sampleNS.SampleClass", "sampleLib", "test");
extobj3.SetProperty("SampleProp", new ExtVal(true, ExtVal.Boolean));
var ret = extobj3.Invoke("SampleMethod", 123);
print(ret, "\n");

Related item

ExtVal class


ExternalObject.GetProperty method (Java linkage)

Android

Explanation

Gets the value of a field in a Java object.

Call format

var ret = extobj.GetProperty( fieldName )

Return value

Java class field value

argument

String fieldName

Field name

It is case sensitive.

exception

EXTOBJ-5

Could not find field %s

EXTOBJ-6

Failed to get field %s

EXTOBJ-9

Operation for null reference

Example of use

var extobj1 = new ExternalObject("android.graphics.Point", null, 10, 20);
print(extobj1.GetProperty("x"), "\n");
print(extobj1.GetProperty("y"), "\n");

var extobj2 = new ExternalObject("sampleNS.SampleClass", "sampleLib");
print(extobj2.GetProperty("SampleProp"), "\n");

Related item

ExtVal class

SetProperty , GetPropStatic method


ExternalObject.Invoke method (Java linkage)

Android

Explanation

Invokes a method on a Java object.

Call format

var ret = extobj.Invoke( methodName [, param1 [, ...]])

Return value

Return value of Java class method

argument

String methodName

Method name

It is case sensitive.

Object param1 ... n

Method arguments

For details , refer to How to specify arguments .

exception

EXTOBJ-3

Could not find method %s

EXTOBJ-4

Call to method %s failed

EXTOBJ-8

Could not find class %s

EXTOBJ-9

Operation for null reference

EXTOBJ-10

Unsupported data type

EXTOBJ-11

Object in %s namespace cannot be manipulated

EXTOBJ-15

Jar file with ID “%s” is not loaded

Example of use

var extobj1 = new ExternalObject("java.util.Random");
var ret = extobj1.Invoke("nextInt", 10);
print(ret, "\n");

var extobj2 = ExternalObject.InvokeStatic("java.util.Calendar", null, "getInstance");
var ret = extobj2.Invoke("toString");
print(ret, "\n");

var extobj3 = new ExternalObject("sampleNS.SampleClass", "sampleLib");
var ret = extobj3.Invoke("sampleFunction");
print(ret, "\n");

Related item

ExtVal class

InvokeStatic method


ExternalObject.SetProperty method (Java linkage)

Android

Explanation

Set values ​​in the fields of the Java object.

Call format

var ret = extobj.SetProperty( fieldName, value )

Return value

None

argument

String fieldName

Field name

It is case sensitive.

Object value

Value to set in the field

exception

EXTOBJ-5

Could not find field %s

EXTOBJ-7

Failed to set field %s

EXTOBJ-9

Operation for null reference

EXTOBJ-10

Unsupported data type

Example of use

var extobj1 = new ExternalObject("android.graphics.Point");
extobj1.SetProperty("x", 10);
extobj1.SetProperty("y", 20);
print(extobj1.Invoke("toString"));

var extobj2 = new ExternalObject("sampleNS.SampleClass", "sampleLib");
extobj2.SetProperty("SampleProp", new ExtVal(true, ExtVal.Boolean));

Related item

ExtVal class

GetProperty , SetPropStatic method


ExternalObject.GetAt method (Java linkage)

Android

Explanation

Gets the value of an element of a Java array object.

Call format

var ret = extobj.GetAt( Index )

Return value

Value of element of Java array object

argument

integer Index

Specifies the array index

exception

EXTOBJ-9

Operation for null reference

EXTOBJ-18

Array operation for objects that are not arrays

EXTOBJ-19

Failed to get element number% d

Example of use

var extobj1 = new ExternalObject("java.lang.String", null, "1,2,3");
var extobj2 = extobj1.Invoke("split", ",");
print(extobj2.GetAt(0), "\n");
print(extobj2.GetAt(1), "\n");
print(extobj2.GetAt(2), "\n");

Related item

ExtVal class

GetProperty , GetPropStatic method


ExternalObject.SetAt method (Java linkage)

Android

Explanation

Sets the value of an element of a Java array object.

Call format

var ret = extobj.SetAt( index, value )

Return value

None

argument

integer index

Specifies the array index

Object value

Value to be set in array element

exception

EXTOBJ-9

Operation for null reference

EXTOBJ-10

Unsupported data type

EXTOBJ-18

Array operation for objects that are not arrays

EXTOBJ-20

Failed to set element number %d

Example of use

var extobj1 = new ExternalObject("int[]", null, 3);
extobj1.SetAt(0, 0x0010);
extobj1.SetAt(1, 0x0020);
extobj1.SetAt(2, 0x0030);

var extobj2 = new ExternalObject("java.lang.Object[][]", 2);
extobj2.GetAt(0).SetAt(new ExternalObject("java.lang.Object[]", 4);

Related item

ExtVal class

SetProperty , SetPropStatic method


ExternalObject.Cast method (Java linkage)

Android

Explanation

Gets a value that is a reference to a Java object cast to another type.

The ExternalObject object created by the cast references the same Java object pointed to by the calling ExterernalObject.

Call format

var ret = extobj.Cast( className [, libraryId ] )

Return value

ExternalObject object that contains a reference to the Java object after casting

(The class name specified in the argument className is set in the Type property of the return value .)

argument

String className

Cast destination class name

Describe with a fully qualified name including the namespace. It is case sensitive.

String libraryId

Library in which Java class is defined

See Loading External Jar Files for more information.

exception

EXTOBJ-12

Cannot cast from% s type to %s type

EXTOBJ-13

Cannot get class information

EXTOBJ-15

Jar file with ID “%s” is not loaded

Example of use

var extobj1 = new ExternalObject("java.io.FileOutputStream", null, "/sdcard/test.txt");
var extobj2 = new ExternalObject("java.io.BufferedOutputStream", null, extobj.Cast("java.io.OutputStream"));
/ *… * /
extobj2.Invoke("close");
extobj1.Invoke("close");

Related item

Type Property


ExternalObject.IsInstanceOf method (Java linkage)

Android

Explanation

Gets whether the Java object is an instance of the specified class.

If you call this method for an ExternalObject object that has a null reference, it will always return true.

Call format

var ret = extobj.IsInstanceOf(className [, libraryId ] )

Return value

True if the Java object is an instance of the specified class, false otherwise

argument

String className

Java class name

Describe with a fully qualified name including the namespace. It is case sensitive.

String libraryId

Library in which Java class is defined

See Loading External Jar Files for more information.

exception

EXTOBJ-13

Cannot get class information

EXTOBJ-15

Jar file with ID “%s” is not loaded

Example of use

var extobj1 = ExternalObject.GetCurrentContext();
if(extobj1.IsInstanceOf("android.app.Activity")){
  var extobj2 = extobj1.cast("android.app.Activity");
  / *… * /
}

Related item

Cast method


ExtertnalObject.Unboxing method (Java linkage)

Android

Explanation

Unboxes the Java reference type that the ExternalObject class represents.

For unboxing , refer to Primitive type and boxing .

Call format

extobj.Unboxing()

Return value

The unboxed value is returned as an ExtVal object.

argument

None

exception

EXTOBJ-10

Unsupported data type

Example of use

var extobj = ExternalObject.InvokeStatic("java.lang.Short", null, "parse", "123");
var val = extobj.Unboxing();
/* ExtVal object holding a short type value is stored in val */

Related item


ExternalObject.GetClassForName method (Java linkage)

Android

Explanation

Gets a Java class object (java.lang.Class) from a class name.

Call format

var clsobj = ExternalObject.GetClassForName( className [, libraryId] )

Return value

ExternalObject object containing a java.lang.Class object of the class specified by className

argument

String className

Java class name

Describe with a fully qualified name including the namespace. It is case sensitive.

String libraryId

Library in which Java class is defined

See Loading an External Jar File for more information.

exception

EXTOBJ-8

Class "%s" is not found.

Example of use

ExternalObject.LoadJar("sampleLib", "sampleLib.jar");
var clsObj = ExternalObject.GetClassForName("sampleNS.SampleClass", "sampleLib");
var clsName = clsObj.Invoke("getName");
print("Class Name:", clsName);

Related item

LoadJar method


ExternalObject.GetPropStatic method (Java linkage)

Android

Explanation

Gets the value of the static field of Java class. No Java class instance is created.

This method is a static method. Can be called without creating an object.

Call format

var ret = ExternalObject.GetPropStatic(className, libraryId, fieldName)

Return value

Java class field value

argument

String className

Java class name in which the field is defined

Describe with a fully qualified name including the namespace. It is case sensitive.

String libraryId

Library in which Java class is defined

See Loading External Jar Files for more information.

String fieldName

Field name

It is case sensitive.

exception

EXTOBJ-5

Could not find field %s

EXTOBJ-6

Failed to get field %s

EXTOBJ-8

Could not find class %s

EXTOBJ-9

Operation for null reference

EXTOBJ-11

Object in %s namespace cannot be manipulated

EXTOBJ-15

Jar file with ID “%s” is not loaded

Example of use

var ret1 = ExternalObject.GetPropStatic("android.os.Build $VERSION", null, "SDK_INT");
print("SDK VERSION=", ret1, "\n");

print(ExternalObject.GetPropStatic("sampleNS.SampleClass", "sampleLib", "SampleSProp"), "\n");

Related item

ExtVal class

SetPropStatic , GetProperty method


ExternalObject.InvokeStatic method (Java linkage)

Android

Explanation

Invokes a static method on a Java class. No Java class instance is created.

This method is a static method. Can be called without creating an object.

Call format

var ret = ExternalObject.InvokeStatic( className, libraryId, methodName [, param1 [, ...]])

Return value

Return value of Java class method

argument

String className

Java class name in which the method is defined

Describe with a fully qualified name including the namespace. It is case sensitive.

String libraryId

Library in which Java class is defined

See Loading External Jar Files for more information.

String methodName

Method name

It is case sensitive.

Object param1 ... n

Method arguments

For details , refer to How to specify arguments .

exception

EXTOBJ-3

Could not find method %s

EXTOBJ-4

Call to method %s failed

EXTOBJ-8

Could not find class %s

EXTOBJ-10

Unsupported data type

EXTOBJ-11

Object in% s namespace cannot be manipulated

EXTOBJ-15

Jar file with ID “%s” is not loaded

Example of use

var ret = ExternalObject.InvokeStatic("java.lang.Math", null, "pow", 2.5, 0.5);
print(ret, "\n");

var ret = ExternalObject.InvokeStatic("sampleNS.SampleClass", "sampleLib", "SampleSMethod", 123);
print(ret, "\n");

Related item

ExtVal class

Invoke method


ExternalObject.SetPropStatic method (Java linkage)

Android

Explanation

Set the value in the static field of the Java class. No Java class instance is created.

This method is a static method. Can be called without creating an object.

Call format

ExternalObject.SetPropStatic( className , libraryId , fieldName , value ).

Return value

None

argument

String className

Java class name in which the field is defined

Describe with a fully qualified name including the namespace. It is case sensitive.

String libraryId

Library in which Java class is defined

See Loading External Jar Files for more information.

String fieldName

Field name

It is case sensitive.

Object value

Value to set in the field

exception

EXTOBJ-5

Could not find field %s

EXTOBJ-7

Failed to set field %s

EXTOBJ-8

Could not find class %s

EXTOBJ-10

Unsupported data type

EXTOBJ-11

Object in %s namespace cannot be manipulated

EXTOBJ-15

Jar file with ID “%s” is not loaded

Example of use

ExternalObject.SetPropStatic("sampleNS.SampleClass", "sampleLib", "SampleSProp", new ExtVal(true, ExtVal.Boolean));

Related item

ExtVal class

GetPropStatic , SetProperty method


ExtertnalObject.LoadJar method (Java linkage)

Android

Explanation

Load the external Jar file.

See Loading an External Jar File for more information.

Call format

extobj.LoadJar( libraryId , URL [, parentLibraryId ])

Return value

None

argument

String libraryId

Library in which Java class is defined

See Loading an External Jar File for more information.

String URL

URL to get the Jar file

It is the same as the URL of the NetObject.Get method .

String parentLibraryId

Specify the already loaded Jar file referenced by the Jar file by library ID.

If unspecified or an empty string is specified, the system class loader (operation as before) is used.

If you specify a library ID that does not exist, an EXTOBJ-15 exception is thrown.

exception

EXTOBJ-15

Jar file with ID “%s” is not loaded

EXTOBJ-16

Jar file with ID “%s” is already loaded

Example of use

if(! ExternalObject.IsLibraryIdUsed("sampleLib")){
  ExternalObject.LoadJar("sampleLib", "sampleLib.jar");
}
var ret = ExternalObject.InvokeStatic("sampleNS.SampleClass", "sampleLib", "SampleSMethod", 123);
print(ret, "\n");

Related item

IsLibraryIdUsed , NetObject.Get method


ExtertnalObject.IsLibraryIdUsed method (Java linkage)

Android

Explanation

Gets whether the specified library ID is used.

See Loading an External Jar File for more information.

Call format

var ret = extobj.IsLibraryIdUsed( libraryId )

Return value

Returns $TRUE if the library ID is used, $FALSE otherwise.

argument

String libraryId

Library in which Java class is defined

See Loading an External Jar File for more information.

exception

None

Example of use

if(!ExternalObject.IsLibraryIdUsed("sampleLib")){
  ExternalObject.LoadJar("sampleLib", "sampleLib.jar");
}
var ret = ExternalObject.InvokeStatic("sampleNS.SampleClass", "sampleLib", "SampleSMethod", 123);
print(ret, "\n");

Related item

LoadJar method


ExternalObject.NullRef method (Java linkage)

Android

Explanation

Create an ExternalObject instance with a null reference.

Call format

var extobj = ExternalObject.NullRef( className [, libraryId ])

Return value

ExternalObject object

argument

String className

Java class name to be generated

Describe with a fully qualified name including the namespace. It is case sensitive.

When creating an array object, add the character string "[]" to the end of the type name for the number of dimensions of the array.

String libraryId

Library in which Java class is defined

See Loading External Jar Files for more information.

exception

EXTOBJ-8

Could not find classv%s

EXTOBJ-15

Jar file with ID “%s” is not loaded

CRS-407

Class 'ExternalObject' is not available at the current security level

Example of use

var extobj1 = new ExternalObject("java.lang.Object []", 2);
extobj1.SetAt(0, ExternalObject.NullRef("java.lang.Object"));

ExternalObject.LoadJar("sampleLib", "sampleLib.jar");
var extobj2 = new ExternalObject("sampleNS.SampleClass", "sampleLib", "test");
extobj2.SetProperty("SampleProp", ExternalObject.NullRef("sampleLib", "sampleNS.SampleClass2"));
print(ret, "\n");

Related item

ExtVal class


ExternalObject.GetCurrentContext method (Java linkage)

Android

Explanation

Acquires the context of the activity where Biz/Browser HT is operating.

The value of the Type property of the return value will be "android.content.Context".

For details on the android.content.Context class, please refer to the reference manual of Android Developers (site for Android developers).

Call format

var extobj = ExternalObject.GetCurrentContext()

Return value

ExternalObject object that contains the context of the activity

argument

None

exception

CRS-407

Class 'ExternalObject' is not available at the current security level

Example of use

var i = new ExternalObject("android.content.Intent", null);
i.Invoke("setAction", "android.intent.action.VIEW");
i.Invoke("setData", ExternalObject.InvokeStatic("android.net.Uri", null, "parse", "http://biz-browser.jp"));

var context = ExternalObject.GetCurrentContext();
context.Invoke("startActivity", i);
/*
  The same processing as the code below is performed.
  var i = new Intent("android.intent.action.VIEW", "http://biz-browser.jp");
  i.startActivity();
*/

Related item


ExternalObject.GetMessageHandler method (Java linkage)

Android

Explanation

Returns the message handler (android.os.Handler instance) required to issue the Root.ExternalMessage event.

If you want to issue an event to Biz/Browser from the library loaded by ExternalObject.LoadJar method, please pass this instance to the library side.

For details of android.os.Handler class, please refer to the reference manual of Android Developers (Android developer site).

Call format

var extobj = ExternalObject.GetMessageHandler()

Return value

ExternalObject object that contains the handler that can issue the Root.ExternalMessage event

argument

None

exception

CRS-407

Class 'ExternalObject' is not available at the current security level

Example of use

/* Get the message handler */
var handler = ExternalObject.GetMessageHandler();
/*
   This is an example of issuing a message from CRS.
   It is equivalent to the following code in Java.
   android.os.Handler handler; // Get message handler
   android.os.Message msg = android.os.Message.obtain();
   msg.what = 0;
   msg.arg1 = 1;
   msg.arg2 = 2;
   msg.obj = "Sample Text";
   handler.sendMessage(msg);
*/
var msg = ExternalObject.InvokeStatic("android.os.Message", null, "obtain");
msg.setProperty("what", 0);
msg.setProperty("arg1", 1);
msg.setProperty("arg2", 2);
msg.setProperty("obj", new String("Sample Text"));
handler.invoke("sendMessage", msg);

Related item

LoadJar method

Root.ExternalMessage event


ExternalObject class (Java linkage) event

Package version 1

Event

Android

There are no events defined in the ExternalObject class (Java linkage).

Class overview

Base class events


ExtVal class (Java linkage)

Android

Object
 | ExtVal

Class for matching CRS data type and Java primitive type.

It is used when it is necessary to specify a Java primitive type that cannot be expressed by CRS as an argument of each method of the ExternalObject class.

You can use the ExtVal object to pass a value of the appropriate primitive type to a Java object.

You can also use the boxing method to generate a Java object that is a primitive type boxed.

Default property and ValueType

The default property is Value . The ValueType specification is invalid.

Security level

In Biz / Browser HT, the usage of ExternalObject package is restricted by security level . The ExternalObject package is available by setting the security level to 0.

At security level 1 and above, an exception occurs when you try to instantiate the ExtVal class.


ExtVal property (Java linkage)

Package version 1

Property

Android

The following properties are defined in ExtVal class (Java linkage).

PKG | name | access | Type | initial value | Explanation
1 | Type | R | integer | ExtVal.Int | A constant that indicates a Java primitive type
1 | Value | R | Object |  | The value of the object

access | R | Readable
 | W | Writable
 | C | Can be initialized

: Default property

Class overview

Base class properties


ExtVal.Type property (Java linkage)

Android

A constant indicating the Java primitive type.

Specify the following value.

constant | .NET type (namespace omitted)
ExtVal.Boolean | boolean type (primitive type)
ExtVal.Char | char type (primitive type, 2-byte signed integer, for string representation)
ExtVal.Byte | byte type (primitive type, 1-byte signed integer)
ExtVal.Short | short type (primitive type, 2-byte signed integer)
ExtVal.Int | int type (primitive type, 4-byte signed integer)
ExtVal.Long | long type (primitive type, 8-byte signed integer)
ExtVal.Float | float type (primitive type, 4byte single precision floating point number)
ExtVal.Double | double type (primitive type, 8-byte double-precision floating-point number)

See the constructor description for details.


ExtVal.Value property (Java linkage)

Android

The value of the object. This value is passed to Java.

See the constructor description for details.


ExtVal class (Java linkage) method

Package version 1

Method

Android

The following methods are defined in ExtVal class (Java linkage).

PKG | name | Explanation
1 | ( Constructor ) | Initializes the ExtVal object
1 | SetValue | Set the value
1 | boxing | Get the Java object whose value is boxed

Class overview

Base class methods


ExtVal constructor (Java linkage)

Android

Explanation

Initializes the ExtVal object.

Call format

var val = new ExtVal ([ value , type ])

Return value

ExtVal object

argument

value

Specify the value of the object.

For example, if you specify ExtVal.Int for type , specify an integer for this argument.

Valid data type is Number.

The specified value is set in the Value property.

If omitted, 0 is set.

integer type

Specifies the Java primitive type.

See the Type property for the values ​​you can specify .

The specified value is set in the Type property.

If omitted, ExtVal.Int is set.

exception

CRS-16

Invalid constructor argument

CRS-407

Class 'ExtVal' is not available at the current security level

Example of use

var val = new ExtVal(12345, ExtVal.Short);
var ret = val.boxing().invoke("toString");
print (ret, "\n");

var extobj = new ExternalObject("SampleNS.SampleClass", "sampleLib");
extobj.SetProperty("SampleProp", new ExtVal(true, ExtVal.Boolean));

Related item

ExternalObject class

Value , Type property

SetValue method


ExtVal.SetValue method (Java linkage)

Android

Explanation

Set a value for each property of the ExtVal class.

For details such as the specifications of the arguments, refer to the constructor description.

Call format

val.SetValue( value , type )

Return value

None

argument

value

Specify the value of the object.

integer type

Specifies the Java primitive type.

exception

None

Example of use

var val = new ExtVal;
val.SetValue(true, ExtVal.Boolean);

Related item

Value , Type property


ExtVal.Boxing method (Java linkage)

Android

Explanation

Boxes the Java primitive type that the ExtVal class represents.

Please refer to Primitive Type and Boxing for boxing .

Call format

val.Boxing()

Return value

The boxed value will be returned as an ExternalObject object.

argument

None

exception

None

Example of use

var val = new ExtVal(123, ExtVal.Short);
var extobj = val.Boxing();
/* extobj holds java.lang.Short object
   ExternalObject object is stored */

Related item


ExtVal class (Java linkage) event

Package version 1

Event

Android

There are no events defined in ExtVal class (Java linkage).

Class overview

Base class events


Intent class

Package version 1

Intent class change history

Android

Object
 | Intent

This is a class for issuing an intent from Biz / Browser HT to other applications.

The value stored in the intent and the interpretation of that value differ depending on the application that received the intent, so please refer to the material of each application.

Also, depending on the type of intent, it may not be possible to execute it due to Android restrictions, so please check before using it.

In addition to creating intents by CRS programs, intents are also used for events that occur when a return value from another app is received.

What is an intent

Intent is a mechanism for linking with other Android apps supported by Android OS.

This mechanism allows you to easily take action on other applications.

The intent in Android SDK is provided as android.content.Intent class.

Intents can be broadly divided into two types: "explicit intents" and "implicit intents".

The explicit intent is to directly specify the target (activity) to be started.

It is used when you want to work closely with a specific app.

In that case, the parameters given to the intent differ depending on the target application, so please check the information for developers of each application.

Implicit intent has additional information such as data expressed in URI format and action (what you want to do) for it as a parameter without specifying the application to start, and the condition of the parameter You can launch the matching app.

If there are multiple targets (activities) that can receive the intent, the dialog for selecting the activity to be started by the user is displayed, and if it does not exist, the startup will fail.

In Biz / Browser HT, specify the intent action (corresponding to the Action property) and the target data (corresponding to the Data property) by assigning it to the Intent class constructor or property.

Also, it is possible to make it an explicit intent by calling the SetClassName method, and an implicit intent when not calling it.

For more information about Intent (android.content.Intent class), please refer to the reference manual of Android Developers (Android developer site).

Data type conversion between CRS and Extra information

When storing a value from CRS to Extra information, or conversely when extracting a value from Extra information, conversion is performed to the data type of each language.

Value conversion rule from CRS to Extra information

constant specified in the type argument | Required CRS type | Java type after conversion
Intent.TYPE_BOOLEAN | Integer value | Java boolean type (False if 0 or null, true otherwise)
Intent.TYPE_BYTE | Integer value | Java byte type
Intent.TYPE_CHAR | Integer value | Java char type
Intent.TYPE_SHORT | Integer value | Java short type
Intent.TYPE_INT | Integer value | Java int type
Intent.TYPE_LONG | Integer value | Java long type
Intent.TYPE_FLOAT | Number object | Java float type
Intent.TYPE_DOUBLE | Number object | Java double type
Intent.TYPE_STRING | A String object | Java string type
Intent.TYPE_BYTE_ARRAY | A ByteArray object | Java byte[] type
Intent.TYPE_STRING_ARRAY | String array | Java String[] type
Intent.TYPE_URI | A String object | Java android.net.Uri type
Intent.TYPE_PARCELABLE * 1 | ExternalObject object(android.os.Parcelable type) | Java android.os.Parcelable type
Intent.TYPE_SERIALIZABLE * 1 | ExternalObject object(java.io.Serializable type) | Java java.io.Serializable type

Value conversion rule from Extra information to CRS

constant specified in the type argument | The required Java type | CRS type after conversion
Intent.TYPE_BOOLEAN | Java boolean type | Integer value (1 if true, 0 if false)
Intent.TYPE_BYTE | Java byte type | Integer value
Intent.TYPE_CHAR | Java char type | Integer value
Intent.TYPE_SHORT | Java short type | Integer value
Intent.TYPE_INT | Java int type | Integer value
Intent.TYPE_LONG | Java long type | Integer value (It will be truncated to a range that can represent a 4-byte signed integer)
Intent.TYPE_FLOAT | Java float type | Number object
Intent.TYPE_DOUBLE | Java double type | Number object
Intent.TYPE_STRING | Java string type | A String object
Intent.TYPE_BYTE_ARRAY | Java byte[] type | A ByteArray object
Intent.TYPE_STRING_ARRAY | Java String[] type | String array
Intent.TYPE_URI | Java android.net.Uri type | A String object
Intent.TYPE_PARCELABLE * 1 | Java android.os.Parcelable type | ExternalObject object(android.os.Parcelable type)
Intent.TYPE_SERIALIZABLE * 1 | Java java.io.Serializable type | ExternalObject object(java.io.Serializable type)

Default property and ValueType

There are no default properties. The ValueType specification is invalid.

Security level

In Biz / Browser V and Biz / Browser HT, the use of ExternalObject package is restricted by security level . The ExternalObject package is available by setting the security level to 0.

At security level 1 and above, an exception occurs when you try to instantiate the Intent class.

Properties | Methods | Events

Change Log
* 1 Added from Package Version 12.


Intent property

Package version 1

Property

Android

The following properties are defined in the Intent class.

PKG | name | access | Type | initial value | Explanation
1 | Action | CRW | String |  | Specifies the intent action.
1 | Data | CRW | String |  | Specify the intent data in URI format.
12 | Flags | CRW | integer |  | Specifies the intent flag.
1 | Type | CRW | String |  | Specify the MIME type of the data.

access | R | Readable
 | W | Writable
 | C | Can be initialized

: Default property

Class overview

Base class properties


Intent.Action property

Android

Specifies the intent action.

For more information, please refer to What is an intent?


Intent.Data property

Android

Specify the intent data in URI format.

If you are using a terminal with Android OS 7.0 or above, you cannot exchange files with the URI of the "file://" scheme due to the restrictions of Android OS.

In this case, specify the URI of the "content://" scheme generated using the FileSystem.MapContentUri method.

For more information, please refer to What is an intent?


Intent.Flags property

Android

Specifies the intent flag.

For more information, please refer to What is an intent?


Intent.Type property

Android

Specifies the MIME type of the data pointed to by the Intent Data property.

For more information, please refer to What is an intent?


Intent method

Package version 1

Method

Android

The following methods are defined in the Intent class.

PKG | name | Explanation
1 | ( Constructor ) | Initializes the Intent object
12 | AddCategory | Add category to intent
12 | AddBroadcastReceiver | Register the broadcast intent to be received
12 | ClearBroadcastReceiver | Delete all broadcast intents to be received
1 | CreateChooser | Create an intent to display the selection dialog of the app to receive
12 | GetCategories | Acquires the category list that the intent has
1 | GetExtra | Get Extra information from intent
12 | HasCategory | Gets whether the intent has the specified category
1 | HasExtra | Gets whether Extra information is stored in the intent
1 | PutExtra | Store Extra information in intent
12 | SendBroadcast | Issue a broadcast intent
12 | SetClassName | Explicitly specify the issue destination of the intent
1 | StartActivity | Issue an intent that launches the activity without taking a return value
1 | StartActivityForResult | Issues an intent that activates the activity and can receive the return value
12 | StartService | Issues an intent that starts the service and takes no return value
12 | StartServiceForResult | Issues an intent that starts the service and can receive the return value
12 | StopService | Issue an intent to end the service

Class overview

Base class methods


Intent constructor

Android

Explanation

Generate an intent.

Call format

var i = new Intent ([ action [, data ]])

Return value

Intent object

argument

String action

Intent action

Initialize the Action property with this value.

See What is an intent for more information.

String data

Intent data

Initialize the Data property with this value.

See What is an intent for more information.

exception

None

Example of use

var intent1 = new Intent("android.intent.action.VIEW", "http://biz-browser.jp");
intent1.StartActivity();

var intent2 = new Intent;
intent2.Action = "android.intent.action.SENDTO";
intent2.Data = "mailto:";
var to = new String[1];
to[0] = "test@example.com";
intent2.putExtra(Intent.TYPE_STRING_ARRAY, "android.intent.extra.EMAIL", to);
intent2.CreateChooser("Please select a mailer.").StartActivity();

var intent3 = new Intent{
  Action = "com.google.zxing.client.android.SCAN";
  PutExtra(Intent.TYPE_STRING, "SCAN_MODE", "ONE_D_MODE");

  Function OnActivityResult(e){
    if(e.ResultCode == Intent.RESULT_OK){
      var barcodeData = e.ResultIntent.GetExtra(Intent.TYPE_STRING, "SCAN_RESULT");
      //.MessageBox(barcodeData, "Reading results");
    }else{
      //.MessageBox("Barcode scan has been canceled.", "read failure");
    }
  }
}
intent3.StartActivityForResult();

Related item

StartActivity , StartActivityForResult methods


Intent.AddBroadcastReceiver method

Package version 12

Intent.AddBroadcastReceiver methodchange history

Android

Explanation

Register the broadcast intent to be received.

After registration, if the target broadcast intent is received, the BroadcastReceived event will occur.

Call format

intent1.AddBroadcastReceiver( intentFilter or action [, flag] )

Return value

None

argument

XmlDocument intentFilter

Specify the IntentFilter that narrows down the broadcast intent to be received.

This IntentFilter requires at least one action tag, which specifies the action of the broadcast intent to be received.

As an example, to register an IntentFilter that accepts two types of action, describe as follows.

var intentFilter = new XmlDocument();
intentFilter << XML <<-
  <intent-filter xmlns: android = "http://schemas.android.com/apk/res/android">
        <action android: name = "android.intent.action.ACTION_POWER_CONNECTED" />
        <action android: name = "android.intent.action.ACTION_POWER_DISCONNECTED" />
  </ intent-filter>
->>;
Intent intent1;
intent1.AddBroadcastReceiver(intentFilter);

For the description method of IntentFilter, please refer to the description method of intent-filter tag of AndroidManifest.xml (external link) .

String action

Specify the action of the broadcast intent to be received.

If only one action should be received and other parameters are not required, it can be specified more easily than specifying the intentFilter argument.

As an example, to register an IntentFilter that accepts only one type of action, describe as follows.

Intent intent1;
intent1.AddBroadcastReceiver("android.intent.action.BATTERY_CHANGED");

integer flag

Specify options such as whether to expose the broadcast receiver to other apps.*1

This argument has effect only on Android 14 and above OS.

The following values are defined;

Contant | Value | Explanation
Intent.RECEIVER_NO_FLAG | 0 | No flags set.
Intent.RECEIVER_EXPORTED | 2 | Broadcasts sent by other applications can be received.
Intent.RECEIVER_NOT_EXPORTED | 4 | Only broadcasts sent from own applications or broadcasts sent from the system can be received.

If omitted, Intent.RECEIVER_EXPORTED will be used.

exception

FUNC-4

Invalid argument value

EXTOBJ-27

Failed to build IntentFilter

EXTOBJ-30

Failed to add BroadcastReceiver

Example of use

Intent batteryChangedReceiver {
  / * Receive broadcast battery status change intent and display battery level and charge status * /
  Function OnBroadcastReceived(e){
    if (e.ReceivedIntent.Action == "android.intent.action.BATTERY_CHANGED"){
      var batteryStatus = "";
      / * Get battery level * /
      var batteryScale = e.ReceivedIntent.GetExtra(Intent.TYPE_INT, "scale");
      var batteryLevel = e.ReceivedIntent.GetExtra(Intent.TYPE_INT, "level");
      if(batteryScale> 0){
        var batteryPercent = int(batteryLevel / batteryScale * 100);
        batteryStatus + = "Battery level:" + str(batteryPercent) + "%";
      }else{
        batteryStatus + = "Battery level: unknown";
      }
      / * Get battery charge status * /
      var batteryPlugged = e.ReceivedIntent.GetExtra(Intent.TYPE_INT, "plugged");
      if(batteryPlugged> 0){
        batteryStatus + = "(charging)";
      }else{
        batteryStatus + = "(Discharging)";
      }
      / * Display * /
      //.Title = batteryStatus;
    }
  }
}
/ * Create an IntentFilter that specifies the recipient of the broadcast intent * /
var intentFilter = new XmlDocument();
intentFilter << XML <<-
  <intent-filter xmlns: android = "http://schemas.android.com/apk/res/android">
    <action android: name = "android.intent.action.BATTERY_CHANGED" />
  </ intent-filter>
->>;
/ * Start receiving broadcast intent * /
batteryChangedReceiver.AddBroadcastReceiver(intentFilter);

Related item

ClearBroadcastReceiver method, BroadcastReceived event

Change history
*1　Added from Package Version 29


Intent.AddCategory method

Android

Explanation

Add category to intent

Call format

intent1.AddCategory( category )

Return value

None

argument

String category

Specify the category to add with a character string.

exception

None

Example of use

var i = new Intent("android.intent.action.VIEW", "http://biz-browser.jp");
i.AddCategory("android.intent.category.DEFAULT");
i.StartActivity();

Related item

HasCategory , GetCategories method


Intent.ClearBroadcastReceiver method

Android

Explanation

Delete all broadcast intents to be received.

Call format

intent1.ClearBroadcastReceiver()

Return value

None

argument

None

exception

None

Example of use

var intent1 = new Intent();
/ * ... * /
intent1.ClearBroadcastReceiver();

Related item

AddBroadcastReceiver method


Intent.CreateChooser method

Android

Explanation

Create an intent to display the selection dialog of the app to receive.

If you want the user to be sure to select the application to be started when starting the mail application using the intent, create an intent to display the application selection dialog received using this method.

Call format

intent1.CreateChooser( title )

Return value

Returns the created Intent object.

argument

String title

Specify the title of the app selection dialog.

Note

If the Action of the issued Intent matches the following, the title specification may be ignored due to the specifications on the Android OS side.

-"Android.intent.action.SEND"

-"Android.intent.action.SEND_MULTIPLE"

exception

None

Example of use

var i = new Intent("android.intent.action.SENDTO", "mailto:");
var to = new String[1];
to[0] = "test@example.com";
var cc = new string[2];
cc[0] = "cc1@example.com";
cc[1] = "cc2@example.com";
i.putExtra(Intent.TYPE_STRING_ARRAY, "android.intent.extra.EMAIL", to);
i.PutExtra(Intent.TYPE_STRING_ARRAY, "android.intent.extra.CC", cc);
i.PutExtra(Intent.TYPE_STRING, "android.intent.extra.SUBJECT" , "Sample Email Subject");
i.PutExtra(Intent.TYPE_STRING, "android.intent.extra.TEXT" , "Sample email body\nSecond line item\nThird line item");
i.CreateChooser("Please select a mailer.").StartActivity();

Related item

StartActivity method


Intent.GetCategories method

Android

Explanation | Acquires the list of categories that the intent has
Call format | var ret = intent1.GetCategories()
Return value | Returns a list of categories as a String array. Returns a String array of length 0 if it has no categories.
argument | None
exception | None
Related item | AddCategory , HasCategory methods


Intent.GetExtra method

Package version 1

Intent.GetExtra method change history

Android

Explanation

Get Extra information from the intent.

Call format

intent1.GetExtra( type , name [, default ])

Return value

If the Extra information to be acquired exists, its value will be returned, and if it does not exist, the value of the argument default will be returned.

argument

Number type

Specify the type of Extra information to be acquired.

The constants that can be specified are as follows.

constant | value | Explanation
Intent.TYPE_BOOLEAN | 1 | Represents a Java boolean type
Intent.TYPE_BYTE | 2 | Represents the Java byte type
Intent.TYPE_CHAR | 3 | Represents the Java char type
Intent.TYPE_SHORT | 4 | Represents the Java short type
Intent.TYPE_INT | 5 | Represents a Java int type
Intent.TYPE_LONG | 6 | Represents the Java long type
Intent.TYPE_FLOAT | 7 | Represents the Java float type
Intent.TYPE_DOUBLE | 8 | Represents the Java double type
Intent.TYPE_STRING | 9 | Represents the Java string type
Intent.TYPE_BYTE_ARRAY | 12 | Represents the Java byte[] type
Intent.TYPE_STRING_ARRAY | 19 | Represents the Java String[] type
Intent.TYPE_URI | 20 | Represents the Java android.net.Uri type
Intent.TYPE_PARCELABLE * 1 | 21 | Represents the Java android.os.Parcelable type
Intent.TYPE_SERIALIZABLE * 1 | 22 | Represents the java.io.Serializable type in Java

See Data type conversion between CRS and Extra information for details.

String name

Specify the name of Extra information to be acquired with a character string.

default

Specify the default value when the Extra information to be acquired does not exist.

If not specified, 0 is used for numeric type, empty string is used for String, and null is used for other reference types.

exception

FUNC-4

Invalid argument value

Example of use

Intent i{
  Function OnActivityResult(e) {
    if(e.ResultCode == Intent.Result_OK){
      //.MessageBox("value: "+ e.ResultIntent.GetExtra(Intent.TYPE_STRING," EXTRA_DATA1 "," (no value) "));
    } else {
      //.MessageBox("Request canceled ");
    }
  }
}

Related item

PutExtra , HasExtra methods

Change Log
* 1 Added from Package Version 12.


Intent.HasCategory method

Android

Explanation | Gets whether the intent has the specified category
Call format | var ret = intent1.HasCategory( category )
Return value | Returns true if it has the target category, false otherwise.
argument | String category | Specify the category to be acquired with a character string.
exception | None |
Related item | AddCategory , GetCategories method


Intent.HasExtra method

Android

Explanation

Gets whether Extra information is stored in the intent

Call format

intent1.HasExtra( name )

Return value

Returns true if the target Extra information exists, false otherwise.

argument

String name

Specify the name of Extra information to be acquired with a character string.

exception

None

Example of use

Intent i{
  Function OnActivityResult(e){
    if (e.ResultCode == Intent.Result_OK){
      if (e.ResultIntent.HasExtra("EXTRA_DATA1"){
       //.MessageBox("value: "+ e.ResultIntent.GetExtra(Intent.TYPE_STRING," EXTRA_DATA1 "," "));
     } else {
       //.MessageBox("EXTRA_DATA1 is not stored ");
     }
   } else {
     //.MessageBox("Request canceled ");
    }
  }
}

Related item

PutExtra , GetExtra methods


Intent.PutExtra method

Package version 1

Intent.PutExtra method change history

Android

Explanation

Store Extra information in the intent.

Call format

intent1.PutExtra( type , name , value )

Return value

None

argument

Number type

Specify the type of Extra information to be stored.

The constants that can be specified are as follows.

constant | value | Explanation
Intent.TYPE_BOOLEAN | 1 | Represents a Java boolean type
Intent.TYPE_BYTE | 2 | Represents the Java byte type
Intent.TYPE_CHAR | 3 | Represents the Java char type
Intent.TYPE_SHORT | 4 | Represents the Java short type
Intent.TYPE_INT | 5 | Represents a Java int type
Intent.TYPE_LONG | 6 | Represents the Java long type
Intent.TYPE_FLOAT | 7 | Represents the Java float type
Intent.TYPE_DOUBLE | 8 | Represents the Java double type
Intent.TYPE_STRING | 9 | Represents the Java string type
Intent.TYPE_BYTE_ARRAY | 12 | Represents the Java byte[] type
Intent.TYPE_STRING_ARRAY | 19 | Represents the Java String[] type
Intent.TYPE_URI * 1 | 20 | Represents the Java android.net.Uri type
Intent.TYPE_PARCELABLE * 2 | 21 | Represents the Java android.os.Parcelable type
Intent.TYPE_SERIALIZABLE * 2 | 22 | Represents the java.io.Serializable type in Java

See Data type conversion between CRS and Extra information for details.

String name

Specify the name of the Extra information to be stored as a character string.

value

Specify the value of Extra information to be stored.

exception

FUNC-4

Invalid argument value

Example of use

var i = new Intent("android.intent.action.SENDTO", "mailto:");
var to = new String[1];
to[0] = "test@example.com";
var cc = new string[2];
cc[0] = "cc1@example.com";
cc[1] = "cc2@example.com";
i.putExtra(Intent.TYPE_STRING_ARRAY, "android.intent.extra.EMAIL", to);
i.PutExtra(Intent.TYPE_STRING_ARRAY, "android.intent.extra.CC", cc);
i.PutExtra(Intent.TYPE_STRING, "android.intent.extra.SUBJECT" , "Sample Email Subject");
i.PutExtra(Intent.TYPE_STRING, "android.intent.extra.TEXT" , "Sample email body\nSecond line item\nThird line item");
i.CreateChooser("Please select a mailer.").StartActivity();

Related item

GetExtra , HasExtra , FileSystem.MapContentUri methods

Change history
* 1 When using a terminal with Android OS 7.0 or later, files cannot be exchanged using the URI of the "file: //" scheme due to Android OS restrictions.
    In this case, specify the URI of the "content: //" scheme generated using the FileSystem.MapContentUri method.
* 2 Added from Package Version 12.


Intent.SendBroadcast method

Android

Explanation

Issue a broadcast intent.

Call format

intent1.SendBroadcast()

Return value

None

argument

None

exception

None

Example of use

var intent1 = new Intent("com.example.ACTION_BROADCAST");
intent1.SendBroadcast();

Related item


Intent.SetClassName method

Android

Explanation

Specify the issue destination of the intent explicitly.

For more information, please refer to What is an intent?

Call format

intent1.SetClassName( pkgName [, clsName ])

Return value

None

argument

String pkgName

Specify the package name of the Intent issue destination as a character string.

String clsName

Specify the class name of the Intent issue destination (activity name, service name, etc.) as a character string.

If a character string starting with "." Is specified, the package name specified by the argument pkgName is completed at the beginning.

Example) When "SetClassName(" com.example "," .ExampleActivity ")" is described, it is assumed that "com.example.ExampleActivity" is specified in the argument clsName.

exception

FUNC-4

Invalid argument

Example of use

var i = new Intent("android.intent.action.VIEW", "https://www.google.co.jp/maps/place/MountFuji/");
i.SetClassName("com.google.android.apps.maps"); / * Explicit intent for Google Maps apps. * /
i.StartActivity();

Related item


Intent.StartActivity method

Android

Explanation

Issues an intent that activates the activity and does not receive a return value.

Call format

intent1.StartActivity()

Return value

None

argument

None

exception

EXTOBJ-21

No activity was found to receive the intent

Example of use

var intent1 = new Intent("android.intent.action.VIEW", "http://biz-browser.jp");
intent1.StartActivity();

Related item

StartActivityForResult method


Intent.StartActivityForResult method

Android

Explanation

Issues an intent that activates the activity and can receive the return value.

Call format

intent1.StartActivityForResult()

Return value

None

argument

None

exception

EXTOBJ-21

No activity was found to receive the intent

Example of use

/ *
  This sample assumes that the external application "QR code scanner" is installed.
  "QR code scanner" can be obtained from the following URL.
    https://play.google.com/store/apps/details?id=com.google.zxing.client.android
* /
var intent3 = new Intent{
  Action = "com.google.zxing.client.android.SCAN";
  PutExtra(Intent.TYPE_STRING, "SCAN_MODE", "ONE_D_MODE");
  Function OnActivityResult e){
    if(e.ResultCode == Intent.RESULT_OK){
      var barcodeData = e.ResultIntent.GetExtra(Intent.TYPE_STRING, "SCAN_RESULT");
      //.MessageBox(barcodeData, "read result");
    }else{
      //.MessageBox("Barcode scan canceled. "," Read failed ");
    }
  }
}
intent3.StartActivityForResult();

Related item

StartActivity method, ActivityResult event


Intent.StartService method

Android

Explanation

Issues an intent that starts the service and receives no return value.

In case of Android 8.0 or later, start the service using "android.content.Context.startForegroundService" method of Android API .

For devices with Android 8.0 or lower, use the "android.content.Context.startService" method of Android API (not recommended for Android 8 or later) to start the service.

On devices running Biz/Browser HT 1.2.6 or later and Android 11 or later, Biz/Browser can only work with services with specific package names.

Call format

intent1.StartService([ forceBackground ])

Return value

None

argument

boolean forceBackground

If true is specified, the service will be started using the "android.content.Context.startService" method of Android API (deprecated in Android 8 or later) even on Android 8.0 or later devices.

This option is left for compatibility with past services for Android OS.

The default is false.

exception

EXTOBJ-26

Failed to start the service.

Example of use

var intent1 = new Intent();
intent1.SetClassName("com.example.service", ".ExampleService");
intent1.StartService();

Related item

StartServiceForResult , StopService method


Intent.StartServiceForResult method

Android

Explanation

Issues an intent that invokes a service that can receive the return value.

In case of Android 8.0 or later, start the service using "android.content.Context.startForegroundService" method of Android API .

For devices with Android 8.0 or lower, use the "android.content.Context.startService" method of Android API (not recommended for Android 8 or later) to start the service.

On devices running Biz/Browser HT 1.2.6 or later and Android 11 or later, Biz/Browser can only work with services with specific package names.

Call format

intent1.StartService( resultReceiverName [, forceBackground ])

Return value

None

argument

String resultReceiverName

Specify the name of the Extra information that stores the Java object (android.os.ResultReceiver) that receives the callback from the service.

When the service that is invoked invokes the " ResultReceiver.send " method of this Java object, a ServiceResult event will be fired for this Intent object .

boolean forceBackground

If true is specified, the service will be started using the "android.content.Context.startService" method of Android API (deprecated in Android 8 or later) even on Android 8.0 or later devices.

This option is left for compatibility with past services for Android OS.

The default is false.

exception

EXTOBJ-26

Failed to start the service.

Example of use

Intent intent1{
  Function OnServiceResult(e){
    var resultExtra = e.ResultData.GetExtra(Intent.TYPE_STRING, "RESULT_EXTRA");
    MessageBox(resultExtra, "resultCode:" + str (e.ResultCode);
  }
}
intent1.SetClassName("com.example.service", ".ExampleService");
intent1.StartServiceForResult("RESULT_RECEIVER_NAME");

Related item

StartService , StopService method, ServiceResult event


Intent.StopService method

Android

Explanation

Issues an intent that ends the service.

Call format

var ret = intent1.StopService()

Return value

Returns true if the running service is terminated, false otherwise.

argument

None

exception

None

Example of use

var intent1 = new Intent();
intent1.SetClassName("com.example.service", ".ExampleService");
intent1.StopService();

Related item

StartService , StartServiceForResult methods


Intent event

Event

Android

The following events are defined in the Intent class.

PKG | name | Explanation
1 | ActivityResult | It is an event that occurs when the return value of the intent issued by the StartActivityForResult method is received.
12 | ServiceResult | This event occurs when a return value is received from the service started by the StartServiceForResult method.
12 | BroadcastReceived | Event that occurs when a broadcast intent is received

Class overview

Base class events


Intent.ActivityResult event

Android

It is an event that occurs when the return value is received for the intent issued by the StartActivityForResult method.

The ActivityResult event has the following structure.

Event {
    Number ResultCode; /* Store return value of intent */
    /* If there are additional return values, the following objects will be stored */
    Intent ResultIntent; /* Store additional return value of intent */
}

The following values ​​are stored in ResultCode in general applications.

Depending on the called application, values ​​other than the following may be stored, so check the specifications of the called application for details.

constant | value | Explanation
Intent.RESULT_OK | -1 | A value that indicates that the operation was successful
Intent.RESULT_CANCEL | 0 | A value indicating that the operation has been canceled

If there are additional return values ​​for the intent, the ResultIntent object is added as a child object of the event.

Whether there is an additional return value or what value is stored depends on the called app, so please check the specification of the called app for details.

Please use Object.FindObject method to check if this object exists .

The ActivityResult event occurs when the called app returns an appropriate return value.

Therefore, if the called app does not return a value or kills it, the event may not occur.

Therefore, be careful not to write code that assumes that the ActivityResult event will occur.

If the Intent object is not included in the object tree, be careful when writing the event handler.

When referencing other objects from objects that are not included in the object tree, you can reference only global objects, absolute paths from "//", and child objects of your own object.

Description example not included in the object tree

var i = new Intent{
    Function OnActivityResult(e){
    /* Intent object is not included in the object tree */
    /* Other objects cannot be referenced by relative path here */
    }
}
/*… Set an appropriate value for the intent… */
i.StartActivityForResult();

Description example included in the object tree

Intent i{
    Function OnActivityResult(e){
    /* Since the Intent object is included in the object tree */
    /* Again, you can reference other objects by relative path */
    /* Objects remain permanently unless deleted after use */
    }
}
/*… Set an appropriate value for the intent… */
i.StartActivityForResult();


Intent.ServiceResult event

Android

It is an event that occurs when the return value is received for the intent issued by the StartServiceForResult method.

The ServiceResult event has the following structure.

Event{
    Number ResultCode; /* Store the return value of the service */
    Intent ResultData; /* Wraps an additional return value (android.os.Bundle) of the service in an Intent object. */
}

This event occurs when the send (int resultCode, Bundle resultData) method of the android.os.ResultReceiver object specified by the first argument of the StartServiceForResult method is called on the calling service .

ResultCode and ResultData child objects respectively correspond to the first argument and second argument of ResultReceiver.send (int resultCode, android.os.Bundle resultData) method.

If the second argument (resultData) of the above method is null, the ResultData child object will be an empty Intent object.

Whether there is a return value of the service or what value is stored depends on the called service, so please check the specification of the called service for details.

The ServiceResult event occurs when the called service returns an appropriate return value.

Therefore, if the called service does not return a value or kills it, the event may not fire.

Therefore, please be careful not to write code that assumes that the ServiceResult event will occur.

If the Intent object is not included in the object tree, be careful when writing the event handler.

When referencing other objects from objects not included in the object tree, you can only refer to global objects, absolute paths from "//", and child objects of your own object.

Description example not included in the object tree

var i = new Intent{
    Function OnServiceResult(e){
    /* Intent object is not included in the object tree */
    /* Other objects cannot be referenced by relative path here */
    }
}
/*… Set an appropriate value for the intent… */
i.StartServiceForResult("RESULT_RECEIVER_EXTRA_NAME");

Description example included in the object tree

Intent i{
    Function OnServiceResult(e){
    /* Since the Intent object is included in the object tree */
    /* Again, you can reference other objects by relative path */
    /* Objects remain permanently unless deleted after use */
    }
}
/*… Set an appropriate value for the intent… */
i.StartServiceForResult("RESULT_RECEIVER_EXTRA_NAME");


Intent.BroadcastReceived event

Android

This is an event that occurs when the broadcast receiver registered by the AddBroadcastReceiver method receives a broadcast intent.

The BroadcastReceived event has the following structure.

Event{
    Intent ReceivedIntent; /* Stores the received broadcast intent. .. */
}

As for what value is stored in Broadcast Intent, it depends on the publisher application and action, so please check the publisher's specifications for details.

If the Intent object is not included in the object tree, be careful when writing the event handler.

When referencing other objects from objects that are not included in the object tree, you can reference only global objects, absolute paths from "//", and child objects of your own object.

Description example not included in the object tree

var i = new Intent{
    Function OnBroadcastReceived(e){
    /* Intent object is not included in the object tree */
    /* Other objects cannot be referenced by relative path here */
    }
}
/*… Register the broadcast intent reception target… */
i.AddBroadcastReceiver(...);

Description example included in the object tree

Intent i{
    Function OnBroadcastReceived(e){
    /* Since the Intent object is included in the object tree */
    /* Again, you can reference other objects by relative path */
    /* Objects remain permanently unless deleted after use */
    }
}
/*… Register the broadcast intent reception target… */
i.AddBroadcastReceiver(...);


ExternalService class

Android

Object
 | ExternalService

It is a class that cooperates with an external service that has an interface for Biz / Browser HT.

Like Button, Label, etc., it is used while connected to the object tree.

External service

This class requires a service (Android service) that has a dedicated interface for separately connecting Biz / Browser SmartDevice and Biz / Browser HT using this class.

Services that do not have a dedicated interface and other applications cannot be linked using this class.

Consider using the Intent class when using an external application that can be linked using the Android standard intent function, and the ExternalObject class when handling a class of the Android SDK or jar format library.

On devices running Biz/Browser HT 1.2.6 or later and Android 11 or later, Biz/Browser can only work with services with specific package names.

Communication Protocol Version

The communication protocol version with the external service is now defined in API Version 24.

ExternalService class provides functionality depending on the communication protocol version supported by the external service.

The features added in each version of the communication protocol are as follows:

Communication Protocol Version | Supported API Version | Added Features
1 | HT(10) | Create New
2 | HT(24) | ・It is now possible to pass ByteArray class objects and Image class objects. ・Added support for exceptions (CRSExternalException) for CRS added on the external service. Biz/Browser HT interprets the information set in the CRSExternalException exception and sets the contents of the Exception.Code, Exception.Message, and Exception.Method properties.

The communication protocol version used with the external service to which you are connected can be found in the UsingProtocolVersion property.

Default property and ValueType

There are no default properties. The ValueType specification is invalid.

Security level

In Biz/Browser V, Biz/Browser SmartDevice and Biz/Browser HT, the usage of ExternalObject package is restricted by security level . The ExternalObject package is available by setting the security level to 0.

At security level 1 and above, an exception occurs when you try to instantiate the ExternalService class.


ExternalService Property

HT API version 10

Property

Android

The following properties are defined in the ExternalService class.

PKG | name | access | Type | Explanation
HT (24) | IsBound | R | boolean | Gets whether the connection is made to an external service
HT (24) | UsingProtocolVersion | R | integer | Get the communication protocol version in use with the external service to which you are connected

Class overview

Base class properties


ExternalService.IsBound property

Android

Set to $TRUE if the object is connected to an external service, $FALSE otherwise.

This property is read-only.


ExternalService.UsingProtocolVersion property

Android

Gets the communication protocol version in use with the external service to which you are connected.

This property is read-only.


ExternalService method

HT API version 10

Method

Android

The following methods are defined in the ExternalService class.

PKG | name | Explanation
HT (10) | Bind | Connect to an external service
HT (24) | BindAsync | Connect asynchronously to an external service
HT (10) | Invoke | Request processing to the connected service
HT (24) | Unbind | Disconnect from an external service

Class overview

Base class methods


ExternalService.Bind method

HT API version 10

ExternalService.Bind method change history

Android

Explanation

Connect to external services.

At the time of normal return from the call of the Bind method, the service has been bound and the Invoke method can be called. * 1

In addition, for compatibility with previous versions, the BoundStateChanged event that notifies that the connection is established and has been established will occur.

Call format

extService1.Bind( serviceID )

Return value

None

argument

String serviceID

Service ID (service package name + "/." + Service IF class name)

exception

EXTOBJ-23

EXTOBJ-24

EXTOBJ-28

Service ID "%s" is invalid

Failed to bind service ID "%s"

Binding to service is in progress

Example of use

ExternalService sv;
sv.Bind(SERVICE_ID);

Related item

BindAsync method

Invoke method

Unbind method

Change History
* 1 The specifications have been changed in HT API version 12.
    In HT API version 11 or earlier, binding is not completed immediately after calling the method.
    Please check the BoundStateChanged event to see if the binding is complete.


ExternalService.BindAsync method

Android

Explanation

Connect asynchronously to external services. This method returns processing without waiting for a connection to the service.

The BoundStateChanged event that notifies that the connection is established and has been established will occur.

After connecting, the Invoke method can be called.

Call format

extService1.BindAsync( serviceID )

Return value

None

argument

String serviceID

Service ID (service package name + "/." + Service IF class name)

exception

EXTOBJ-23

EXTOBJ-24

EXTOBJ-28

Service ID "%s" is invalid

Failed to bind service ID "%s"

Binding to service is in progress

Example of use

ExternalService sv;
sv.BindAsync(SERVICE_ID);

Related item

Bind method

Invoke method

Unbind method


ExternalService.Invoke method

Android

Explanation

Requests execution of processing to the connected external service.

When using this method to request the external service to execute a process, the method specified from here must be available in the target service.

Call format

extService1.Invoke( methodName [, param1 [, param2 [, ...]] )

Return value

If the specified method is a process that returns a return value, it returns the return value in JSON format as an associative array of Array objects.

Please refer to the JSONDocument class for the relationship between JSON data and Array objects.

If the specified method does not return a return value, null is returned.

argument

String methodName

Object paramN

Method name to execute

The argument values ​​required by the method

exception

EXTOBJ-22

EXTOBJ-24

EXTOBJ-25

EXTOBJ-28

Service is not bound

Failed to bind ServiceID "%s"

Method "%s"."%s" invocation failed

Binding to service is in progress

Example of use

ExternalService sv;

sv.Bind(SERVICE_ID);
var param2 = 100
var res = sv.Invoke("SampleMethod", "param1", param2);

Related item


ExternalService.Unbind method

Android

Explanation

Disconnect from external services. the BoundStateChanged event that notifies that the connection is disconnected will occur.

Call format

extService1.Unbind()

Return value

None

argument

None

exception

EXTOBJ-22

Service is not bound

Example of use

ExternalService sv;
sv.Bind(SERVICE_ID);
sv.Unbind();

Related item

Bind method

BindAsync method


ExternalService event

HT API version 10

Event

Android

The following events are defined in the ExternalService class.

PKG | name | Explanation
HT (10) | BoundStateChanged | Occurs when the connection status of the external service changes

Class overview

Base class events


ExternalService.BoundStateChanged event

Android

This event occurs when the connection status of the external service changes.

The BoundStateChanged event has the following structure.

Event {
    String State; / * Connected state (Bound → Connected, Binding → Connected, UnBound → Not connected) * /
}


Item list

  • Biz/Browser HT CRS Manual
    • About this manual
    • Overview of Biz/Browser
      • System configuration using Biz/Browser
      • Cooperation with server application
      • System construction points
      • Features and restrictions of Android version
      • About scaling operation
      • Security level
      • About supported HTTP authentication methods
      • About gesture operation
      • About custom URL schemes
      • About API version
    • CRS program
      • CRS program building blocks
      • Elements of the CRS program
      • package
      • class
      • CRS archive
      • object
      • Events and event handlers
      • User-defined event
      • Function (user-defined function)
      • Expressions and operators
      • constant
      • $$ symbol (external resource constant)
      • Global function
      • Control structure
      • Exception handling
      • Reserved word
      • Character encoding that can write CRS programs
    • Behavior when starting Biz/Browser
      • Biz/Browser extension association
      • Precautions when starting from a web browser
      • Launch Biz/Browser
      • Operations when logging in to Biz/Browser
      • Connection license
      • Customize the application list screen
      • Cache consistency check
      • Operation settings at startup
    • Manipulating objects
      • Initial state of the object
      • Object creation
      • Delete object
      • Find Object Name
      • Automatic recalculation between objects
      • Implicit object creation
      • Global namespace
    • Array object
      • Array object overview
      • Create array object
      • Working with array objects
      • Display array objects
      • Manipulating array objects with hierarchical structure
      • Note for classes that have array objects as child objects
    • Global function
      • String manipulation functions
      • Date function
      • Arithmetic functions
      • Statistical function
      • Financial function
      • System function
    • Packages and classes
      • System package
      • Standard package
      • Extension3 package
      • Extension4 package
      • Extension5 package
      • CSV package
      • XML package
      • DB package
      • HTTP package
      • FTP package
      • Runtime package
      • Converter package
      • Security package
      • JSON package
      • Speech package
    • Platform specific package
      • Android


Expressions and operators

  • Expressions and operators
    • new operator
    • Addition / subtraction operator
    • Parenthesis operator
    • Unary operator
    • Arithmetic operators
    • Relational operator
    • Equality operator
    • Logical join operator
    • Ternary operator
    • Assignment operator

back to the list


Connection license

  • Connection license
    • Connection license mechanism
    • Connection license certificate

back to the list


String manipulation functions

  • String manipulation functions
    • find
    • fullp
    • halfp
    • left
    • length
    • lower
    • mid
    • replace
    • right
    • split
    • str
    • strf
    • suuji
    • trim
    • upper
    • val

back to the list


Date function

  • Date function
    • datedif
    • dateval
    • day
    • hour
    • minute
    • month
    • second
    • year
    • youbi

back to the list


Arithmetic functions

  • Arithmetic functions
    • abs
    • and
    • int
    • or
    • rand
    • round
    • rounddown
    • roundup
    • roundm
    • sign
    • xor

back to the list


Statistical function

  • Statistical function
    • avg
    • max
    • min
    • std
    • stds
    • var
    • vars
    • rank
    • sum

back to the list


Financial function

  • Financial function
    • cterm
    • db
    • ddb
    • fv
    • gankin
    • ganri
    • irr
    • npv
    • pmt
    • pv
    • rate
    • sln
    • syd
    • term

back to the list


System function

  • System function
    • cachedate
    • debugMessage
    • deleteCache
    • decodeURL
    • encodeURL
    • findHttpSession
    • getBookmark
    • getHttpSession
    • hasConnectionLicense
    • importConnectionLicense
    • link
    • print
    • remBookmark
    • setBookmark
    • setPalette
    • sleep
    • syncObject
    • sysdate

back to the list


System package

  • System package
    • Array class
      • Property
        • Length
        • Value
      • Method
        • constructor
        • Erase
        • Join
        • Reverse
        • Sort
        • ToString
      • Event
      • operator
        • Array []
    • ByteArray class
      • Property
        • Length
        • Value
      • Method
        • constructor
        • ByteAt
        • ToHexString
        • ToString
      • Event
    • Date class
      • Property
        • Value
      • Method
        • constructor
        • GetTime
        • GetFullYear
        • GetMonth
        • GetDate
        • GetDay
        • GetHours
        • GetMinutes
        • GetSeconds
        • GetMilliSeconds
        • GetUTCFullYear
        • GetUTCMonth
        • GetUTCDate
        • GetUTCDay
        • GetUTCHours
        • GetUTCMinutes
        • GetUTCSeconds
        • GetUTCMilliSeconds
        • GetTimezoneOffset
        • SetTime
        • SetFullYear
        • SetMonth
        • SetDate
        • SetHours
        • SetMinutes
        • SetSeconds
        • SetMilliSeconds
        • SetUTCFullYear
        • SetUTCMonth
        • SetUTCDate
        • SetUTCHours
        • SetUTCMinutes
        • SetUTCSeconds
        • SetUTCMilliSeconds
        • ToDateString
        • ToInternetString
        • ToLocaleDateString
        • ToLocaleString
        • ToLocaleTimeString
        • ToString
        • ToTimeString
        • ToUTCString
        • ValueOf
        • Parse
        • UTC
      • Event
    • Event class
      • Property
        • EventName
        • From
        • Reason
      • Method
        • constructor
      • Event
    • Exception class
      • Property
        • Code
        • Message
        • Method
        • SourceOffset
        • SourceURL
      • Method
        • constructor
      • Event
    • Fixed class
      • Property
        • Value
      • Method
        • constructor
        • ToString
        • Round
        • RoundDown
        • RoundUp
      • Event
    • Math class
      • Property
        • E
        • LN10
        • LN2
        • LOG2E
        • LOG10E
        • PI
        • SQRT1_2
        • SQRT2
      • Method
        • abs
        • acos
        • asin
        • atan
        • atan2
        • ceil
        • cos
        • exp
        • floor
        • log
        • max
        • min
        • pow
        • random
        • round
        • sin
        • sqrt
        • tan
      • Event
    • NetObject class
      • Property
        • UseChange
      • Method
        • Cache
        • Eval
        • Get
      • Event
        • Change
    • Number class
      • Property
        • Value
        • MAX_VALUE
        • MIN_VALUE
      • Method
        • constructor
        • ToExponential
        • ToFixed
        • ToLocaleString
        • ToPrecision
        • ToString
        • ValueOf
      • Event
    • Object class
      • Property
        • ClassName
        • IsArray
        • Name
        • ValueType
        • Index
        • Length
        • Class
      • Method
        • Append
        • Clear
        • ClearChild
        • Delete
        • DeleteChild
        • FindChild
        • FindObject
        • GetChildObjects
        • Post
        • Insert
        • Truncate
      • Event
    • Record class
      • Property
        • Value
      • Method
      • The event
    • RegexMatcher class
      • Property
        • GroupCount
        • InputString
        • Pattern
      • Method
        • AppendReplacement
        • AppendTail
        • End
        • Find
        • GetInputString
        • Group
        • LookingAt
        • Matches
        • ReplaceAll
        • ReplaceFirst
        • Reset
        • Start
      • Event
    • RegexPattern class
      • Property
        • Flags
        • Pattern
      • Method
        • GetPattern
        • Matcher
        • Split
        • Compile
        • Matches
      • Event
    • String class
      • Property
        • Length
        • Value
      • Method
        • constructor
        • CharAt
        • CharCodeAt
        • Concat
        • EqualsIgnoreCase
        • IndexOf
        • LastIndexOf
        • LocaleCompare
        • Replace
        • Slice
        • Split
        • Substring
        • ToLocaleLowerCase
        • ToLocaleUpperCase
        • ToLowerCase
        • ToString
        • ToUpperCase
        • Trim
        • ValueOf
        • FromCharCode
      • Event

back to the list


Standard package

  • Standard package
    • Button class
      • Property
        • AltKey
        • CornerRadius
        • FontFace
        • FontKind
        • FontSize
        • HorizontalAlign
        • Title
        • Value
      • Method
      • Event
        • RClicked
        • Touch
    • CheckBox class
      • Property
        • BgColor
        • Border
        • FgColor
        • FontFace
        • FontKind
        • FontSize
        • Scroll
        • Value
      • Method
      • Event
    • CheckItem class
      • Property
        • Selected
        • Title
        • Value
      • Method
      • Event
        • Touch
    • ContainerObject class
      • Property
        • NextTabKey
        • PrevTabKey
      • Method
      • Event
    • Dialog class
      • Property
        • BgColor
        • Border
        • Opacity
        • Title
        • TitleBar
        • Value
      • Method
      • Event
        • Close
    • DisplayObject class
      • Property
        • Active
        • Height
        • TabIndex
        • Visible
        • Width
        • X
        • Y
        • Layout
        • LayoutMargin
        • LayoutSpacing
      • Method
        • MessageBox
        • PopupMenu
        • RemoveTimer
        • ResetCursor
        • SetCursor
        • SetTimer
      • Event
        • OkSelected
        • CancelSelected
        • YesSelected
        • NoSelected
        • RetrySelected
        • Timer
    • EditBox class
      • Property
        • Border
        • HorizontalAlign
        • InputMode
        • MaxLength
        • ScrollBarPosition
        • Value
      • Method
        • AppendCR
        • GetSelection
        • SetSelection
        • SetMargins
      • Event
        • Touch
    • EditObject class
      • Property
        • BgColor
        • Editable
        • FgColor
        • FontFace
        • FontKind
        • FontSize
        • IMEMode
        • SIPMode
        • Title
        • UseTapAndHold
      • Method
      • Event
        • RClicked
    • FocusObject class
      • Property
        • AutoTabFocus
        • NextTabKey
        • PrevTabKey
        • SkipTabFocus
      • Method
        • MoveFocus
        • SetFocus
      • Event
        • FocusOperation
        • GetFocus
        • LostFocus
    • Form class
      • Property
        • BgColor
        • Border
        • FontScale
        • HorizontalScale
        • Scroll
        • UseGesture
        • UseMouseMove
        • UseTapAndHold
        • Value
        • VerticalScale
      • Method
      • Event
        • Clicked
        • DoubleClicked
        • Gesture
        • KeyDown
        • KeyUp
        • MouseMove
        • RButtonUp
        • RClicked
    • Label class
      • Property
        • BgColor
        • Border
        • BorderStyle
        • CornerRadius
        • FgColor
        • FontFace
        • FontKind
        • FontSize
        • Format
        • HorizontalAlign
        • NoPrefix
        • Transparent
        • Value
        • VerticalAlign
        • UseTapAndHold
      • Method
      • Event
        • Clicked
        • DoubleClicked
        • RClicked
    • ListBox class
      • Property
        • BgColor
        • Border
        • FgColor
        • FontFace
        • FontKind
        • FontSize
        • ItemHeight
        • Scroll
        • SelectionMode
        • Value
      • Method
      • Event
    • ListItem class
      • Property
        • Selected
        • Title
        • Value
      • Method
      • Event
        • Touch
        • DoubleClicked
    • OptionButton class
      • Property
        • BgColor
        • Border
        • FgColor
        • FontFace
        • FontKind
        • FontSize
        • Scroll
        • Value
      • Method
      • Event
    • OptionItem class
      • Property
        • Selected
        • Title
        • Value
      • Method
      • Event
        • Touch
    • PulldownItem class
      • Property
        • Selected
        • Title
        • Value
      • Method
      • Event
        • Touch
    • PulldownList class
      • Property
        • BgColor
        • DropdownKey
        • DropdownStyle
        • DropdownWidth
        • FgColor
        • FontFace
        • FontKind
        • FontSize
        • TitleHeight
        • Value
      • Method
      • Event
    • Root class
      • Property
        • AllowUntrustCertificate
        • BackKeyMode
        • BgColor
        • CacheMode
        • DisplayOrient
        • Height
        • HttpTimeout
        • Indicator
        • ReLoggedIn
        • SelectAllOnFocus
        • ShowSIPOnFocus
        • MinimizeBox
        • Title
        • UserLanguage
        • Value
        • Width
        • X
        • Y
        • AutoDial
        • DialEntry
        • HttpRetryTime
        • UseHttpPreconfig
      • Method
        • CacheSetup
        • CopyString
        • DecideValue
        • DeleteCache
        • GetBookmark
        • GetClientCertificateList
        • GetDesktopHeight
        • GetDesktopWidth
        • GetFocus
        • GetUsingClientCertificate
        • ImportClientCertificate
        • IsClientCertificateAutoSelect
        • IsNetworkAccessible
        • Login
        • Logout
        • PasteString
        • RemapKeyName
        • RemBookmark
        • ScreenShot
        • SetBookmark
        • SetClientCertificate
        • SetCompatibleMode
        • SetFullScreenMode
        • SetWareki
        • ShowMenu
        • SLogin
        • Dial
        • GetPowerState
        • SetUserSip
        • ShowSIP
        • SetReloginURL
        • SetMemoryLimitThreshold
      • Event
        • BluetoothBondingFinished
        • BluetoothDeviceFound
        • BluetoothScanFinished
        • BluetoothScanStarted
        • Close
        • ExternalIntent
        • ExternalMessage
        • WindowStateChanged
        • ExternalCall
        • PowerStateChanged
        • MemoryLimitExceeded
      • SYS object
      • OnException function
    • TextBox class
      • Property
        • AutoTab
        • Border
        • Format
        • HorizontalAlign
        • InputMode
        • MaxLength
        • Password
        • Value
        • VerticalAlign
      • Method
        • GetSelection
        • SetSelection
        • SetMargins
      • Event
        • Clicked
        • MaxlengthReached
        • Touch

back to the list


Extension3 package

  • Extension3 package
    • DateEdit class
      • Property
        • AutoTab
        • Border
        • EditText
        • Format
        • HorizontalAlign
        • InvalidDate
        • ShowFormat
        • UndecidedStyle
        • UseHelper
        • Value
        • VerticalAlign
      • Method
        • SetMargins
        • ShowHelper
      • Event
        • Clicked
        • Touch
    • NumberEdit class
      • Property
        • AutoTab
        • Border
        • Format
        • HorizontalAlign
        • IsNull
        • MaxLength
        • UseHelper
        • Value
        • VerticalAlign
      • Method
        • SetMargins
        • ShowHelper
      • Event
        • Clicked
        • Touch
    • TabForm class
      • Property
        • Height
        • Selected
        • Title
        • Width
        • X
        • Y
      • Method
      • Event
    • TabFrame class
      • Property
        • Arrangement
        • BgColor
        • Border
        • FontFace
        • FontKind
        • FontSize
        • TabHeight
        • TabPosition
        • TabStyle
        • TabWidth
        • UseTapAndHold
        • Value
      • Method
      • Event
        • Clicked
        • RClicked

back to the list


Extension4 package

  • Extension4 package
    • FlexView
      • FlexButton class
        • Property
          • Active
          • Value
        • Method
        • Event
          • Pushed
          • RClicked
      • FlexButtonCell class
        • Property
          • Active
        • Method
        • Event
      • FlexCell class
        • Property
          • BgColor
          • Data
          • FgColor
          • Value
        • Method
        • Event
      • FlexCheckButton class
        • Property
          • Active
          • Border
          • BorderStyle
          • Selected
          • Value
          • UseTapAndHold
        • Method
        • Event
          • CheckChanged
          • RClicked
      • FlexCheckButtonCell class
        • Property
          • Active
          • Selected
        • Method
        • Event
      • FlexColumnSet class
        • Property
        • Method
        • Event
      • FlexData class
        • Property
          • BgColor
          • Data
          • FgColor
          • Format
          • HorizontalAlign
          • Value
          • VerticalAlign
        • Method
        • Event
      • FlexGroupHeader class
        • Property
          • GroupCount
          • HorizontalAlign
          • Value
        • Method
        • Event
      • FlexGroupHeaderCell class
        • Property
        • Method
        • Event
      • FlexHeader class
        • Property
          • Border
          • BorderStyle
          • HorizontalAlign
          • Icon
          • Numbered
          • Value
          • UseTapAndHold
        • Method
          • ResetImage
          • SetImage
        • Event
          • Clicked
          • DoubleClicked
          • RClicked
      • FlexHeaderCell class
        • Property
        • Method
        • Event
      • FlexIndentLabel class
        • Property
          • Foldable
          • Folding
          • Indent
          • Key
          • ParentKey
          • Value
        • Method
        • Event
      • FlexIndentLabelCell class
        • Property
          • Folding
          • Key
          • ParentKey
        • Method
        • Event
      • FlexItem class
        • Property
          • Title
          • TitleBgColor
          • TitleFgColor
          • TitleHorzAlign
          • TitleMarker
          • TitleResize
          • TitleRows
          • TitleVertAlign
          • Width
        • Method
        • Event
          • TitleDClicked
          • TitleLClicked
          • TitleRClicked
      • FlexLabel class
        • Property
          • Border
          • BorderStyle
          • Icon
          • Value
          • UseTapAndHold
        • Method
          • ResetImage
          • SetImage
        • Event
          • Clicked
          • DoubleClicked
          • RClicked
      • FlexLabelCell class
        • Property
          • Icon
        • Method
        • Event
      • FlexListBox class
        • Property
          • Active
          • AutoCursorMove
          • Border
          • BorderStyle
          • DropdownKey
          • DropdownStyle
          • KeySelect
          • ListData
          • Value
          • UseTapAndHold
        • Method
        • Event
          • Clicked
          • RClicked
          • SelectChanged
      • FlexListBoxCell class
        • Property
          • Active
        • Method
        • Event
      • FlexRecord class
        • Property
          • BgColor
          • Border
          • BorderStyle
          • Height
          • StripedOpacity
          • Value
        • Method
        • Event
      • FlexRow class
        • Property
          • End
          • InvalidState
          • Position
        • Method
          • GetColumn
          • GetHeaderColumn
          • MoveNext
          • MovePrev
        • Event
      • FlexRowSet class
        • Property
        • Method
        • Event
      • FlexTextBox class
        • Property
          • AutoCursorMove
          • Border
          • BorderStyle
          • Editable
          • IMEMode
          • InputMode
          • MaxLength
          • SIPMode
          • Value
          • UseTapAndHold
        • Method
        • Event
          • Clicked
          • RClicked
          • TextChanged
      • FlexTextBoxCell class
        • Property
          • Editable
        • Method
        • Event
      • FlexTreeHeader class
        • Property
          • BgStyle
          • Foldable
          • HorizontalAlign
          • Value
        • Method
        • Event
      • FlexTreeHeaderCell class
        • Property
        • Method
        • Event
      • FlexView class
        • Property
          • BgColor
          • Border
          • ColumnPosition
          • CursorCellOpacity
          • CursorColor
          • CursorLineOpacity
          • CursorMove
          • CursorTextColor
          • FontFace
          • FontKind
          • FontSize
          • HScroll
          • NoPrefix
          • RowCount
          • RowPosition
          • ShowTitle
          • TitleBgColor
          • TitleFgColor
          • TitleFontFace
          • TitleFontKind
          • TitleFontSize
          • TitleHeight
          • UseTitleFont
          • VScroll
        • Method
          • ClearRows
          • DeleteRow
          • GetRow
          • GetScrollPos
          • IndentSort
          • InsertRow
          • SetScrollPos
          • Sort
        • Event
          • CursorMoved
          • Scrolled
        • operator
          • FlexView << CSVDocument operator
          • CSVDocument << FlexView operator
    • GroupBox class
      • Property
        • BorderStyle
        • BoxStyle
        • FgColor
        • FontFace
        • FontKind
        • FontSize
        • Title
        • TitleAlign
        • TitlePosition
        • Value
      • Method
      • Event
    • Image class
      • Property
        • Height
        • Width
      • Method
        • GetInformation
        • LoadImage
        • RemoveImage
        • Rotate
        • Save
      • Event
    • ImageButton class
      • Property
        • BgColor
        • ButtonMode
        • ButtonStyle
        • FgColor
        • HorzPlacement
        • ImageHeight
        • ImageWidth
        • NoPrefix
        • Resize
        • Spacing
        • Toggle
        • VerticalAlign
        • VertPlacement
      • Method
        • ResetImage
        • ResetPushedImage
        • SetImage
        • SetPushedImage
      • Event
    • ImageLabel class
      • Property
        • BoxStyle
        • HorzPlacement
        • ImageHeight
        • ImageWidth
        • NoPrefix
        • Resize
        • Spacing
        • VertPlacement
      • Method
        • ResetImage
        • SetImage
      • Event
    • ImageList class
      • Property
        • IconCount
        • IconHeight
        • IconWidth
        • LargeImage
        • MaskColR
        • MaskColG
        • MaskColB
        • MaskUse
      • Method
        • constructor
        • GetImage
        • LoadIcon
        • LoadImage
        • RemoveImage
      • Event
    • MaskEdit class
      • Property
        • AutoTab
        • Border
        • EditText
        • HorizontalAlign
        • InputMode
        • InvalidText
        • Mask
        • UndecidedColor
        • Value
      • Method
        • SetMargins
      • Event
        • Clicked
        • Touch

back to the list


Extension5 package

  • Extension5 package
    • HtmlView class
      • Property
        • AllowAction
        • Border
        • IsBusy
        • Silent
        • Title
        • URL
      • Method
        • ClearCache
        • ExecJavascript
        • GoBack
        • GoForward
        • GoUrl
        • Refresh
        • ParseHtml
        • ScrollBy
        • Stop
        • Zoom
      • Event
        • CloseWindow
        • DocumentComplete
        • MessageFromJavascript
        • NavigateError
    • CanvasView class
      • Property
      • Method
        • Erase
        • Redo
        • ResetImage
        • SetImage
        • SetStroke
        • Snapshot
        • Undo
      • Event

back to the list


CSV package

  • CSV package
    • CSVDocument class
      • Property
        • Columns
        • Rows
        • Value
      • Method
        • constructor
        • Clear
        • ClearColumnName
        • DeleteColumn
        • DeleteRow
        • Find
        • Get
        • GetCell
        • GetCellByName
        • GetCells
        • GetColumnName
        • InsertColumn
        • InsertRow
        • Load
        • Merge
        • Parse
        • Replace
        • Save
        • SetCell
        • SetCellByName
        • SetCells
        • SetColumnName
        • Splice
        • Sort
        • Truncate
      • Event
        • LoadBreak
      • operator
        • [] << CSV constant
        • [] << CSVDocument
        • CSVDocument << CSVDocument
        • CSVDocument << []
        • CSVDocument << CSV constant
      • CSV constant

back to the list


XML package

  • XML package
    • XmlAttr class
      • Property
        • Name
        • OwnerElement
        • Specified
        • Value
      • Method
      • Event
    • XmlCDATASection class
      • Property
      • Method
      • Event
    • XmlCharacterData class
      • Property
        • Data
        • Length
      • Method
        • AppendData
        • DeleteData
        • InsertData
        • ReplaceData
        • SubstringData
      • Event
    • XmlComment class
      • Property
      • Method
      • Event
    • XmlDocument class
      • Property
        • DocType
        • DocumentElement
        • DocumentURI
        • Implementation
        • IndexAttributeName
      • Method
        • CreateAttribute
        • CreateAttributeNS
        • CreateCDATASection
        • CreateComment
        • CreateDocumentFragment
        • CreateElement
        • CreateElementNS
        • CreateProcessingInstruction
        • CreateTextNode
        • GetElementById
        • GetElementsByTagName
        • GetElementsByTagNameNS
        • ImportNode
        • Save
      • Event
      • operator
        • XmlDocument << XML constant
        • XmlDocument << XmlDocument
      • XML constant
    • XmlDocumentFragment class
      • Property
      • Method
      • Event
    • XmlDOMException class
      • Property
        • Code
        • Message
      • Method
      • Event
    • XmlDOMImplementation class
      • Property
        • Value
      • Method
        • constructor
        • CreateDocument
        • CreateDocumentType
        • DecodeXML
        • EncodeXML
        • HasFeature
        • Load
        • Parse
      • Event
    • XmlElement class
      • Property
        • TagName
      • Method
        • GetAttribute
        • GetAttributeNS
        • GetAttributeNode
        • GetAttributeNodeNS
        • GetElementsByTagName
        • GetElementsByTagNameNS
        • HasAttribute
        • HasAttributeNS
        • RemoveAttribute
        • RemoveAttributeNS
        • RemoveAttributeNode
        • SetAttribute
        • SetAttributeNS
        • SetAttributeNode
        • SetAttributeNodeNS
      • Event
    • XmlNamedNodeMap class
      • Property
        • Length
      • Method
        • GetNamedItem
        • GetNamedItemNS
        • Item
        • NextNode
        • RemoveNamedItem
        • RemoveNamedItemNS
        • Reset
        • SetNamedItem
        • SetNamedItemNS
      • Event
      • operator
        • XmlNamedNodeMap []
        • XmlNamedNodeMap Iterate
    • XmlNode class
      • Property
        • Attributes
        • ChildNodes
        • FirstChild
        • LastChild
        • LocalName
        • NamespaceURI
        • NextSibling
        • NodeName
        • NodeType
        • NodeValue
        • OwnerDocument
        • ParentNode
        • Prefix
        • PreviousSibling
        • Text
        • Xml
      • Method
        • AppendChild
        • CloneNode
        • HasAttributes
        • HasChildNodes
        • InsertBefore
        • IsSupported
        • LookupNamespaceURI
        • LookupPrefix
        • Normalize
        • RemoveChild
        • ReplaceChild
        • SelectNodes
        • SelectSingleNode
      • Event
    • XmlNodeList class
      • Property
        • Length
      • Method
        • Item
        • NextNode
        • Reset
      • Event
      • operator
        • XmlNodeList []
        • XmlNodeList Iterate
    • XmlProcessingInstruction class
      • Property
        • Data
        • Target
      • Method
      • Event
    • XmlText class
      • Property
      • Method
        • SplitText
      • Event

back to the list


DB package

  • DB package
    • LocalDB class
      • Property
        • FileName
      • Method
        • constructor
        • Begin
        • Close
        • Commit
        • CreateStatement
        • Exec
        • IsTableExists
        • Rollback
      • Event
    • LocalDBStatement class
      • Property
        • Query
      • Method
        • Bind
        • Exec
        • GetColumn
        • GetColumns
        • GetRow
        • GetRows
        • Next
      • Event
      • operator
        • CSVDocument << LocalDBStatement

back to the list


HTTP package

  • HTTP package
    • HttpAsyncSession class
      • Property
        • Sessions
      • Method
        • Abort
        • CreateRequest
        • Get
        • IsBusy
        • Post
      • Event
        • SessionEnd
    • HttpRequest class
      • Property
        • Timeout
        • URL
      • Method
        • AddBody
        • AddParam
        • SetHeader
        • WriteString
      • Event
    • HttpResponse class
      • Property
        • Body
        • Status
        • URL
      • Method
        • GetHeader
        • GetHeaderList
        • Read
        • ReadBinary
        • ReadLine
      • Event
    • HttpSession class
      • Property
        • LastURL
        • Protocol
        • PreventMultipleURLEncoding
        • Proxy
        • Server
      • Method
        • CreateRequest
        • Dele
        • Get
        • GetCookie
        • IsLoginSession
        • Post
        • Put
        • FindSession
        • GetSession
        • ToAbsoluteURL
      • Event

back to the list


FTP package

  • FTP package
    • FtpSession class
      • Property
        • CurrentDir
        • Server
        • SystemName
      • Method
        • Close
        • ChangeDir
        • Connect
        • CreateDir
        • DeleteDir
        • DeleteFile
        • FindFiles
        • GetSize
        • Get
        • Put
        • Rename
        • SetEncoding
      • Event

back to the list


Runtime package

  • Runtime package
    • BluetoothPeripheral class
      • Property
        • Timeout
        • Value
      • Method
        • Connect
        • Disconnect
        • Read
        • Write
        • StartNotify
        • StopNotify
      • Event
        • CharacteristicChanged
    • BluetoothSocket class
      • Property
        • Host
        • IsConnected
        • Timeout
        • Value
      • Method
        • Close
        • Open
        • Read
        • ReadLine
        • Write
        • WriteString
      • Event
        • Receive
    • BluetoothSocketListener class
      • Property
        • IsListening
        • Value
      • Method
        • Start
        • Stop
      • Event
        • Accept
    • CodeScannerView class
      • Property
        • Border
        • Value
      • Method
        • HideCamera
        • ShowCamera
        • StartCodeScanner
        • StopCodeScanner
      • Event
        • CodeScanned
    • File class
      • Property
        • FileName
        • PathName
      • Method
        • Close
        • Read
        • ReadBinary
        • ReadLine
        • Seek
        • Write
        • WriteString
      • Event
    • FileSystem class
      • Property
        • PathName
      • Method
        • constructor
        • ChangeDir
        • Copy
        • CreateDir
        • CreateTempFile
        • DeleteFile
        • Exists
        • FindFiles
        • GetLength
        • IsDirectory
        • IsFile
        • List
        • ListFiles
        • MakePath
        • MapContentUri
        • MapPath
        • Mount
        • Open
        • OpenDialog
        • Rename
        • SaveDialog
        • SplitPath
        • Suffix
        • Unmount
      • Event
    • NfcTagConnection class
      • Property
        • IsFelicaTag
        • IsMifareClassicTag
        • TagId
      • Method
        • Close
        • Felica_Polling
        • Felica_Read
        • Felica_Write
        • Mifare_AuthenticateSectorWithKeyA
        • Mifare_AuthenticateSectorWithKeyB
        • Mifare_BlockCountInSector
        • Mifare_BlockToSector
        • Mifare_Decrement
        • Mifare_Increment
        • Mifare_ReadBlock
        • Mifare_Restore
        • Mifare_SectorCount
        • Mifare_SectorToBlock
        • Mifare_Transfer
        • Mifare_WriteBlock
        • SetMessage
        • Transceive
      • Event
    • Runtime class
      • Property
        • Value
      • Method
        • constructor
        • CancelBluetoothScanning
        • CallDll
        • DeleteUUID
        • DiscoverNfcTag
        • Exec
        • GetBondedDeviceList
        • GetCameraCaptureImage
        • GetMaxMemory
        • GetLastKnownLocation
        • GetUUID
        • HasNfcFeature
        • Invoke
        • IsBluetoothEnabled
        • IsNfcReaderEnabled
        • IsProviderEnabled
        • LoadSound
        • PlaySound
        • RequestBonding
        • SetBluetoothEnabled
        • SetCameraOption
        • ShellEdit
        • ShellLink
        • ShellOpen
        • ShowBluetoothSettings
        • ShowCodeScanner
        • ShowImagePicker
        • StartBluetoothScanning
        • StartCameraCapture
        • ShowNfcSettings
        • StartLocationMeasure
        • StopCameraCapture
        • StopLocationMeasure
        • ShowLocationSettings
        • UnloadSound
      • Event
        • LocationChanged
    • Socket class
      • Property
        • BufferSize
        • Host
        • IsConnected
        • Port
        • Timeout
        • Value
      • Method
        • Close
        • Open
        • Read
        • ReadLine
        • Write
        • WriteString
      • Event
        • Receive
    • SocketListener class
      • Property
        • IsListening
        • Port
        • Value
      • Method
        • Start
        • Stop
      • Event
        • Accept

back to the list


Converter package

  • Converter package
    • Base64Decoder class
      • Property
        • FileName
        • PathName
        • Value
      • Method
        • constructor
        • Close
        • Read
        • Write
        • Convert
      • Event
    • Base64Encoder class
      • Property
        • FileName
        • PathName
        • Value
      • Method
        • constructor
        • Close
        • Read
        • ReadLine
        • Write
        • WriteString
        • Convert
      • Event
    • NewlineConverter class
      • Property
        • FileName
        • PathName
        • Value
      • Method
        • constructor
        • Close
        • Read
        • ReadLine
        • Write
        • WriteString
        • Convert
      • Event
    • NullConverter class
      • Property
        • FileName
        • PathName
        • Value
      • Method
        • constructor
        • Close
        • Read
        • ReadLine
        • Write
        • WriteString
        • Convert
      • Event
    • TextConverter class
      • Property
        • FileName
        • PathName
        • Value
      • Method
        • constructor
        • Close
        • Read
        • ReadLine
        • Write
        • WriteString
        • Convert
      • Event

back to the list


Security package

  • Security package
    • Encryptor class
      • Property
        • Algorithm
        • FileName
        • PathName
      • Method
        • constructor
        • Close
        • Read
        • Write
        • WriteString
        • EncryptString
      • Event
    • Decryptor class
      • Property
        • Algorithm
        • FileName
        • PathName
      • Method
        • constructor
        • Close
        • Read
        • ReadLine
        • Write
        • DecryptString
      • Event
    • Hash class
      • Property
        • Algorithm
        • FileName
        • PathName
      • Method
        • constructor
        • Close
        • GetHashData
        • Read
        • ReadLine
        • Write
        • WriteString
        • HashString
      • Event

back to the list


JSON package

  • JSON package
    • JSONDocument class
      • Property
        • Value
      • Method
        • Get
        • Load
        • Parse
        • Save
        • ToString
      • Event
      • operator
        • JSONDocument << JSON constant
      • JSON constant

back to the list


Speech package

  • Speech package
    • SpeechSynthesizer class
      • Property
        • IsSpeaking
        • Pitch
        • PostUtteranceDelay
        • Rate
        • Value
        • Volume
      • Method
        • AddWordToDictionary
        • AddWordToDictionaryWithCSV
        • GetAvailableEngines
        • GetAvailableVoices
        • GetCurrentEngine
        • GetCurrentVoice
        • IsLanguageAvailable
        • Load
        • RemoveWordFromDictionary
        • SetEngine
        • SetVoice
        • StartSpeaking
        • StopSpeaking
        • Unload
      • Event
        • UtteranceStateChanged
    • Voice class
      • Property
        • Gender
        • ID
        • IsNetworkRequired
        • Language
        • Latency
        • Quality
        • Value
        • VoiceName
      • Method
        • constructor
      • Event
    • Utterance class
      • Property
        • Pitch
        • PostUtteranceDelay
        • Rate
        • Value
        • Volume
      • Method
        • constructor
      • Event

back to the list


Android

  • Android
    • ExternalObject package
      • ExternalObject class(Java linkage)
        • Property
          • Type
          • IsJavaArray
          • IsNullRef
          • JavaArrayLength
        • Method
          • constructor
          • Get
          • Invoke
          • Set
          • GetAt
          • SetAt
          • Cast
          • IsInstanceOf
          • Unboxing
          • GetPropStatic
          • InvokeStatic
          • SetPropStatic
          • LoadJar
          • IsLibraryIdUsed
          • NullRef
          • GetCurrentContext
          • GetMessageHandler
        • Event
      • ExtVal class(Java linkage)
        • Property
          • Type
          • Value
        • Method
          • constructor
          • SetValue
          • Boxing
        • Event
      • Intent class
        • Property
          • Action
          • Data
          • Flags
          • Type
        • Method
          • constructor
          • AddBroadcastReceiver
          • AddCategory
          • ClearBroadcastReceiver
          • CreateChooser
          • GetCategories
          • GetExtra
          • HasCategory
          • HasExtra
          • PutExtra
          • SendBroadcast
          • SetClassName
          • StartActivity
          • StartActivityForResult
          • StartService
          • StartServiceForResult
          • StopService
        • Event
          • ActivityResult
          • ServiceResult
          • BroadcastReceived
      • ExternalService class
        • Property
        • Method
          • Bind
          • Invoke
        • Event
          • BoundStateChanged

back to the list


Color constant

Use a predefined "color constant" that starts with $ to specify the color.

The following colors are assigned to the color constants in the initial state.

constant | value | Explanation
$STD | 0 | Standard color
$BLACK | 1 | black
$WHITE | 2 | White
$DGRAY | 3 | Dark gray
$LGRAY | 4 | gray
$DRED | 5 | Dark red
$RED | 6 | Red
$DYELLOW | 7 | Dark yellow
$YELLOW | 8 | yellow
$DGREEN | 9 | Dark green
$GREEN | 10 | Green
$DCYAN | 11 | Dark light blue
$CYAN | 12 | light blue
$DBLUE | 13 | Dark blue
$BLUE | 14 | Blue
$DMAGENTA | 15 | Dark magenta
$MAGENTA | 16 | Magenta

twenty one | $FFCCCC | 36 | $FFFFCC | 51 | $CCFFCC | 66 | $CCFFFF | 81 | $CCCCFF | 96 | $FFCCFF | 111 | $FFFFFF
twenty two | $FF9999 | 37 | $FFFF99 | 52 | $99FF99 | 67 | $99FFFF | 82 | $9999FF | 97 | $FF99FF | 112 | $CCCCCC
twenty three | $FF6666 | 38 | $FFFF66 | 53 | $66FF66 | 68 | $66FFFF | 83 | $6666FF | 98 | $FF66FF | 113 | $999999
twenty four | $FF3333 | 39 | $FFFF33 | 54 | $33FF33 | 69 | $33FFFF | 84 | $3333FF | 99 | $FF33FF | 114 | $666666
twenty five | $FF0000 | 40 | $FFFF00 | 55 | $00FF00 | 70 | $00FFFF | 85 | $0000FF | 100 | $FF00FF | 115 | $333333
26 | $CC0000 | 41 | $CCCC00 | 56 | $00CC00 | 71 | $00CCCC | 86 | $0000CC | 101 | $CC00CC | 116 | $000000
27 | $990000 | 42 | $999900 | 57 57 | $009900 | 72 | $009999 | 87 | $000099 | 102 | $990099 |
28 | $660000 | 43 | $666600 | 58 | $006600 | 73 | $006666 | 88 | $000066 | 103 | $660066
29 | $330000 | 44 | $333300 | 59 | $003300 | 74 | $003333 | 89 | $000033 | 104 | $330033
30 | $CC3333 | 45 | $CCCC33 | 60 | $33CC33 | 75 | $33CCCC | 90 | $3333CC | 105 | $CC33CC
31 | $CC6666 | 46 | $CCCC66 | 61 | $66CC66 | 76 | $66CCCC | 91 | $6666CC | 106 | $CC66CC
32 | $993333 | 47 | $99933 | 62 | $339933 | 77 | $339999 | 92 | $333399 | 107 | $993399
33 | $CC9999 | 48 | $CCCC99 | 63 | $99CC99 | 78 78 | $99CCCC | 93 | $9999CC | 108 | $CC99CC
34 | $663333 | 49 | $666633 | 64 | $336633 | 79 | $336666 | 94 | $333366 | 109 | $663366
35 | $996666 | 50 | $99966 | 65 | $669966 | 80 | $669999 | 95 | $666699 | 110 | $996699

The color assigned to each constant can be changed to any color by using the setPalette function.


Key specification

You can specify the following values ​​for keyboard key-setting properties, such as the NextTabKey , PrevTabKey , and AltKey properties.

constant | value | Key | constant | value | Key
$STD | 0 | unspecified |  |  |
$TAB | 1 | Tab | $S_TAB | 19 | Shift + Tab
$ENTER | 2 | Enter | $S_ENTER | 20 | Shift + Enter
$F01 | 3 | F1 | $S_F01 | 21 | Shift + F1
$F02 | 4 | F2 | $S_F02 | 22 | Shift + F2
$F03 | 5 | F3 | $S_F03 | 23 | Shift + F3
$F04 | 6 | F4 | $S_F04 | 24 | Shift + F4
$F05 | 7 | F5 | $S_F05 | 25 | Shift + F5
$F06 | 8 | F6 | $S_F06 | 26 | Shift + F6
$F07 | 9 | F7 | $S_F07 | 27 | Shift + F7
$F08 | 10 | F8 | $S_F08 | 28 | Shift + F8
$F09 | 11 | F9 | $S_F09 | 29 | Shift + F9
$F10 | 12 | F10 | $S_F10 | 30 | Shift + F10
$F11 | 13 | F11 | $S_F11 | 31 | Shift + F11
$F12 | 14 | F12 | $S_F12 | 32 | Shift + F12
$ESC | 15 | Esc | $S_ESC | 33 | Shift + Esc
$HOME | 16 | Home | $S_HOME | 34 | Shift + Home
$END | 37 | End | $S_END | 38 | Shift + End
$PAGE UP | 17 | PageUp | $S_PAGEUP | 35 | Shift + PageUP
$PAGEDOWN | 18 | PageDown | $S_PAGEDOWN | 36 | Shift + PageDown

Priority order in key operation

When multiple meanings are assigned to one key operation and the key operation is actually performed, the priority order of execution is as follows.

1. The focus movement is given priority to the key operations set in the Tab key, Shift + Tab key, NextTabKey property, and PrevTabKey property.

2. Object-specific keystrokes are performed.

3. The key operation assigned to the AltKey property of the Button object is executed.

4. The KeyDown event is raised.

* The operation that occurs with one key operation is one of focus movement, object-specific operation, AltKey property operation, and KeyDown event issuance.

* If you press the Ctrl key at the same time as the keys assigned to the NextTabKey , PrevTabKey , and AltKey properties, they will be distinguished as different key operations.


Reader and Writer objects

You may be able to specify a Reader object or Writer object as an argument of the property or method of each class.

These do not refer to objects of a particular class, but to any object that has a particular function.

Reader object

An object that can be used by read methods such as the Read method. File object and HttpResponse object created in read mode are equivalent.

For the specified Reader object, the Read method is searched internally, the found method is called, and the read data is used. Other methods, such as the ReadLine method, may be used.

Writer object

An object that can be used by write methods such as the Write method. File object and HttpRequest object created in write mode correspond to this.

For the specified Writer object, the Write method is searched internally, the found method is called, and the data is written.

Other methods, such as the WriteString method, may be used.


GetCoreDumpList function

iOSAndroidWindows

Explanation

Get a list of core dump files that have been output.

Call format

var dumplist = getCoreDumpList( )

Return value

Returns a list of core dump file names as an array of type String.

argument

None

exception

None

Example of use

var list = GetCoreDumpList();
for (var i = 0; i < list.length; i++) {
    ListBox1.ListItem1.insert(1);
    ListBox1.ListItem1[i+1].Title = list[i].Value;
}

Related item

clearCoreDump、getCoreDump function


ClearCoreDump function

iOSAndroidWindows

Explanation

Deletes the output core dump file.

Call format

var ret = clearCoreDump( [ dumpName ] );

Return value

None

argument

String dumpName

Specify the name of the core dump file to be deleted.

Specify the value obtained from the GetCoreDumpList function.

If not specified, all core dumps will be targeted for deletion.

exception

None

Example of use

/* Already assigned the result of GetCoreDumpList() to ListBox1 */
ClearCoreDump(^.ListBox1.ListItem1[^.ListBox1.Value].Title);

Related item


GetCoreDump function

iOSAndroidWindows

Explanation

Get the File object of the core dump file.

Call format

var ret = getCoreDump( [ dumpName ] );

Return value

Returns the File object of the core dump file.

argument

String dumpName

Specify the name of the core dump file to be acquired.

Specify the value obtained from the GetCoreDumpList function.

If not specified, the last core dump will be the target of acquisition.

exception

RTM-3

Could not open file 'xxx'.

Example of use

/* Already assigned the result of GetCoreDumpList() to ListBox1 */
var name = ^.ListBox1.ListItem1[^.ListBox1.Value].Title;
var f = GetCoreDump(name);
var data = f.ReadBinary();
f.Close();

Related item

clearCoreDump、getCoreDumpList function


Runtime.EndProcess event

This event is left in place for compatibility. Nothing will happen if you manipulate it.


Utterance.Volume property

iOSAndroidWindows

Specifies the reading volume between 0.0 and 1.0. The default is 1.0.

The higher the value, the louder the volume.

It will be internally trimmed to the range configurable by the OS.