Difference between pages "Extern" and "Writestring"

From Mesham
(Difference between pages)
Jump to navigationJump to search
(Created page with '== Syntax == extern[location] Where ''location'' is optional == Semantics == Provided as additional allocation type information, this tells the compiler NOT to allocate memor…')
 
m
 
Line 1: Line 1:
== Syntax ==
+
== Overview ==
  
extern[location]
+
This writestring(f,a) function will write the value of ''a'' to the file denoted by handle ''f''.
  
Where ''location'' is optional
+
* '''Pass:''' The [[File]] handle to write to and the [[String]] to write
 +
* '''Returns:''' Nothing
  
== Semantics ==
+
== Example ==
  
Provided as additional allocation type information, this tells the compiler NOT to allocate memory for the variable as this has been already done externally. The ''location'' argument is optional and just tells the compiler where the variable is to be found (e.g. a C header file) if required.
+
#include <io>
 +
var f:=open("hello.txt","w");
 +
writestring(f,"hello - test");
 +
close(f);
  
[[Category:Type Library]]
+
''Since: Version 0.41b''
[[Category:Composite Types]]
+
 
[[Category:Attribute Types]]
+
[[Category:Function Library]]
 +
[[Category:IO Functions]]

Revision as of 18:42, 13 January 2013

Overview

This writestring(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
  • Returns: Nothing

Example

#include <io>
var f:=open("hello.txt","w");
writestring(f,"hello - test");
close(f); 

Since: Version 0.41b