PGA - ProGram Algebra

Molecular Scripting Primitives

MSP is an extension of HMPPV providing instructions that operate on values.

Additional instructions

Operations on numbers:
incr extfocus
Increments the integer value selected by extfocus with 1.
incr extfocus n
Increments the integer value selected by extfocus with n.
incr extfocus1 extfocus2
Increments the integer value selected by extfocus1 with the integer value selected by extfocus2.
decr extfocus
Decrements the integer value selected by extfocus with 1.
Returns false if the value was already 0.
decr extfocus n
Decrements the integer value selected by extfocus with n if the value is larger than or equal to n.
Returns false otherwise.
decr extfocus1 extfocus2
Decrements the integer value selected by extfocus1 with the integer value selected by extfocus2 if it is larger or equal to the value it must be decremented with.
Returns false otherwise.
Operations on strings:
first extfocus1 extfocus2
Takes the first character of the string selected by extfocus1 and assign it as a string of length 1 to extfocus2. If the selected string is empty, false is returned.
delfirst extfocus
Removes the first character from the string selected by extfocus. If the string is empty, false is returned.
append extfocus s
Appends the string s to the end of the string selected by extfocus.
append extfocus1 extfocus2
Appends the string selected by extfocus2 to the end of the string selected by extfocus1.
Type conversions:
int extfocus1 extfocus2
Converts the string selected by extfocus1 to an integer value and assigns it to extfocus2. If no integer value can be obtained from the string, false is returned.
str extfocus1 extfocus2
Converts the integer value selected by extfocus1 to a string and assigns it to extfocus2.