Strings, units and programs
concat(s, t, …)
Section titled “concat(s, t, …)”The strings joined.
concat("beam ", "B1") = "beam B1"strlen(s)
Section titled “strlen(s)”The number of characters in s.
strlen("beam") = 4substr(s, m, n)
Section titled “substr(s, m, n)”n characters of s from position m (counting from 0).
substr("beam B1", 5, 2) = "B1"search(s, t, m)
Section titled “search(s, t, m)”The position of t in s, looking from position m, or −1 if it isn’t there.
search("beam B1", "B", 0) = 5num2str(x)
Section titled “num2str(x)”The number x as a string.
num2str(2.5) = "2.5"str2num(s)
Section titled “str2num(s)”The number written in the string s.
str2num("2.5e3") = 2500IsString(x)
Section titled “IsString(x)”1 if x is a string, 0 if not.
IsString("a") = 1error(s)
Section titled “error(s)”Stops with the message s: in a program, for a value that can’t be used.
if(c, a, b)
Section titled “if(c, a, b)”a if c is true (not zero), otherwise b; only the one chosen is evaluated.
if(2 > 1, "yes", "no") = "yes"SIUnitsOf(x)
Section titled “SIUnitsOf(x)”One of x’s unit in SI, so that x/SIUnitsOf(x) is the plain number.
SIUnitsOf(3 kN) = 1 NUnitsOf(x)
Section titled “UnitsOf(x)”The same as SIUnitsOf.
F := 3 kNF/UnitsOf(F) = 3000time(z)
Section titled “time(z)”The time now in seconds (z is not used), for timing a long calculation.
trace(x, …)
Section titled “trace(x, …)”Returns x, for compatibility with imported sheets.
trace(2) = 2pause(x, …)
Section titled “pause(x, …)”Returns x, for compatibility with imported sheets.
pause(2) = 2use "file.py"
Section titled “use "file.py"”The functions of a Python file, as a module: bt := use "beam.py", then bt.f(x); in the desktop app.