User Tools

Site Tools


en:freefile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:freefile [2016/08/12 21:28]
admin
en:freefile [2020/02/28 10:46]
Line 1: Line 1:
-===== Freefile (Function) ===== 
  
-==== Format ==== 
-**freefile**\\ 
-**freefile** ( ) 
- 
-returns [[integerexpressions|integer_expression]] 
-==== Description ==== 
-BASIC256 allows for multiple files to be opened at a single time.  The **freefile** function returns a free [[integerexpressions|open_file_number]] that you can use in your next [[Open|Open]] or [[Open|Openb]].  Once a file is closed, **freefile** will return that [[integerexpressions|open_file_number]] to the list of available file numbers and may reissue that number. 
- 
-==== Example ==== 
-<code># copy one binary file to another 
-k = 0 
-source = freefile 
-openb source,"file.pdf" 
-dest = freefile 
-openb dest,"file_copy.pdf" 
-reset dest 
-while not eof(source) 
-   writebyte dest, readbyte(source) 
-   k++ 
-end while 
-close dest 
-close source 
-print k + " bytes copied." 
-</code> 
- 
- 
-==== See Also ==== 
-{{page>en:start#File and Serial Port Input/Output&noheader}} 
- 
-==== History ====  
-|0.9.9.17|New to Version| 
en/freefile.txt ยท Last modified: 2020/02/28 10:46 (external edit)