home *** CD-ROM | disk | FTP | other *** search
- 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(''<mask>'',<variable or number>)" 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('Too long for pattern display 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('Leading zeros & no decimal using WriteLn(Form(''@###'', 1.985)) (Watch roundoff)');
- WriteLn(Form('@###', 1.985));
- WriteLn;
- WriteLn('A dollar format & star fill using WriteLn(Form(''$*#,###.##'', 28.76))');
- WriteLn(Form('$*#,###.##', 28.76));
- WriteLn;
- WriteLn('Text & numbers using WriteLn(Form(''Payroll Total: $#,###,###.##'', 4567235.98))');
- WriteLn(Form('Payroll Total: $#,###,###.##', 4567235.98));
- ReadLn;
- END.