Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== OSWrite statement ====== ==== Description ==== Writes data to the specified operating system file. ==== Syntax ==== **OSWrite** //expression// On %%|%% To //file// ==== Parameters ==== The OSWrite statement has the following parameters. ^Parameter^Description^ |//expression//|Pass the string or dynamic array to be written, in expression.| |//file//|The name of the operating system file (including the path, filename, and extension) to which expression is to be written. This is not a file variable.\\ \\ If the operating system file exists, it will be overwritten with the new data. If the operating system file does not exist, it will be created.| ==== Returns ==== After the execution of an OSWrite statement, the [[status|Status()]] of the write is returned, with one of the following codes. ^Value^Meaning^ |0|No error.| |1|Bad OS filename.| |2|Access denied by operating system.| |3|Disk or directory full.| |4|File does not exist.| |5|Unknown error.| |6|Attempt to write to a read-only file.| ==== See Also ==== [[osbread|OSBRead]], [[osbwrite|OSBWrite]], [[osclose|OSClose]], [[osdelete|OSDelete]], [[osopen|OSOpen]], [[osread|OSRead]] ==== Example ==== <code> /* write a file containing tab-delimited data */ equ crlf$ to char(13):char(10) equ tab$ to char(09) data = "" data<-1> = "Tom":@vm:"Charles":@vm:"Administrator" data<-1> = "Will":@vm:"Roberts":@vm:"System Administrator" data<-1> = "Adrian":@vm:"Wilson":@vm:"User" swap @fm with crlf$ in data swap @vm with tab$ in data filename = 'C:\temp\my_data.txt' OSWrite data To filename </code> guides/programming/programmers_reference_manual/oswrite.txt Last modified: 2024/06/19 20:20by 127.0.0.1