{"id":168,"date":"2020-06-14T12:00:26","date_gmt":"2020-06-14T12:00:26","guid":{"rendered":"https:\/\/blogs.scummvm.org\/djsrv\/?p=168"},"modified":"2022-05-25T00:22:04","modified_gmt":"2022-05-25T00:22:04","slug":"fileio-fun","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/djsrv\/2020\/06\/14\/fileio-fun\/","title":{"rendered":"FileIO Fun"},"content":{"rendered":"<section class=\"body\">This week my focus was on our first XObject, FileIO, which allows Lingo to read\/write files:<\/p>\n<pre><code>set file = FileIO(mNew, \"write\", \"foo.txt\")\r\nfile(mWriteString, \"Hello, world!\" &amp; RETURN)\r\nfile(mDispose)\r\n<\/code><\/pre>\n<p>Relatively simple, so FileIO itself didn\u2019t take long to implement. After that was done, I spent most of the week hunting down and fixing bugs and missing Lingo features in two major FileIO examples, <em>The Apartment<\/em>\u2019s Saving Text and <em>Spaceship Warlock<\/em>.<\/p>\n<p>Funnily enough, I managed to find more scripts that weren\u2019t being loaded, and of course, <em>The Journeyman Project<\/em> was hiding more syntax errors that revealed themselves once these scripts were properly handled:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-170\" src=\"https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2020\/06\/jman-failure2.png\" alt=\"\" width=\"645\" height=\"375\" srcset=\"https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2020\/06\/jman-failure2.png 645w, https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2020\/06\/jman-failure2-300x174.png 300w, https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2020\/06\/jman-failure2-480x279.png 480w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><em>Journeyman<\/em> is a treasure trove of syntax errors. \ud83d\ude42<\/p>\n<\/section>\n<section class=\"body\">Now that all those problems are addressed, I\u2019m proud to announce that <em>Spaceship Warlock<\/em> can now save and load games!<\/section>\n<section class=\"body\"><div style=\"width: 480px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-168-1\" width=\"480\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/Spaceship-Warlock-Save_Load-RR1D1DxUvFM.mp4?_=1\" \/><a href=\"https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/Spaceship-Warlock-Save_Load-RR1D1DxUvFM.mp4\">https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/Spaceship-Warlock-Save_Load-RR1D1DxUvFM.mp4<\/a><\/video><\/div><\/p>\n<p>This will allow us to progress through the game in more than one sitting, making testing the whole thing much easier.<\/p>\n<p>This coming week I\u2019m planning to identify and implement more missing Lingo throughout the game, hopefully bringing it to a much more playable state. See you in a week or so with news on that!<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>This week my focus was on our first XObject, FileIO, which allows Lingo to read\/write files: set file = FileIO(mNew, &#8220;write&#8221;, &#8220;foo.txt&#8221;) file(mWriteString, &#8220;Hello, world!&#8221; &amp; RETURN) file(mDispose) Relatively simple, so FileIO itself didn\u2019t take long to implement. After that was done, I spent most of the week hunting down and fixing bugs and missing [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts\/168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/comments?post=168"}],"version-history":[{"count":9,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts\/168\/revisions"}],"predecessor-version":[{"id":234,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts\/168\/revisions\/234"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/media?parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/categories?post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/tags?post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}