Oxygene for Java

The language Oxygene from RemObjects is a dialect of our favourite teaching language but "is not your Daddy's Pascal". The Oxygene for Java compiler translates Pascal-like code to Java bytecode. This can be run in applets in Web pages or by the Java Virtual Machine (JVM) directly. The compiler will also output code that will run on Android devices and emulators. See Getting Started with Oxygene for Java for links to documentation and downloads of the required software. You will find that books and web pages on the Java language will help you to write code in Oxygene for Java.

Follow the numbered links at the foot of the page to the tutorial sections.

While learning Oxygene for Java (following our philosophy of "learning by doing"), we have converted existing Pascal programs. Follow these links to converted student programs and brief notes on the different language features encountered.

  • The conversion of the student console program RockPaperScissors, demonstrates random numbers, output of strings and input of individual characters.
  • Random numbers are also an essential feature of Roulette, which illustrates in addition the input and output of integers and real numbers.
  • See Crossword for input from file and from a string typed at the keyboard.
  • The conversion of Arithmetic shows how assignments and constructs for repetition and selection can be retained and that arrays must be zero-based.
  • MultiDraw demonstrates input from the keyboard and mouse and use of the Graphics2D object in an applet.

 

Changes (October 2013)

Programs that input data from the command line now use arrays of SByte (instead of Byte). Some of the code is simpler, taking advantage of the new TINY option and also outputting with writeln instead of System.out.println. The command msbuild myfile.oxygene now replaces Oxygene myfile.oxygene and in each project file the line
<Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\RemObjects.Oxygene.Cooper.targets" />
replaces
<Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\RemObjects.Oxygene.Java.targets" />.

 

Programming - a skill for life!

Pascal Programming Tutorials