DiagramElements-FreezeValue/en: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
Zeile 31: Zeile 31:
* "<code>\\</code>" for the "\" character.
* "<code>\\</code>" for the "\" character.
* "<code>\0</code>" for a null character (null byte)
* "<code>\0</code>" for a null character (null byte)

By default, variables of the form "<code>$(xxx)</code>" are expanded from either an expecco variable or the shell environment. Thus,
* "<code>$(HOME)/foo/bar</code>" will expand to the name of a subdirectory "foo/bar" under your home directory (in unix). Or if you have a variable named "HOME" in the expecco environment, to whatever that value is.
This behavior can be disabled via the freeze value's popup menu.

In addition, variables of the form "<code>%(xxx)</code>" are expanded by the value of the input pin named "xxx". This expansion is also controlled by a flag in the popup menu.


=== Bytes (ByteArray) ===
=== Bytes (ByteArray) ===

Version vom 20. September 2019, 01:01 Uhr

Introduction[Bearbeiten]

The following describes the data format and syntax used in pin freeze values. In general, the text entered as freeze value is parsed by the input pin's datatype.

Integer[Bearbeiten]

Integer constants can be entered in one of the following formats:

  • decimal (for example: "1234" , "-1234)
  • with Smalltalk radix prefix: (for example: "16rCAFE" , "16r-AA, "8r100, "2r101010000) any radix between 2 and 36 is allowed.
  • with C radix prefix: (for example: "0xCAFE" , "-0xAA, "0b101010000) (0x for hex, 0o for octal, ob for binary).
    Notice that the C-octal notation (prefix 0) is not supported (ie. "0377" will be read as 377).

Float[Bearbeiten]

  • regular floats such as: "123.0", "+123.0", "-123.0", ".123", "123.", "123.0e+2", "123.0e-2"

String[Bearbeiten]

If the pin's datatype is String, then no leading/trailing quotes are needed (actually: if there are quotes, these will be part of the string). However, quotes are needed if the type is not unambiguously a String type (i.e. Any or a Union type).

By default, NO C-style escape sequences are interpreted - i.e. the string is taken "as-is". If you want or need those, enable the "C-Escapes" toggle via the freeze-value's popup menu. You can then use the escapes:

  • "\n" for a newline character
  • "\r" for a return character
  • "\t" for a tab
  • "\b" for a backspace
  • "\xXX" for a single byte hex-character code
  • "\uXXXX" for a 32bit hex-character code
  • "\\" for the "\" character.
  • "\0" for a null character (null byte)

By default, variables of the form "$(xxx)" are expanded from either an expecco variable or the shell environment. Thus,

  • "$(HOME)/foo/bar" will expand to the name of a subdirectory "foo/bar" under your home directory (in unix). Or if you have a variable named "HOME" in the expecco environment, to whatever that value is.

This behavior can be disabled via the freeze value's popup menu.

In addition, variables of the form "%(xxx)" are expanded by the value of the input pin named "xxx". This expansion is also controlled by a flag in the popup menu.

Bytes (ByteArray)[Bearbeiten]

Byte data can be entered in multiple forms:

  • Smalltalk format: "#[ 1 2 3 ]" (spaces between byte values)
  • JSON format: "[ 1, 2, 3 ]" (commas between byte values)
  • C format: "{ 1, 2, 3 }" (braces and commas between byte values)
  • hex format: "xxXXxxXX" (two hex characters per byte; no spaces in-between)
  • hex format: "xx XX xx XX" (two hex characters per byte; with spaces in-between)

Any[Bearbeiten]

To distinguish between strings and non-strings, String-constants for an Any-typed pin must be quoted. For example:

  • "1234" - will be an integer value
  • "1234.56" - will be an float value
  • "'1234'" - will be a string value



Copyright © 2014-2024 eXept Software AG