home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
A
/
AMORTIZE.LBR
/
AMORT1.IZC
/
AMORT1.INC
Wrap
Text File
|
2000-06-30
|
2KB
|
80 lines
procedure New_Position;
begin
if FIELD > 4 then
FIELD := 1;
if FIELD < 1 then
FIELD := 4;
INPUT[FIELD] := '';
gotoxy(COLUMN_POSITION,ROW_OFFSET+FIELD);
COLUMN := COLUMN_POSITION;
end;
procedure Bad_Data;
begin
gotoxy(6,23);
write('ERROR - bad input format...please reenter. ');
end;
procedure Set_Field;
var ERROR_CODE : integer;
REAL_MONTHS : real;
begin
if ACTIVE then begin
ERROR_CODE := 0;
case FIELD of
1 :
begin
val(INPUT[FIELD],AMOUNT,ERROR_CODE);
if ERROR_CODE > 0 then
Bad_Data
else begin
gotoxy(COLUMN_POSITION-12,ROW_OFFSET+FIELD);
write(AMOUNT:9:2,' ');
end;
end;
2 :
begin
val(INPUT[FIELD],REAL_MONTHS,ERROR_CODE);
MONTHS := trunc(REAL_MONTHS);
if ERROR_CODE > 0 then
Bad_Data
else begin
gotoxy(COLUMN_POSITION-12,ROW_OFFSET+FIELD);
write(MONTHS:9,' ');
end;
end;
3 :
begin
val(INPUT[FIELD],RATE,ERROR_CODE);
if ERROR_CODE > 0 then
Bad_Data
else begin
gotoxy(COLUMN_POSITION-12,ROW_OFFSET+FIELD);
write(RATE:9:2,' ');
end;
end;
4 :
begin
val(INPUT[FIELD],PAYMENT,ERROR_CODE);
if ERROR_CODE > 0 then
Bad_Data
else begin
gotoxy(COLUMN_POSITION-12,ROW_OFFSET+FIELD);
write(PAYMENT:9:2,' ');
end;
end;
end; { case }
ACTIVE := false;
end; { if }
end;