Category : Modula II Source Code
Archive   : STRINGS.ZIP
Filename : STRNEW.DEF

 
Output of file : STRNEW.DEF contained in archive : STRINGS.ZIP
(*$M CODE*)(*$D DATA*)
DEFINITION MODULE StrNew;

(* Modified and additional procedures for JPI TopSpeed Modula-2's
Str module by

Carl Neiburger
169 N. 25th St.
San Jose, Calif. 95116

CompuServe No. 72336,2257

See StrNew.MOD for information on using these procedures as an
integral part of JPI's Str.MOD.

*)

PROCEDURE Delete(VAR S: ARRAY OF CHAR; P,L: CARDINAL);
(* This works the same as the procedure in Str but is more efficient
because it uses Lib.Mov instead of a FOR loop to shift characters *)

PROCEDURE Insert(VAR S1: ARRAY OF CHAR; S2: ARRAY OF CHAR; P: CARDINAL);
(* This works the same as the procedure in Str but is more efficient
because it uses Lib.Mov instead of a FOR loop to shift characters *)

PROCEDURE CardToString(N: LONGCARD; VAR S: ARRAY OF CHAR;
FILL: CARDINAL; C: CHAR);
(* This new procedure converts only to decimal numbers. It will fill
out the string to the left of the number for FILL spaces (or SIZE(S)
spaces if SIZE(S) < FILL) with character C. If N is to large to fit
in S, CardToString will return S = '?'

These examples assume that the string variables are long enough to
hold the results:

CardToString( 11, HourStr, 4, ' ')
will set HourStr = ' 11';

CardToString( 9, MinuteStr, 2, '0')
will set MinuteStr = '09';

...and, when you don't want any fill,

CardToString( 12345, NumStr, 0, 0C)
will set NumStr = '12345';

*)

END StrNew.


  3 Responses to “Category : Modula II Source Code
Archive   : STRINGS.ZIP
Filename : STRNEW.DEF

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/