
| keyword | type | mini example | Keywords to change or remember the actual location Loc: |
Right |
txt | r=$CR | move Loc right to next $CR
|
| [1] | r=72 | move Loc right 72 bytes | |
Left |
txt | l=$TAB | move Loc left to next $TAB |
| [1] | l | move Loc left 1 character | |
Begin |
--- | b | set Loc to 1st nonblank in string |
End |
--- | e | set Loc to byte after last nonblank in string
|
Mark1 |
--- | M1 | remember start position for parse/delete/replace/copy string
|
Mark2 |
--- | M2 | remember end position for delete/replace/copy string Mark2 |
Word |
num | word=n | set Loc to 1st byte of n-th word right (n>0) or left (n<0) of current word. For n=0 Loc is set to the 1st byte of current word. Word boundaries can be adjusted by SePaRators |
WordEnd |
txt | we | implicitely set Mark1 and Mark2 to 1st and last byte of current word. If txt is set it will be a separator for the APpendTo command. |
GetPosition |
NUM | gp=j |
|
| vec | gp=pVec | pVec(DOindex) is set to byte location | |
SetPosition |
num | sp=j | set byte location to Loc>0 and Loc<=LEN(string)
|
| vec | sp=pVec | move Loc to pVec(DOindex) | |
ScanFor |
txt | sf=".:!" | scan right for next "." or ":" or "!"
|
ScaNnot |
txt | sn="123" | scan for next byte that is nor 1 or 2 or 3 |
ScanForLeft |
txt | sfl="xy" | scan backward for next x or y |
ScaNnotLeft |
txt | snl=" " | scan backward for next non-blank |
ITeM |
num | itm=5 | set Loc to item start (count SePaRators hits)
|
RaNge |
txt | RN=$CRLF | repeat all in ranges 1...$CRLF...$CRLF.., each new range also restarts DO
|
| num | RN=4 | character ranges 1..4 5..8 9..12 ..
|
|
RangeBegin |
--- | rb | set Loc to begin of range |
| txt | rb="SUBR" | MOVE SCRIPT to next "SUBR", Count=lineNR and/or Option=... may follow) | |
RangEend |
--- | re | Loc to end range (string end if no range) |
Keywords to change the original string: |
|||
Delete |
--- | d | delete_substring(m1:m2) if m1,m2 are set
|
| txt | d=" " | move Loc to next " " and delete this blank | |
| num | d=3 | delete 3 characters starting at current location Loc | |
Insert |
txt | i=$CRLF | insert_string$CRLF at Loc.Note: Characters exceeding the length of string are dropped |
RePLaceby |
txt | rpl="x" | replace string: after either of Right, Left, ScanFor, ScanForLeft, ScanNot, ScanNotLeft, or M1 and M2
|
UpperCase |
[1] | uc=3 | uppercase_string: capitalize 3 characters
|
LowerCase |
[1] | LC | lowercase_stringcharacter at actual location |
TabiFyfont |
txt | TF=3 | tabify string:
|
Keywords to extract information: |
|||
Parse |
txt | p=subtxt | parse_stringto individual substrings:M1>0: subtxt + string(m1:Loc) share memory
|
CoPyTo |
TXT | cpt=word | copy_stringset word to string(m1:m2) if m1 and m2 are set |
APpendTo |
TXT | apt=str | append separator and stringto the variable str. Default separator is a blank, it can be changed with WordEnd=new_separator |
Count |
--- | c | count_occurences:default count start position is = 1 |
| num | c=byte1 | set count start position to byte1 | |
| txt | c=txt | n=txt"s in string(start:Loc), NOTE: set Loc to the end position, e.g. End!
|
|
Keywords to control command execution |
|||
Option |
num | o=1 | search options: case=1, word=2, scan=8, trailing blanks=16, best match=32, verify=64, RegEx=128. For examples click here. |
SePaRators |
txt | spr=".!" | default is " .,(+-*/^;="\<>!:)", bar, $CR, $LF, RangeBegin, RangeEnd |
| num | spr=d | separate string in d bytes for sorting etc | |
DO |
num | do [=n] |
|
IF |
--- | IF, R=8 | next commands up to ELSE or ENDIF only if R=8 OK
|
| txt | IF="@" | continue (max to ELSE ) only if string(loc) == @ | |
ELSE |
[T] | ELSE | next commands only if error after IF |
ContInueiF |
txt | cif="az" | next keyword only IF a <= string(loc) <= z |
ENDIF |
--- | endif | closes IF..ELSE... clause if needed |
EXit |
[T] | ex | exit range scan |
ERror |
LBL | er=99 | (on error jump to label 99) |
lexical commands |
|||
LeXicon |
txt | lx=txt |
|
$Marks |
txt | $m="<>" |
|
$inLeXicon |
txt | $lx=txt |
|
sort string commands |
|||
SorTtoIndex |
num | sti=vec | indices of sorted words goes to vec
|
SorTedtext |
txt | st=lex |
|
SortDelDbls |
txt | sdd=lex | lex is sorted, remove double entries
|
SortFromIndex |
num | sfi=vec | sort words in string along vec (no lower case conversion)
|
SorTColumn1 |
num | stc1=2 | sort starts in word positions 2 (disregard 1st character)
|