{"id":2936,"date":"2019-03-25T17:41:54","date_gmt":"2019-03-25T20:41:54","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/kb31507-creating-functions-in-e3-scripts\/"},"modified":"2020-01-23T16:55:52","modified_gmt":"2020-01-23T19:55:52","slug":"kb31507-creating-functions-in-e3-scripts","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/","title":{"rendered":"KB-31507: Creating Functions in E3 scripts."},"content":{"rendered":"<div style=\"text-align: justify;\"><span style=\"font-weight: bold;\">Question:<\/span><\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">\n<p>How can I create a Function in an E3 script?<\/p>\n<p><span style=\"font-weight: bold;\">Solution:<\/span><\/p>\n<p>A simple example of how to do it would be:<\/p>\n<div style=\"text-align: left;\"><span style=\"font-family: Courier New; color: #000000;\">Sub CommandButton1_Click()<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">\u00a0\u00a0 MsgBox Function()<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">End Sub<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">Function Function()<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">\u00a0\u00a0 Function = 5 * 10<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">End Function<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">Sub Temp()<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">End Sub<\/span><\/div>\n<p>Please notice that you will not be able to edit the lines with <span style=\"font-family: Courier New; color: #000000;\">Sub <\/span>and <span style=\"font-family: Courier New; color: #000000;\">End Sub<\/span> in <span style=\"font-weight: bold;\">E3 <\/span>scripts. Therefore, you will need to add an <span style=\"font-family: Courier New; color: #000000;\">End Sub<\/span> to be able to declare the Function, and then a <span style=\"font-family: Courier New; color: #000000;\">Sub <\/span>so that <span style=\"font-family: Courier New; color: #000000;\">End Sub<\/span> is not dangling in the script and causing errors.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Question: &nbsp; How can I create a Function in an E3 script? Solution: A simple example of how to do it would be: Sub CommandButton1_Click()\u00a0\u00a0 MsgBox Function()End SubFunction Function()\u00a0\u00a0 Function&hellip;<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[763],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-31507: Creating Functions in E3 scripts. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-31507: Creating Functions in E3 scripts.\" \/>\n<meta property=\"og:description\" content=\"Question: &nbsp; How can I create a Function in an E3 script? Solution: A simple example of how to do it would be: Sub CommandButton1_Click()\u00a0\u00a0 MsgBox Function()End SubFunction Function()\u00a0\u00a0 Function&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:41:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-23T19:55:52+00:00\" \/>\n<meta name=\"author\" content=\"Samir Lima\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Samir Lima\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/\"},\"author\":{\"name\":\"Samir Lima\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/6187f4add11d5e8b204dc7032d2f15cf\"},\"headline\":\"KB-31507: Creating Functions in E3 scripts.\",\"datePublished\":\"2019-03-25T20:41:54+00:00\",\"dateModified\":\"2020-01-23T19:55:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/\"},\"wordCount\":98,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/\",\"name\":\"[:pt]KB-31507: Creating Functions in E3 scripts.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:41:54+00:00\",\"dateModified\":\"2020-01-23T19:55:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-31507: Creating Functions in E3 scripts.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/6187f4add11d5e8b204dc7032d2f15cf\",\"name\":\"Samir Lima\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e9f438f26a32e9429a4f6073c6598fae?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e9f438f26a32e9429a4f6073c6598fae?s=96&d=mm&r=g\",\"caption\":\"Samir Lima\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/samirlima\"],\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/samir\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-31507: Creating Functions in E3 scripts. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]KB-31507: Creating Functions in E3 scripts.[:] - Elipse Knowledgebase","og_description":"Question: &nbsp; How can I create a Function in an E3 script? Solution: A simple example of how to do it would be: Sub CommandButton1_Click()\u00a0\u00a0 MsgBox Function()End SubFunction Function()\u00a0\u00a0 Function&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:41:54+00:00","article_modified_time":"2020-01-23T19:55:52+00:00","author":"Samir Lima","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Samir Lima"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/"},"author":{"name":"Samir Lima","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/6187f4add11d5e8b204dc7032d2f15cf"},"headline":"KB-31507: Creating Functions in E3 scripts.","datePublished":"2019-03-25T20:41:54+00:00","dateModified":"2020-01-23T19:55:52+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/"},"wordCount":98,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/","url":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/","name":"[:pt]KB-31507: Creating Functions in E3 scripts.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:41:54+00:00","dateModified":"2020-01-23T19:55:52+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb31507-creating-functions-in-e3-scripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-31507: Creating Functions in E3 scripts."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/6187f4add11d5e8b204dc7032d2f15cf","name":"Samir Lima","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9f438f26a32e9429a4f6073c6598fae?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9f438f26a32e9429a4f6073c6598fae?s=96&d=mm&r=g","caption":"Samir Lima"},"sameAs":["https:\/\/www.linkedin.com\/in\/samirlima"],"url":"https:\/\/kb.elipse.com.br\/en\/author\/samir\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2936"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=2936"}],"version-history":[{"count":1,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2936\/revisions"}],"predecessor-version":[{"id":10036,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2936\/revisions\/10036"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=2936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=2936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=2936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}