Resource type


MIDlet applications can pack various resource files inside the JAR file (which contains the MIDlet bytecode). The resources can be handled at runtime using the following functions and procedures:

  var res   : resource;
      byte  : integer;
      line  : string;
      index : integer;
  begin
      res := openResource('/data.txt');
	
      if (resourceAvailable(res)) then
      begin
          byte := readByte(res);
	  line := readLine(res);
		
          closeResource(res);
      end;
      
      showForm;
      index := formAddString('Byte is: ' + chr(byte));
      index := formAddString('Line is: ' + line);
      delay(1000);
  end.