Metropoli BBS
VIEWER: blankstr.s MODE: TEXT (ASCII)
* BLANKSTR by Randy Ding.  Creates a string of n spaces.
* Input: n (real)
* Output: string of n spaces

::
 CK1NOLASTWD
 CK&DISPATCH1 ONE              ( *real, desired length of string* )
 ::
  COERCE
  CODE
           GOSBVL  =SAVPTR
           A=DAT1  A           ->obj on stack top
           D1=A
           D1=D1+  5           skip bint prolog
           C=DAT1  A           read value of bint on dsktop
           C=C+C   A           * 2 for nibs
           GOSBVL  =MAKE$N     create string in tempob
           A=R0.F  A           ->new string
           DAT1=A  A           overwrite pointer on top of stack
           D1=A
           D1=D1+  5           skip prolog
           C=DAT1  A           read created length in nibs
           C=C-CON A,5         -5 nibs for length field
           CSRB.F  A           div nibs by 2 for # chars (bytes)
           C=C-1   A           count thru 0
           GOC     DONE        exit if null
           D1=D1+  5           skip length field
           LA(2)   32          space char
CLEARLUP   DAT1=A  B           write one char
           D1=D1+  2           next byte
           C=C-1   A           dec counter
           GONC    CLEARLUP    count thru 0
DONE       GOVLNG  =GETPTRLOOP
  ENDCODE
 ;
;
[ RETURN TO DIRECTORY ]