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. ====== Write statement ====== ==== Description ==== Inserts or updates a row in the table. If the row does not exist, a new one will be created in the table. It the row does exist, it will be overwritten. ==== Syntax ==== **Write** //expression// on | to //filevar//, //key// then | else //statements// ==== Parameters ==== The Write statement has the following parameters. ^Parameter^Description^ |//Expression//|Evaluates to the row that is to be written to the table.| |//Filevar//|Refers to a table variable that has been opened in a previous Open statement.| |//Key//|Specifies the key of the record to be written.| |Then|The statement(s) following Then are executed if the record is written successfully.| |Else|The statement(s) following Else are executed if the row cannot be written. The Status() function indicates the severity of the error, and the system variable @FILE_ERROR contains detail about the nature of the error.\\ || ==== See Also ==== [[open|Open]], [[matread|MatRead]], [[matwrite|MatWrite]], [[read|Read]], [[readv|ReadV]], [[writev|WriteV]] ==== Example ==== <code> /* The program reads row 100 in the CUSTOMER file and writes a value to column 5. */ @ID = 100 open "CUSTOMER" To FILE_CUSTOMER then read REC From FILE_CUSTOMER, @ID then REC<5> = "Stamford" Write REC On FILE_CUSTOMER, @ID else status = Set_FSError() end end end </code> guides/programming/programmers_reference_manual/write.txt Last modified: 2024/06/19 20:20by 127.0.0.1