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:session

session

`session` is a built-in global object for inspecting and managing Expr sessions.

A session stores root variables, user-defined functions, user-defined classes, and the last result for a named evaluation context.


Properties

Property Type Description
`current` string Name of the active session. The fallback session uses an empty name.
print(session.current);

Methods

list()

Returns session names separated by new lines.

print(session.list());

list_variables()

Returns variables in the current session, one per line.

print(session.list_variables());

list_functions_builtin()

Returns built-in function names, one per line.

list_classes_builtin()

Returns built-in object constructor names, one per line.

list_functions()

Returns user-defined function names in the current session.

list_classes()

Returns user-defined class names in the current session.

create(name)

Creates a new session named `name`, switches the current context to it, and returns an OK result. If the session already exists, returns an error result.

session.create('job1');
print(session.current);      // job1

delete(name)

Deletes the session named `name` and returns an OK result if it existed.

session.delete('old_job');

join(name)

Switches the current context to an existing session. If the session does not exist, an error is raised.

session.join('job1');

leave()

Switches the current context to the fallback empty-name session and returns an OK result.

session.leave();

clear()

Clears variables, user functions, and user classes from the current session. Built-in global objects are restored.

session.clear();

has_variable(sessionName, variableName)

Returns `true` if `sessionName` contains `variableName`.

exists = session.has_variable('job1', 'part_count');

get_variable(sessionName, variableName)

Returns a variable from another session. Object values must be cloneable.

count = session.get_variable('job1', 'part_count');

Previous: settings

Next: python

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

Page Tools