Table of Contents
Scripts > fwrite test
Script contents// // ask user for filename // string FileName set FileName <file.SaveDlg "txt" NULL "Text files (*.txt)|*.txt|All files (*.*)|*.*|"> if <iseq 0 <strlen FileName>> return 0 endif // // Ask user for text to write to file // string s if <not <EditUI &s "Enter file text">> return 0 endif // // Open file // voidptr fp //set fp <zs:fopen FileName "w"> //assert fp "Cannot open file!" assert <fopen_s fp FileName "w"> "Cannot open file!" // // Write text to file // fwrite fp s // // Close file // fclose fp CommentsNone. Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|