CHANGESTR.REX: Difference between revisions

m
condensed assignment of two null variables, changed some comments. -- ~~~~
m (updated some comments in this version of the BIF. -- ~~~~)
m (condensed assignment of two null variables, changed some comments. -- ~~~~)
Line 21:
╚════════════════════════════╝ │ │ │ │ │ │ ╚═════════════════════════╝
↓ ↓ ↓ ↓ ↓ ↓ */
changestr: parse arg o,h,n,t,b,p,$ f /* T, B, & P are optional.*/
$='' /*$: the returned string.*/
/*optional arguments ··· */
t=word(t 999999999 , 1) /*maybe use the default? */
b=word(b 1 , 1) /* " " " " */
Line 37 ⟶ 35:
L=length(o) /*length of OLD string. */
if L==0 & t\=0 then return n || h /*changing a null char? */
f='' /*first part of H if P>1. */
if p\=1 then do /*if P ¬= 1, adjust F & H.*/
f=left(h, min(p-1, length(h))) /*keep first part intact. */