Difference between pages "Writestring" and "Writebinary"

From Mesham
(Difference between pages)
Jump to navigationJump to search
m (4 revisions imported)
 
m (3 revisions imported)
 
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
This writestring(f,a) function will write the value of ''a'' to the file denoted by handle ''f''.
+
This writebinary(f,a) function will write the value of ''a'' to the file denoted by handle ''f''.
  
* '''Pass:''' The [[File]] handle to write to and the [[String]] to write
+
* '''Pass:''' The [[File]] handle to write to and the [[Int]] variable or value to write into the file in a binary manner
 
* '''Returns:''' Nothing
 
* '''Returns:''' Nothing
  
Line 12: Line 12:
 
  function void main() {
 
  function void main() {
 
     var f:=open("hello.txt","w");
 
     var f:=open("hello.txt","w");
     writestring(f,"hello - test");
+
     writebinary(f,127);
 
     close(f);  
 
     close(f);  
 
  };
 
  };
  
''Since: Version 0.41b''
+
''Since: Version 1.0''
  
 
[[Category:Function Library]]
 
[[Category:Function Library]]
 
[[Category:IO Functions]]
 
[[Category:IO Functions]]

Latest revision as of 15:44, 15 April 2019

Overview

This writebinary(f,a) function will write the value of a to the file denoted by handle f.

  • Pass: The File handle to write to and the Int variable or value to write into the file in a binary manner
  • Returns: Nothing

Example

#include <io>

function void main() {
   var f:=open("hello.txt","w");
   writebinary(f,127);
   close(f); 
};

Since: Version 1.0