home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
math
/
eev
/
testp.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-12-29
|
1KB
|
52 lines
program TestP;
{ 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}
MyReal := 0;
MyErr := false;
{add 2 and 2 and put the result (4) in FRED}
MyAddr := 'FRED';
MyExpr := '2 2 +';
CalcAndStore(MyExpr,MyAddr,MyErr);
{multiply 3 by 7 and put the result (21) in WILMA}
MyAddr := 'WILMA';
MyExpr := '3 7 *';
CalcAndStore(MyExpr,MyAddr,MyErr);
{add FRED (4) and WILMA (21), subtract 1 (24), and store in DINO}
MyAddr := 'DINO';
MyExpr := 'FRED WILMA + 1 -';
CalcAndStore(MyExpr,MyAddr,MyErr);
{look in DINO}
ReadVariable(MyAddr,MyReal,MyBool);
if MyBool then
{couldn't find variable - this is leftover from testing w/o TD}
MyReal := -99999;
{DINO has 24 in it here -- check for yourself using TD or writeln}
{deallocate linked list's memory}
DestroyList;
end. {TestI}