Suppose you have a Windows text file that you want to convert to OEM text that is readable by someone using MS-DOS. You convert each line using the OEM( ) function:

function convertToOEM( cSourceFile, cDestFile )

   local fSource, fDest 

   fSource = new File( ) 

   fDest = new File( ) 

   fSource.open( cSourceFile ) 

   fDest.create( cDestFile ) 

   do while not fSource.eof( ) 

      fDest.puts( oem( fSource.gets( ) ) ) 

   enddo 

   fDest.close( ) 

   fSource.close( )