{"id":3193,"date":"2025-04-17T09:50:07","date_gmt":"2025-04-17T09:50:07","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3193"},"modified":"2025-05-07T11:22:32","modified_gmt":"2025-05-07T11:22:32","slug":"include-hash-command","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/","title":{"rendered":"# Include hash command"},"content":{"rendered":"\n<p>The Include hash command lets you include one SPLat source file within another. The effect is the same as manually copying and pasting the contents of one file into another.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>Suppose you have a file named&nbsp;<code>maths.spt<\/code>&nbsp;that looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>kfPI   fEQU 3.14159265359<br><br>; Calculate the volume of a cylinder, the formula is:<br>;    V = pi * r^2 * h<br>; PARAMETERS:<br>; w = radius<br>; q = height <br>; RETURNS<br>; w = volume<br>subCylinderVolume:<br>   WtoU    0    ;save \"r\"<br>   fMul         ;r * h<br>   UtoQ    0    ;recall \"r\"<br>   fMul         ;r * r * h<br>   fLoadQ  kfPI<br>   fMul         ;pi * r * r * h<br>   Return<br><\/pre>\n\n\n\n<p>Then in your main file you have:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">...<br>...<br>  fLoadW   2.5  ;2.5m radius<br>  fLoadQ   1.0 ;1m of water<br>  GoSub    subCylinderVolume ;calc volume of water<br>...<br>...<br>   #Include File(\"maths.spt\")<\/pre>\n\n\n\n<p>When your main file is translated by SPLat\/PC, the line<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   #Include File(\"maths.spt\")<\/code><\/pre>\n\n\n\n<p>gets replaced by the entire contents of the file&nbsp;<code>maths.spt<\/code>&nbsp;. It is as if you had copied and pasted one file into another. You effectively end up with:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>...<br>...<br>  fLoadW   2.5  ;2.5m radius<br>  fLoadQ   1.0 ;1m of water<br>  GoSub    subCylinderVolume ;calc volume of water<br>...<br>...<br>kfPI   fEQU 3.14159265359<br><br>; Calculate the volume of a cylinder, the formula is:<br>;    V = pi * r^2 * h<br>; PARAMETERS:<br>; w = radius<br>; q = height <br>; RETURNS<br>; w = volume<br>subCylinderVolume:<br>   WtoU    0    ;save \"r\"<br>   fMul         ;r * h<br>   UtoQ    0    ;recall \"r\"<br>   fMul         ;r * r * h<br>   fLoadQ  kfPI<br>   fMul         ;pi * r * r * h<br>   Return<br><\/pre>\n\n\n\n<p>This is a very useful way of managing projects, and of keeping your favourite routines and code snippets in a library.<\/p>\n\n\n\n<p>You can have any number of&nbsp;<code>Include<\/code>&nbsp;hash commands in a file. You can even have includes within included files. Included files can be nested 10 deep. You cannot have recursive inclusions, such as a file including itself or two files that include each other as this will violate the allowed nesting depth.<\/p>\n\n\n\n<p>The Include hash command gives you a powerful mechanism for building and using libraries.<\/p>\n\n\n\n<p>You cannot single step or simulate any hash command, including the&nbsp;<code>Include<\/code>&nbsp;hash command. You can however use the menu item&nbsp;<code>File&gt;Pre-process<\/code>&nbsp;to generate a file where all the hash commands have been processed and the resultant code has been generated.<\/p>\n\n\n\n<p>The\u00a0<code>#Include<\/code>\u00a0hash command is available in SPLat\/PC\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5366\">Build<\/a>\u00a0181 and later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Include hash command lets you include one SPLat source file within another. The effect is the same as manually copying and pasting the contents&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3171,"menu_order":21,"template":"","class_list":["post-3193","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title># Include hash command - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"# Include hash command - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"The Include hash command lets you include one SPLat source file within another. The effect is the same as manually copying and pasting the contents...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-07T11:22:32+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/\",\"name\":\"# Include hash command - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-17T09:50:07+00:00\",\"dateModified\":\"2025-05-07T11:22:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programming reference\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Directives\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"# Include hash command\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"# Include hash command - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"# Include hash command - SPLat Controls","og_description":"The Include hash command lets you include one SPLat source file within another. The effect is the same as manually copying and pasting the contents...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/","og_site_name":"SPLat Controls","article_modified_time":"2025-05-07T11:22:32+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/","name":"# Include hash command - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-17T09:50:07+00:00","dateModified":"2025-05-07T11:22:32+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/include-hash-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Programming reference","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/"},{"@type":"ListItem","position":3,"name":"Directives","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/"},{"@type":"ListItem","position":4,"name":"# Include hash command"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3171"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}