Sidebar

Home



Expressions V4


Tutorials

How-To

Reference

  Lexical basics
  Type system
  Variables and assignment
  Operators
  Expression rules
  Control flow
  Functions
  Built-in functions
   None and NaN
   Arithmetic
   Algebra
   Logarithmic and Exponential
   Trigonometric
   Rounding and Centering
   Strings
   Output, Formatting, and Errors
   Dialogs, Clipboard, Platform, and Paths
  Methods and properties
  Built-in methods
   Common Value Methods
   Number Methods
   String Basic Methods
   String Slice Methods
   String Parsing Methods
   String Formatting Methods
   String Regex Methods
   String Trim and Case Methods
  Objects
  Built-in objects
   Global objects
    settings
    session
    python
   Collections
    array
    map
    data_array
   File Format I/O
    image_data
    image_stream
   Utils
    crypto
    timer
   Comm
    serial
   Dialogs
    file_open
    file_save
    msg_ok
    msg_ok_cancel
    msg_yes_no
    msg_password
   GUI objects
    window
    panel
    group
    splitpanel
    label
    textbutton
    drawablebutton
    togglebutton
    togglegroup
    textinput
    textedit
    numinput
    slider
    combobox
    listbox
    progressbar
    led
    separator
    menu
    image
    snake
  Classes and user-defined objects
  Include system
  Error model
  Execution model and sessions
  Host integration
  Limits and performance
  Formal reference
  Glossary

Cookbook

exprv4:reference:objects:settings

settings

`settings` is a built-in global object for reading and writing host application settings.

It is used directly by name. Do not call `settings()`.


Methods

exists(name)

Returns `true` if a setting with `name` exists.

if (settings.exists('displayX'))
{
    print('setting exists');
}

get(name)

Returns the setting value. If the setting does not exist, an error is raised.

x = settings.get('displayX');

set(name, value)

Sets a setting value and returns an OK result. If the setting does not exist or the value is invalid, an error is raised.

settings.set('displayX', 100);

Properties

Known settings can also be read as properties:

x = settings.displayX;

Use `exists(name)` before reading optional or host-version-specific settings.


Assignment

`settings` is a built-in global object. The name itself cannot be overwritten:

settings = 1;     // error

Previous: Global objects

Next: session

exprv4/reference/objects/settings.txt · Last modified: by 127.0.0.1

Page Tools