Access: | !°LIST SUB |
| ( °is the |
|
| |||||||||||
Input/Output: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Level 3/Argument 1 | Level 2/Argument 2 | Level 1/Argument 3 |
| Level 1/Item 1 | ||||||||||
|
|
|
|
|
|
|
|
|
| |||||||
|
| [[ matrix ]]1 | nstartposition |
|
| nendposition |
| → | [[ matrix ]]2 | |||||||
|
| [[ matrix ]] | 1 | {n | , n | column | } |
| n | endposition |
| → | [[ matrix ]] | 2 | ||
|
|
| row |
|
|
|
|
|
| |||||||
|
| [[ matrix ]] | 1 | n | startposition |
| {n | row | ,, n | column | } | → | [[ matrix ]] | 2 | ||
|
|
|
|
|
|
|
|
|
| |||||||
|
| [[ matrix ]] | 1 | {n | , n | column | } | {n | row | ,, n | column | } | → | [[ matrix ]] | 2 | |
|
|
| row |
|
|
|
|
|
| |||||||
|
| “stringtarget” |
| nstartposition |
|
| nendposition |
| → | “stringresult” |
| |||||
|
| { listtarget } |
| nstartposition |
|
| nendposition |
| → | { listresult } |
| |||||
|
| grobtarget |
| { #n1, #m1 } | { #n2 #m2 | } | → | grobresult |
| |||||||
|
| grobtarget |
| ( x1, y1 ) |
| ( x2, y2 ) |
| → | grobresult |
| ||||||
|
| PICT |
| { #n1, #m1 } | { #n2 #m2 | } | → | grobresult |
| |||||||
|
| PICT |
| ( x1, y1 ) |
| ( x2, y2 ) |
| → | grobresult |
| ||||||
| { A B C |
|
|
|
|
|
| |||||||||
Example 1: | D E } 2 4 SUB returns { B C D }. |
|
|
|
|
| ||||||||||
Example 2: | "ABCDE" 0 10 SUB returns "ABCDE". |
|
|
|
|
|
|
|
|
| ||||||
Example 3: | PICT { # 10d #20d } { # 20d # 40d } SUB returns |
|
| |||||||||||||
| Graphic 11 x 21. |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See also: | CHR, GOR, GXOR, NUM, POS, REPL, SIZE |
|
|
|
|
|
|
|
|
| ||||||
SUBST |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Type: | Function |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description: Substitutes a value for a variable in an expression. The value can be numeric or an expression. This is similar to the Where function, denoted by the symbol , but SUBST substitutes without evaluating the resulting expression.
Access: Algebra, …×L, PALG
Input: Level 2/Argument 1: An expression.
Level 1/Argument 2: The value or expression to be substituted.
Output: The expression with the substitution made.
Flags: Exact mode must be set (flag
Example: Substitute x = z+1 for x in the following expression, and apply the EXPAND command to simplify the result:
x2 + 3x + 7
Command: SUBST(X^2+3*X+7,X=Z+1)
EXPAND(ANS(1))
Result: Z^2+5*Z+11
See also: (where command)
SUBTMODType: Function
Description: Performs a subtraction, modulo the current modulus.
Access: Arithmetic, !ÞMODULO L
Full Command and Function Reference