home *** CD-ROM | disk | FTP | other *** search
- program TestP2;
-
- { This is a simple test program I used for POSTFIX.PAS }
-
- Uses
-
- crt,
- postfix;
-
- var
-
- MyReal : real;
- MyExpr : string;
- MyErr,
- MyBool : boolean;
- MyAddr : Str20;
-
- begin
-
- {init test variables}
- MyErr := false;
- MyBool := false;
- MyReal := 0;
-
- while not MyBool do begin
-
- clrscr;
- writeln('Postfix expression evaluator');
- writeln('Enter empty expression to exit');
- writeln;
- writeln('Last result = ',MyReal);
- writeln;
- write('Expression: ');
- readln(MyExpr);
-
- if MyExpr <> '' then begin
-
- Calculate(MyExpr,MyReal,MyErr);
-
- if MyErr then
- {couldn't find variable - this is leftover from testing w/o TD}
- MyReal := -99999;
-
- end
- else
- MyBool := true;
-
-
- end; {while}
-
-
- {deallocate linked list's memory}
- DestroyList;
-
- end. {TestI}
-