Dec 112017
 
TP4.0 BCD math FORM function from TP3.0.
File FORM.ZIP from The Programmer’s Corner in
Category Pascal Source Code
TP4.0 BCD math FORM function from TP3.0.
File Name File Size Zip Size Zip Type
_FORM.DOC 1618 616 deflated
_FORM.PAS 4421 1030 deflated

Download File FORM.ZIP Here

Contents of the _FORM.DOC file


PROGRAM Form_Test;
{ This test program uses the Turbo Pascal Unit "_FORM" which partially
replaces the FORM function in Turbo Pascall 3.0 with BCD. The calling
procedure is shown below in examples. Please feel free to improve and
upload improvements. - Paul Mayer [70040,645] }

USES CRT, _FORM;
VAR
I : Word;

BEGIN
ClrScr;
WriteLn('A few examples of using the "Form('''',)" function.');
WriteLn('Written by Paul Mayer for compatibility with Turbo Pascal 3.0 with BCD as the');
WriteLn('"Form" function is not included in the new Turbo Pascal version 4.0. ');
WriteLn;
WriteLn('Numbers and comma delimiter using WriteLn(Form(''###,###.##'', 67235.98))');
WriteLn(Form('###,###.##', 67235.98));
WriteLn;
WriteLn('Numbers too big for pattern using WriteLn(Form(''###,###.##'', 6723543.98))');
WriteLn(Form('###,###.##', 6723543.98));
WriteLn;
WriteLn('Small Numbers using WriteLn(Form(''###.##'', 3.98))');
WriteLn(Form('###.##', 3.98));
WriteLn;
WriteLn('Format past the decimal point using WriteLn(Form(''#.###'', 1.985))');
WriteLn(Form('#.###', 1.985));
WriteLn;
WriteLn('Numbers without decimal using WriteLn(Form(''####'', 1.985)) (Watch the roundoff)');
WriteLn(Form('####', 1.985));
WriteLn;
WriteLn('Numbers as a dollar format using WriteLn(Form(''$#,###.##'', 2876.89))');
WriteLn(Form('$#,###.##', 2876.89));
WriteLn;
WriteLn('Text & numbers using WriteLn(Form(''Payroll Total: $#,###,###.##'', 4567235.98))');
WriteLn(Form('Payroll Total: $#,###,###.##', 4567235.98));

END.


 December 11, 2017  Add comments

Leave a Reply