From b433dea8712019b30fdfb1fac10eaf8e8c808cd2 Mon Sep 17 00:00:00 2001 From: oscarl-2 Date: Sat, 20 Dec 2003 08:52:06 +0000 Subject: [PATCH] initial commit --- bepascal/source/bepascal/test/OpTest.pas | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bepascal/source/bepascal/test/OpTest.pas diff --git a/bepascal/source/bepascal/test/OpTest.pas b/bepascal/source/bepascal/test/OpTest.pas new file mode 100644 index 0000000..1dfa77e --- /dev/null +++ b/bepascal/source/bepascal/test/OpTest.pas @@ -0,0 +1,35 @@ +program OpTest; + +uses + BeObj, SysUtils, AppDefs; + +const + B_TESTING = 'TeSt'; + +var + Testing : Longword; + tmp : Longword; + +begin + WriteLn('This value correspond to AppDefs''s B_ABOUT_REQUESTED:'); + WriteLn(IntToStr(B_ABOUT_REQUESTED)); + WriteLn('and this other is made using the := operator'); + Testing := '_ABR'; + WriteLn(IntToStr(Testing)); + WriteLn('Comparing both as integer types:'); + if Testing = B_ABOUT_REQUESTED then + WriteLn('Fear C! this coder knows things! :-)') + else + WriteLn('Boooo!!! the programmer must be dumb!'); + + WriteLn('--------------------------------'); + WriteLn('Direct assignment to Longword type:'); + tmp := B_TESTING; + WriteLn('tmp: ', tmp); + WriteLn('Typecasting to Longword type:'); + tmp := tmp + Longword(B_TESTING); + WriteLn('tmp: ', tmp); + WriteLn('Typecasting to integer type:'); + tmp := tmp - Integer(Longword(B_TESTING)); + WriteLn('tmp: ', tmp); +end. \ No newline at end of file