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, Clipboard, and Errors
   Dialog Functions
   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
    controller
    session
    python
   Collections
    array
    map
    bytes
   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:functions:output_formatting_clipboard_errors

Output, Formatting, Clipboard, and Error Functions

These functions write output, build formatted text, work with clipboard text, control output, or intentionally raise user errors.

clear()

Clears the active output target when possible.

Argument Type Description
none No arguments.

Returns: OK result.

Example:

clear();
print('Output was cleared');

enable_print(enabled)

Enables or disables output for the current output sink.

Argument Type Description
`enabled` any Converted to bool. True enables output; false disables output.

Returns: boolean-style number with the new enabled state.

Example:

enable_print(false);
print('hidden');
enable_print(true);
print('visible');

error(value, ...)

Builds an error message from all arguments and raises a user error.

Argument Type Description
`value` any First value to append to the message. Optional.
`…` any Additional values appended to the message.

Returns: does not return normally.

Example:

if(feed <= 0)
{
    error('Invalid feed: ', feed);
};

from_clipboard()

Reads text from the system clipboard.

Argument Type Description
none No arguments.

Returns: string.

Example:

text = from_clipboard();
print(text);

Writes values to the current output stream and appends a newline.

Argument Type Description
`value` any First value to print. Optional.
`…` any Additional values printed without an automatic separator.

Returns: OK result.

Example:

print('X=', x, ', Y=', y);

printf(format, value, ...)

Formats values, writes the result to output, and appends a newline.

Argument Type Description
`format` string Format string using brace-style placeholders. Optional; if omitted, only a newline is written.
`value` any First formatted value. Optional.
`…` any Additional formatted values.

Returns: OK result.

Example:

printf('X={}, Y={}', x, y);
printf('Tool {:d}', toolNumber);

Integer format specifiers convert numeric arguments to integer values before formatting.

sprint(value, ...)

Builds and returns text from all arguments.

Argument Type Description
`value` any First value. Optional.
`…` any Additional values appended without an automatic separator.

Returns: string.

Example:

text = sprint('X=', x, ', Y=', y);

sprintf(format, value, ...)

Formats values and returns the formatted text.

Argument Type Description
`format` string Format string using brace-style placeholders. Optional; if omitted, returns an empty string.
`value` any First formatted value. Optional.
`…` any Additional formatted values.

Returns: string.

Example:

line = sprintf('X={}, Y={}', x, y);

to_clipboard(value)

Writes text to the system clipboard.

Argument Type Description
`value` any Value converted to string and copied to clipboard.

Returns: boolean-style result from the host clipboard operation.

Example:

to_clipboard('Copied text');

Previous: Strings

Next: Dialog Functions

exprv4/reference/functions/output_formatting_clipboard_errors.txt · Last modified: by 127.0.0.1

Page Tools