Skip to content

Strings, units and programs

The strings joined.

concat("beam ", "B1") = "beam B1"

The number of characters in s.

strlen("beam") = 4

n characters of s from position m (counting from 0).

substr("beam B1", 5, 2) = "B1"

The position of t in s, looking from position m, or −1 if it isn’t there.

search("beam B1", "B", 0) = 5

The number x as a string.

num2str(2.5) = "2.5"

The number written in the string s.

str2num("2.5e3") = 2500

1 if x is a string, 0 if not.

IsString("a") = 1

Stops with the message s: in a program, for a value that can’t be used.

a if c is true (not zero), otherwise b; only the one chosen is evaluated.

if(2 > 1, "yes", "no") = "yes"

One of x’s unit in SI, so that x/SIUnitsOf(x) is the plain number.

SIUnitsOf(3 kN) = 1 N

The same as SIUnitsOf.

F := 3 kN
F/UnitsOf(F) = 3000

The time now in seconds (z is not used), for timing a long calculation.

Returns x, for compatibility with imported sheets.

trace(2) = 2

Returns x, for compatibility with imported sheets.

pause(2) = 2

The functions of a Python file, as a module: bt := use "beam.py", then bt.f(x); in the desktop app.