Difference between revisions of "Fwrite"

From Scriptwiki
Jump to: navigation, search
 
(changed some links due to stupidity)
Line 8: Line 8:
 
| style="width:10%" | '''''Switch''''' || Style="width:90%" | '''''Meaning'''''
 
| style="width:10%" | '''''Switch''''' || Style="width:90%" | '''''Meaning'''''
 
|-
 
|-
| b      || indicates that a &binvar is being specified
+
| b      || indicates that a [[:Category:Binary Files|&binvar]] is being specified
 
|-
 
|-
| n      || appends a $crlf to the line being written.
+
| n      || appends a [[$crlf]] to the line being written.
 
|}
 
|}
  
Line 24: Line 24:
  
 
  /fwrite -n moo moo!
 
  /fwrite -n moo moo!
This will add ''moo!'' and a [[$crlf]] to the end of the file assigned to the name ''moo''.
+
This will add ''moo!'' and a $crlf to the end of the file assigned to the name ''moo''.
  
  
 
  /fwrite -b moo &moo
 
  /fwrite -b moo &moo
This will add the content of the [[:Category:Binary Files|Binary Variable &moo]] to the end of the file assigned to the name ''moo''.
+
This will add the content of the Binary Variable &moo to the end of the file assigned to the name ''moo''.
  
  
 
[[Category:File Handling]][[Category:Commands]]
 
[[Category:File Handling]][[Category:Commands]]

Revision as of 00:52, 19 December 2005

Writes text or the specified binary variable to the file.

/fwrite [-bn] <name> <text | &binvar>


Explanation of the switches:

Switch Meaning
b indicates that a &binvar is being specified
n appends a $crlf to the line being written.


Note that it will append the text to the file. To overwrite / insert, you have to look at /fseek before.

Note that the file has to be opened (/fopen) before.

Example

/fwrite moo moo!

This will just add moo! to the end of the file assigned to the name moo.


/fwrite -n moo moo!

This will add moo! and a $crlf to the end of the file assigned to the name moo.


/fwrite -b moo &moo

This will add the content of the Binary Variable &moo to the end of the file assigned to the name moo.