sps.muf

sps.muf · 758 B

From the archive IrvPage250.tar.gz

Download the archive   « Back to the archive contents

( s -- s' )
( This macro strips off the leading spaces of a string.          )
( The algorithm is stolen from auzzie's .del_front_spaces macro. )
( Slightly modified by byte.                                     )
 
: del_front_spaces
dup "" " " subst        ( make copy of string with all spaces stripped  )
dup "" stringcmp not if ( if the original only contained spaces         )
  swap pop              ( we're done                                    )
else                    ( if not, the first character of the new string )
  1 strcut pop          ( is the first non-space character              )
  over swap instr       ( so find out where the first occurance is      )
  1 - strcut swap pop   ( and cut off all the preceding spaces          )
then
;

Site Stats

Snippets: 1791
Codebases: 571